/* ═══════════════════════════════════════════════════════════
   Auth (login telefono + verifica OTP) — Cartomanti.AI
   Mobile-first, coerente con la palette principale.
   ═══════════════════════════════════════════════════════════ */

.auth-screen {
    min-height: calc(100vh - 60px - 120px);
    display: flex;
    /* Diego (2026-05-15): la trust bar ora vive FUORI dalla card → la
       screen deve impilare verticalmente (card sopra, trust sotto),
       non in riga. */
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 28px 18px 40px;
    background:
        radial-gradient(1200px 600px at 50% -10%, var(--c-primary-50), transparent 70%),
        linear-gradient(180deg, #fff8f1 0%, var(--c-bg) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--c-bg-elev);
    border-radius: var(--r-xl, 22px);
    padding: 30px 24px 26px;
    box-shadow:
        0 10px 30px rgba(42, 31, 61, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.6) inset;
    border: 1px solid rgba(235, 226, 232, 0.7);
    text-align: center;
}

/* ── Icona header ──
   Diego (2026-05-15): "su accedi e registrati, lascia il simbolo del
   cellulare senza contenitore". Solo emoji, niente cerchio/sfondo. */
.auth-icon {
    width: auto; height: auto;
    margin: 0 auto 12px;
    display: block;
    text-align: center;
    font-size: 44px;            /* ingrandito perché ora è "nudo" */
    line-height: 1;
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

.auth-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--c-ink);
    margin: 0 0 8px;
    line-height: 1.2;
}

.auth-sub {
    color: var(--c-ink-soft);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0 0 22px;
}

.auth-sub strong {
    color: var(--c-primary-700);
    font-weight: 700;
}

/* ── Form ── */
.auth-form {
    text-align: left;
    margin: 0 0 18px;
}

.auth-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-ink);
    margin: 0 0 8px;
    letter-spacing: 0.01em;
}

.auth-phone-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1.5px solid var(--c-line);
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-phone-wrap:focus-within {
    border-color: var(--c-primary-300);
    box-shadow: 0 0 0 4px rgba(107, 33, 168, 0.08);
}

.auth-phone-flag {
    font-size: 22px;
    line-height: 1;
}

.auth-input {
    width: 100%;
    border: 1.5px solid var(--c-line);
    border-radius: 12px;
    padding: 14px 14px;
    font-size: 17px;
    color: var(--c-ink);
    background: #fff;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
}

/* L'input dentro al .auth-phone-wrap perde il bordo (è il wrap a farlo) */
.auth-phone-wrap .auth-input {
    border: none;
    border-radius: 0;
    padding: 14px 0;
    background: transparent;
    box-shadow: none;
}

.auth-input:focus {
    outline: none;
    border-color: var(--c-primary-300);
    box-shadow: 0 0 0 4px rgba(107, 33, 168, 0.08);
}

.auth-input-otp {
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: 800;
    font-size: 28px;
    padding: 18px 14px;
    font-variant-numeric: tabular-nums;
}

.auth-hint {
    font-size: 12px;
    color: var(--c-ink-mute);
    margin: 8px 2px 16px;
    line-height: 1.4;
}

.auth-hint strong {
    color: var(--c-ink-soft);
    font-weight: 700;
}

/* ── Checkbox consenso 18+ ── */
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    color: var(--c-ink-soft);
    line-height: 1.5;
    margin: 14px 0 18px;
    text-align: left;
    cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.auth-checkbox a {
    color: var(--c-primary-700);
    text-decoration: underline;
    font-weight: 600;
}

.auth-checkbox strong {
    color: var(--c-ink);
    font-weight: 700;
}

/* Checkbox facoltativo (marketing opt-in): meno evidente del 18+ */
.auth-checkbox-optional {
    margin-top: -6px;
    font-size: 12.5px;
    color: var(--c-ink-soft);
    opacity: .88;
}

/* ── Pulsanti ── */
.auth-submit {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    margin-top: 4px;
}

/* ── Errore ── */
.auth-alert {
    background: #fff1f0;
    color: var(--c-danger);
    border: 1px solid #f4c4be;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 16px;
    text-align: left;
    font-weight: 500;
}

/* ── Trust bar ── */
.auth-trust {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px 20px;
    font-size: 12.5px;
    color: var(--c-ink-mute);
    margin: 18px 0 8px;
    font-weight: 500;
}

.auth-meta {
    font-size: 11.5px;
    color: var(--c-ink-mute);
    margin: 12px 0 0;
    line-height: 1.5;
}

/* ── Reinvio + back ── */
.auth-resend {
    margin: 14px 0 0;
    text-align: center;
}

.auth-resend-btn {
    background: none;
    border: none;
    color: var(--c-primary-700);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background .15s ease;
    font-family: inherit;
}

.auth-resend-btn:hover:not(:disabled) {
    background: var(--c-primary-50);
}

.auth-resend-btn:disabled {
    color: var(--c-ink-mute);
    cursor: not-allowed;
}

.auth-link-back {
    font-size: 13.5px;
    color: var(--c-ink-soft);
    text-decoration: none;
    font-weight: 600;
}

.auth-link-back:hover {
    color: var(--c-primary-700);
}

/* ── Mobile tweaks ── */
@media (max-width: 380px) {
    .auth-card {
        padding: 24px 18px 22px;
        border-radius: 18px;
    }
    .auth-title { font-size: 23px; }
    .auth-input-otp { font-size: 24px; letter-spacing: 0.4em; }
    .auth-trust { gap: 10px 14px; font-size: 11.5px; }
}

/* ════════════════════════════════════════════════════
   TAB SWITCHER (Login esistente vs Nuovo cliente)
   ════════════════════════════════════════════════════ */
.auth-tabs {
    display: flex;
    gap: 6px;
    margin: 14px 0 18px;
    background: rgba(0,0,0,0.04);
    padding: 4px;
    border-radius: 12px;
}
.auth-tab {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.auth-tab.is-active {
    background: #fff;
    color: #0a0a0a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Panes (mostra/nascondi). NB: NO `display:flex` — i form auth sono a blocco
   verticale (label sopra input). Con flex+row i campi si affiancano e su mobile
   il bottone "Accedi" viene tagliato fuori dal viewport. */
.auth-pane { display: none; }
.auth-pane.is-active { display: block; }

.auth-pane-sub {
    margin: 0 0 18px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    text-align: center;
}
.auth-pane-foot {
    margin: 16px 0 0;
    font-size: 12.5px;
    color: #6b7280;
    text-align: center;
}
.auth-link {
    color: #6b21a8;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.auth-link:hover { color: #4a2272; }

.auth-flash {
    padding: 11px 14px;
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.30);
    color: #047857;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════
   🌑 AZARATH THEME — Auth pages (login + registrazione)
   Diego (2026-05-13 PM3): "rendere più affine alla grafica del sito
   pagina di accesso e iscrizione". Stile dark/oro/serif coerente col
   bento Azarath: sfondo nero, card scura con bordo dorato, accenti
   gialli, Playfair sui titoli.
   ═══════════════════════════════════════════════════════════════════════ */

body.theme-azarath .auth-screen {
    background:
        radial-gradient(ellipse at 50% -20%, rgba(244, 197, 66, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 110%, rgba(106, 27, 154, 0.14) 0%, transparent 50%),
        #0a0a0a;
    min-height: calc(100vh - 60px - 80px);
    padding-top: 36px;
}

body.theme-azarath .auth-card {
    background: linear-gradient(180deg, #1a0d2e 0%, #14091f 100%);
    border: 1px solid rgba(244, 197, 66, 0.28);
    box-shadow:
        0 18px 50px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(244, 197, 66, 0.08) inset,
        0 0 80px rgba(106, 27, 154, 0.12);
    color: #f5e6d3;
}

body.theme-azarath .auth-icon {
    /* Diego (2026-05-15): "lascia il simbolo del cellulare senza contenitore".
       Niente gradiente oro / niente cerchio. Solo l'emoji. */
    background: none;
    border: 0;
    box-shadow: none;
    color: #0a0a0a;
}

body.theme-azarath .auth-title {
    font-family: 'Playfair Display', Georgia, serif;
    color: #f4c542;
    letter-spacing: 0.04em;
    text-shadow: 0 0 18px rgba(244, 197, 66, 0.25);
}

body.theme-azarath .auth-sub,
body.theme-azarath .auth-pane-sub,
body.theme-azarath .auth-hint {
    color: #c9b8a4;
}
body.theme-azarath .auth-sub strong,
body.theme-azarath .auth-pane-sub strong {
    color: #f4c542;
}
body.theme-azarath .auth-sub code {
    background: rgba(244, 197, 66, 0.18) !important;
    color: #f4c542 !important;
    border: 1px solid rgba(244, 197, 66, 0.3);
}

body.theme-azarath .auth-label {
    color: #f5e6d3;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 11.5px;
}

/* Input dark + bordo dorato su focus */
body.theme-azarath .auth-phone-wrap,
body.theme-azarath .auth-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(245, 230, 211, 0.18);
    color: #f5e6d3;
    border-radius: 10px;
}
body.theme-azarath .auth-input {
    padding: 12px 14px;
}
body.theme-azarath .auth-phone-wrap .auth-input {
    background: transparent;
    border: none;
    color: #f5e6d3;
}
body.theme-azarath .auth-phone-wrap:focus-within,
body.theme-azarath .auth-input:focus {
    border-color: #f4c542;
    box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.18);
    outline: none;
}
body.theme-azarath .auth-input::placeholder {
    color: rgba(245, 230, 211, 0.35);
}

/* Checkbox: contrasto su scuro */
body.theme-azarath .auth-checkbox,
body.theme-azarath .auth-checkbox span {
    color: #d8c8b5;
}
body.theme-azarath .auth-checkbox input[type="checkbox"] {
    accent-color: #f4c542;
}
body.theme-azarath .auth-checkbox a {
    color: #f4c542;
    text-decoration: underline;
    text-underline-offset: 2px;
}
body.theme-azarath .auth-checkbox strong {
    color: #f4c542;
}

/* CTA principale gialla — coerente coi bottoni Registrati della topbar */
body.theme-azarath .btn-primary.auth-submit,
body.theme-azarath .auth-submit {
    background: #f4c542;
    color: #0a0a0a !important;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 14px;
    padding: 14px 18px;
    border: none;
    box-shadow: 0 6px 20px rgba(244, 197, 66, 0.25);
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
body.theme-azarath .auth-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 26px rgba(244, 197, 66, 0.4);
    transform: translateY(-1px);
}

/* Link "registrati / accedi" sotto al form */
body.theme-azarath .auth-pane-foot {
    color: #a89580;
    border-top: 1px solid rgba(245, 230, 211, 0.10);
    padding-top: 14px;
    margin-top: 16px;
}
body.theme-azarath .auth-link {
    color: #f4c542;
    font-weight: 700;
}
body.theme-azarath .auth-link:hover {
    color: #ffd86a;
    text-decoration: underline;
}

/* Trust badges in fondo: piccoli, dorati */
body.theme-azarath .auth-trust {
    color: #a89580;
    border-top: 1px solid rgba(245, 230, 211, 0.08);
    padding-top: 14px;
}
body.theme-azarath .auth-trust span {
    background: rgba(244, 197, 66, 0.05);
    border: 1px solid rgba(244, 197, 66, 0.15);
    color: #d8c8b5;
}
body.theme-azarath .auth-meta {
    color: rgba(168, 149, 128, 0.7);
    font-size: 11px;
}

/* Alert di errore: rosso saturo su sfondo scuro */
body.theme-azarath .auth-alert {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}
body.theme-azarath .auth-alert-info {
    background: rgba(244, 197, 66, 0.10) !important;
    border-color: rgba(244, 197, 66, 0.3) !important;
    color: #f4c542 !important;
}

/* Tab switcher (modalità "both" legacy) */
body.theme-azarath .auth-tab {
    background: rgba(0, 0, 0, 0.3);
    color: #c9b8a4;
    border: 1px solid rgba(245, 230, 211, 0.15);
}
body.theme-azarath .auth-tab.is-active {
    background: #f4c542;
    color: #0a0a0a;
    border-color: #f4c542;
    font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════════════
   Azarath — registrazione/login in scala di grigi (Diego 2026-05-15)
   "card grigio chiaro, testo più scuro, senza arrotondamenti".
   Override delle regole sopra (dark+gold) → restyle grayscale.
   ═══════════════════════════════════════════════════════════════════════ */
/* Sfondo esterno della pagina: grigio medio (non più nero) */
body.theme-azarath { background: #4b5563 !important; }
body.theme-azarath .auth-screen {
    background: #4b5563;
    color: #0a0a0a;
    /* Niente min-height calc + niente padding-top extra: il form parte subito
       sotto la topbar, senza spazio vuoto sopra. */
    min-height: 0;
    padding: 0;
}
body.theme-azarath .auth-card {
    margin: 0;
    max-width: none;
}
body.theme-azarath .auth-card {
    background: #f3f4f6;
    color: #0a0a0a;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.theme-azarath .auth-icon {
    /* Diego (2026-05-15): icona libera, niente contenitore scuro. */
    background: none;
    color: #0a0a0a;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.theme-azarath .auth-title { color: #0a0a0a; }
body.theme-azarath .auth-sub { color: #0a0a0a !important; }
body.theme-azarath .auth-sub strong { color: #0a0a0a !important; }
body.theme-azarath .auth-label { color: #0a0a0a; }
body.theme-azarath .auth-pane-sub { color: #0a0a0a !important; }
body.theme-azarath .auth-checkbox { color: #0a0a0a !important; }
body.theme-azarath .auth-hint { color: #0a0a0a; }
body.theme-azarath .auth-meta { color: #374151; }
body.theme-azarath .auth-foot { color: #0a0a0a; }
body.theme-azarath .auth-input,
body.theme-azarath .auth-phone-wrap {
    background: #f3f4f6;
    color: #0a0a0a;
    border: 1px solid #c4c4c8;
    border-radius: 0;
}
body.theme-azarath .auth-input::placeholder { color: #9ca3af; }
body.theme-azarath .auth-input:focus,
body.theme-azarath .auth-phone-wrap:focus-within {
    border-color: #0a0a0a;
    outline: 2px solid #d4d4d8;
}
body.theme-azarath .auth-phone-flag { color: #4b5563; background: transparent; }
body.theme-azarath .auth-hint { color: #6b7280; }
body.theme-azarath .auth-hint strong { color: #0a0a0a; }
body.theme-azarath .auth-btn,
body.theme-azarath .auth-submit {
    background: #1f2937;
    color: #f3f4f6;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.theme-azarath .auth-btn:hover,
body.theme-azarath .auth-submit:hover {
    background: #111827;
    box-shadow: none;
    transform: none;
}
body.theme-azarath .auth-btn-secondary {
    background: #f3f4f6;
    color: #0a0a0a;
    border: 1px solid #c4c4c8;
    border-radius: 0;
}
body.theme-azarath .auth-checkbox,
body.theme-azarath .auth-checkbox a { color: #4b5563; }
body.theme-azarath .auth-checkbox a { text-decoration: underline; }
body.theme-azarath .auth-divider { color: #6b7280; }
body.theme-azarath .auth-divider::before,
body.theme-azarath .auth-divider::after { background: #c4c4c8; }
body.theme-azarath .auth-foot { color: #0a0a0a !important; }
body.theme-azarath .auth-foot a { color: #0a0a0a !important; text-decoration: underline; font-weight: 700; }
/* Anche il checkbox "Voglio ricevere offerte" (variante .optional) era con
   opacity 0.88 → si vedeva slavato. Forzo opacità piena + grigio scuro. */
body.theme-azarath .auth-checkbox-optional {
    color: #0a0a0a !important;
    opacity: 1 !important;
}
body.theme-azarath .auth-checkbox,
body.theme-azarath .auth-checkbox * { color: #0a0a0a !important; }
body.theme-azarath .auth-trust {
    border-top: 1px solid #c4c4c8;
}
body.theme-azarath .auth-trust span {
    background: #f3f4f6;
    border: 1px solid #c4c4c8;
    color: #4b5563;
    border-radius: 0;
}
body.theme-azarath .auth-meta { color: #6b7280; }
body.theme-azarath .auth-alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 0;
}
body.theme-azarath .auth-alert-info {
    background: #f3f4f6 !important;
    border-color: #c4c4c8 !important;
    color: #0a0a0a !important;
}
/* Forza nero su qualsiasi testo residuo gold/giallo dentro la card auth */
body.theme-azarath .auth-card .auth-alert-info,
body.theme-azarath .auth-card .auth-alert-info * {
    color: #0a0a0a !important;
}
body.theme-azarath .auth-input { color: #0a0a0a !important; }
body.theme-azarath .auth-input::placeholder { color: #9ca3af !important; }
body.theme-azarath .auth-phone-flag { color: #0a0a0a !important; }
body.theme-azarath .auth-tab {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #c4c4c8;
    border-radius: 0;
}
body.theme-azarath .auth-tab.is-active {
    background: #1f2937;
    color: #f3f4f6;
    border-color: #0a0a0a;
}

/* Forzature finali per eliminare ogni traccia gold/giallo nella card auth
   su Azarath. Diego (2026-05-15): "scritte gialle dark, scala di grigi". */
body.theme-azarath .auth-card a,
body.theme-azarath .auth-card strong,
body.theme-azarath .auth-checkbox a,
body.theme-azarath .auth-hint strong,
body.theme-azarath .auth-sub strong,
body.theme-azarath .auth-foot a {
    color: #0a0a0a !important;
}
body.theme-azarath .auth-card code {
    background: #f3f4f6 !important;
    color: #0a0a0a !important;
    border: 1px solid #c4c4c8;
    border-radius: 0 !important;
}
body.theme-azarath .auth-card a {
    text-decoration: underline;
    text-decoration-color: #6b7280;
}

/* ═══════════════════════════════════════════════════════════════════════
   Diego (2026-05-15): "su Accedi hai lasciato il form per la password
   nero, mettilo bianco". I campi input devono essere BIANCO PURO, non
   il light gray #f3f4f6 di prima (che su sistemi in dark-mode browser
   veniva renderizzato comunque dark a causa del color-scheme inerente).
   ═══════════════════════════════════════════════════════════════════════ */
body.theme-azarath { color-scheme: light; }
body.theme-azarath .auth-input,
body.theme-azarath .auth-phone-wrap {
    background: #ffffff !important;
    color: #0a0a0a !important;
    border: 1px solid #c4c4c8;
    border-radius: 0;
}
body.theme-azarath .auth-input:focus,
body.theme-azarath .auth-phone-wrap:focus-within {
    background: #ffffff !important;
    border-color: #0a0a0a;
    outline: 2px solid #d4d4d8;
}
/* Override Chrome/Safari autofill che colora il bg di blu/giallo —
   tipico sui campi password con credenziali salvate, faceva sembrare il
   campo "nero" su Azarath. Il trick è un box-shadow inset gigante:
   sovrascrive il bg dell'autofill mantenendo il testo leggibile. */
body.theme-azarath .auth-input:-webkit-autofill,
body.theme-azarath .auth-input:-webkit-autofill:hover,
body.theme-azarath .auth-input:-webkit-autofill:focus,
body.theme-azarath .auth-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #0a0a0a !important;
    caret-color: #0a0a0a;
    transition: background-color 9999s ease-in-out 0s;
}

/* ═══════════════════════════════════════════════════════════════════════
   Trust badges FUORI dalla card. Diego (2026-05-15): "togli dalla card
   e lasciali liberi". Sono sotto la card, direttamente sulla pagina.
   ═══════════════════════════════════════════════════════════════════════ */
.auth-trust-free {
    margin: 22px auto 0;
    max-width: 420px;
    padding: 0 18px;
    border-top: 0 !important;   /* sovrascrive eventuali border-top brand */
}
/* Su Azarath: trust libero, niente contenitore.
   Diego (2026-05-15): "senza carta e non in cella a parte" → badge SENZA
   pillole bianche, senza bordi: solo emoji + testo direttamente sulla
   pagina. Colore chiaro per leggerli sul page bg grigio scuro. */
body.theme-azarath .auth-trust-free {
    border-top: 0 !important;
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 500;
    gap: 6px 18px;
}
body.theme-azarath .auth-trust-free span {
    background: transparent !important;
    border: 0 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
