/* auth.css — veste comune di accesso, registrazione e "scegli la password".
   Usato da /login, /scegli-password e dal modale di app.html (via auth-ui.js).
   Colori dalle variabili del tema (style.css :root, sovrascritte dai temi). */

/* ── Pagina ─────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--brand-pale, #E6F8EE) 0%, transparent 70%),
    var(--surface-2, #F7F8FA);
}
.auth-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
             padding: 2rem 16px 6rem; }
.auth-brand { display: block; text-align: center; margin-bottom: 1.25rem; text-decoration: none; }
.auth-brand .logo-text { font-size: 1.7rem; }
.auth-card { background: var(--surface, #fff); border-radius: 24px; width: 100%; max-width: 400px;
             box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.08);
             padding: 2rem 1.5rem 1.6rem; box-sizing: border-box; }
.auth-foot { text-align: center; margin-top: 1.25rem; font-size: .85rem; }
.auth-foot a { color: var(--text-2, #6B7280); text-decoration: none; }
.auth-foot a:hover { color: var(--brand, #007A38); }
@media (min-width: 480px) { .auth-card { padding: 2.25rem 2.25rem 1.9rem; } }

/* Messaggio di contesto (da dove arrivi: preferiti, segui, upload…) */
.au-context { display: flex; gap: .7rem; align-items: flex-start; background: var(--brand-pale, #E6F8EE);
              border-radius: 14px; padding: .75rem .9rem; margin-bottom: 1.25rem;
              font-size: .86rem; line-height: 1.45; color: var(--text-1, #111827); }
.au-context-ico { font-size: 1.3rem; line-height: 1.1; }

/* ── Componente ─────────────────────────────────────────────────────────── */
.au-pane { display: none; }
.au-pane.active { display: block; animation: au-in .22s ease-out; }
@keyframes au-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.au-head { text-align: center; margin-bottom: 1.4rem; }
.au-icon { font-size: 2.6rem; line-height: 1; margin-bottom: .6rem; }
.au-head .au-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 .35rem;
            color: var(--text-1, #111827); }
.au-sub { font-size: .92rem; color: var(--text-2, #6B7280); margin: 0; line-height: 1.5; }
.au-sub b { color: var(--text-1, #111827); word-break: break-all; }

.au-social { display: flex; flex-direction: column; gap: .6rem; }
.au-oauth-btn { display: flex; align-items: center; justify-content: center; gap: .65rem; width: 100%;
                min-height: 48px; padding: .6rem 1rem; border: 1.5px solid var(--border, #E5E7EB);
                border-radius: 12px; background: #fff; color: var(--text-1, #111827); cursor: pointer;
                font: 600 .94rem var(--font, inherit); transition: border-color .15s, background .15s; }
.au-oauth-btn:hover { border-color: #9CA3AF; background: #FAFAFA; }
.au-oauth-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.au-divider { display: flex; align-items: center; gap: .75rem; margin: 1.15rem 0;
              font-size: .8rem; color: #9CA3AF; }
.au-divider::before, .au-divider::after { content: ''; flex: 1; height: 1px; background: var(--border, #E5E7EB); }

.au-fg { margin-bottom: .95rem; }
.au-fg label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-1, #111827); margin-bottom: .35rem; }
.au-fg label small { font-weight: 400; color: var(--text-2, #6B7280); }
.au-input { position: relative; }
.au-input input { width: 100%; min-height: 50px; padding: .7rem .95rem; box-sizing: border-box;
                  border: 1.5px solid var(--border, #E5E7EB); border-radius: 12px; background: #fff;
                  font: 16px var(--font, inherit); color: var(--text-1, #111827); outline: none;
                  transition: border-color .15s, box-shadow .15s; }
.au-input input:focus { border-color: var(--brand-mid, #009246);
                        box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-mid, #009246) 15%, transparent); }
.au-input input[readonly] { background: var(--surface-2, #F7F8FA); color: var(--text-2, #6B7280); }
.au-input.has-eye input { padding-right: 3rem; }
.au-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px;
          border: none; background: none; border-radius: 10px; cursor: pointer; color: var(--text-2, #6B7280);
          display: flex; align-items: center; justify-content: center; }
.au-eye:hover { color: var(--text-1, #111827); background: var(--surface-2, #F7F8FA); }
.au-eye svg { width: 20px; height: 20px; }

.au-bars { display: flex; gap: 4px; margin-top: .45rem; height: 4px; }
.au-bar { flex: 1; border-radius: 99px; background: var(--border, #E5E7EB); transition: background .3s; }
.au-bar.weak { background: #EF4444; } .au-bar.medium { background: #F59E0B; } .au-bar.strong { background: var(--brand-mid, #16A34A); }

.au-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
          min-height: 50px; padding: .7rem 1rem; border: none; border-radius: 12px; cursor: pointer;
          background: var(--brand-mid, #009246); color: #fff; font: 700 1rem var(--font, inherit);
          box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-mid, #009246) 28%, transparent);
          transition: background .15s, transform .1s; margin-top: .25rem; text-decoration: none; box-sizing: border-box; }
.au-btn:hover { background: var(--brand, #007A38); }
.au-btn:active { transform: scale(.99); }
.au-btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.au-btn.ghost { background: transparent; color: var(--brand, #007A38); box-shadow: none;
                border: 1.5px solid var(--border, #E5E7EB); }
.au-btn.ghost:hover { background: var(--brand-pale, #E6F8EE); }

.au-note { font-size: .8rem; color: var(--text-2, #6B7280); text-align: center; margin: .8rem 0 0; line-height: 1.45; }
.au-link { text-align: center; margin: 1rem 0 0; font-size: .88rem; color: var(--text-2, #6B7280); }
.au-link a, .au-a { color: var(--brand, #007A38); font-weight: 700; cursor: pointer; text-decoration: none; }
.au-link a:hover, .au-a:hover { text-decoration: underline; }
.au-switch { text-align: center; margin: 1.4rem -1.5rem -1.6rem; padding: 1rem 1rem 1.1rem;
             border-top: 1px solid var(--border, #E5E7EB); font-size: .9rem; color: var(--text-2, #6B7280); }
@media (min-width: 480px) { .au-switch { margin: 1.5rem -2.25rem -1.9rem; } }
.auth-modal .au-switch { margin-left: 0; margin-right: 0; margin-bottom: 0; padding-bottom: 0; }

.au-msg { border-radius: 12px; padding: .7rem .9rem; font-size: .86rem; line-height: 1.45;
          margin-bottom: 1rem; display: none; }
.au-msg.err  { background: #FEF2F2; color: #991B1B; }
.au-msg.ok   { background: var(--brand-pale, #F0FDF4); color: var(--brand, #166534); }
.au-msg.info { background: #EFF6FF; color: #1E40AF; }
.au-msg .au-a { display: inline-block; margin-top: .35rem; color: inherit; text-decoration: underline; }

.au-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45);
           border-top-color: #fff; border-radius: 50%; animation: au-spin .7s linear infinite; }
.au-btn.ghost .au-spin { border-color: rgba(0,0,0,.15); border-top-color: currentColor; }
@keyframes au-spin { to { transform: rotate(360deg); } }
