/* ============================================================================
   "ADD YOUR EMAIL" PROMPT  —  username-only (anonymous) accounts
   ----------------------------------------------------------------------------
   Markup: views/partials/anon-email-prompt.hbs   Logic: public/js/anon-email-prompt.js
   Background: docs/ANONYMOUS_ACCOUNTS.md

   Its own sheet rather than a Bootstrap modal: it has to be able to appear over
   the chat (which already owns several stacked overlays) without depending on
   Bootstrap's JS being loaded on the page, and without inheriting the platform's
   `.modal-header` chrome. Every colour is a theme token, so it follows whichever
   skin theme.css has lit.
   ========================================================================== */

.anon-email-prompt[hidden] {
    display: none;
}

.anon-email-prompt {
    position: fixed;
    inset: 0;
    /* Above the app chrome and the chat overlays, below a native alert. */
    z-index: 2200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}

.aep-scrim {
    position: absolute;
    inset: 0;
    background: var(--surface-veil);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.aep-sheet {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 22px 20px 18px;
    border-radius: 20px;
    background: var(--surface-overlay);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
    text-align: center;
    animation: aepIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes aepIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .aep-sheet { animation: none; }
}

.aep-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--ink-muted);
    font-size: 0.72rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.aep-close:hover {
    background: var(--glass-strong);
    color: var(--ink);
}

.aep-badge {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: var(--brand-fill-soft);
    color: var(--brand-fill);
    font-size: 1.25rem;
}

.aep-title {
    margin: 0 0 6px;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.aep-body {
    margin: 0 0 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

.aep-reward {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 13px;
    background: var(--glass);
    border: 1px solid var(--line);
    text-align: left;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--ink-soft);
}

.aep-reward i {
    flex: none;
    font-size: 1.05rem;
    color: var(--status-warning);
}

.aep-reward b {
    color: var(--ink);
}

.aep-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aep-input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: var(--surface-sunken);
    color: var(--ink);
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--brand-fill);
    font-size: 0.9rem;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aep-input::placeholder {
    color: var(--ink-muted);
    -webkit-text-fill-color: var(--ink-muted);
    opacity: 1;
}

.aep-input:focus {
    outline: none;
    border-color: var(--brand-fill);
    box-shadow: 0 0 0 3px var(--brand-fill-soft);
}

.aep-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 13px;
    background: var(--brand-gradient);
    color: var(--brand-ink);
    font-size: 0.88rem;
    font-weight: 700;
    transition: opacity 0.15s ease;
}

.aep-submit:disabled {
    opacity: 0.55;
    cursor: progress;
}

.aep-error {
    margin: 10px 0 0;
    font-size: 0.76rem;
    color: var(--status-danger);
}

.aep-error[hidden] {
    display: none;
}

.aep-fineprint {
    margin: 12px 0 0;
    font-size: 0.7rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

.aep-later {
    margin-top: 10px;
    padding: 6px 12px;
    border: none;
    background: none;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.aep-later:hover {
    color: var(--ink-soft);
}

@media (min-width: 560px) {
    .anon-email-prompt {
        align-items: center;
    }
}
