/* ═══════════════════════════════════════════════════════════════
   auth.css  ·  Le pagine di accesso: login, recupero, nuova password

   Le tre pagine avevano tre copie della stessa CSS, con gli stessi colori
   scritti a mano in ognuna. Aggiungendo il secondo tema quelle copie
   sarebbero diventate sei — e il primo ritocco di colore fatto in due file su
   tre sarebbe passato inosservato per mesi. Qui c'è una versione sola; ogni
   pagina tiene nel proprio <style> solo le sue differenze (dimensione del
   logo, spaziature), che sono poche righe.

   TEMA: stessa meccanica di landing e dashboard — attributo `data-theme`
   sull'elemento radice, scelta in `localStorage['iodah-theme']`, applicata da
   uno script nello <head> per non far lampeggiare la pagina. Il comando è
   `js/theme.js`.
   ═══════════════════════════════════════════════════════════════ */

/* ── Token ────────────────────────────────────────────────────
   REGOLA: niente colori cablati nelle regole più sotto. Un `#0e141b` per il
   fondo di un campo è invisibile qui e diventa una macchia nera sul tema
   chiaro — è il motivo per cui anche i fondi dei campi, le ombre e i colori
   dei messaggi sono token. */
/* I token stanno in tokens.css (UI 2026, tappa 1): qui nessun colore. */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-text);
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-glow) 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Scheda ─────────────────────────────────────────────────── */
.card, .login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line-3);
  border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-card);
}

.brand { text-align: center; margin-bottom: 24px; }
.brand img { height: 48px; margin-bottom: 10px; }
.brand .name { display: flex; justify-content: center; }
.wordmark-img { display: inline-flex; align-items: center; margin: 2px 0 4px; } .brand .wordmark-img img { height: var(--wm-h, 22px); width: auto; display: block; margin: 0; }
/* Le due scritte (bianca per il tema scuro, verde per il chiaro): UNA sola visibile. La regola sopra
   «.brand .wordmark-img img { display:block }» è più specifica di «.wordmark-img .wm-l { display:none }»
   e vinceva: nella pagina di accesso in tema scuro comparivano tutte e due (rilievo del titolare
   2026-09-10). Qui la stessa specificità, così il tema decide. */
.brand .wordmark-img .wm-l { display: none; } [data-theme="light"] .brand .wordmark-img .wm-l { display: block; } [data-theme="light"] .brand .wordmark-img .wm-d { display: none; }
.brand .sub {
  font-family: var(--font-display);
  font-size: 9.5px;
  color: var(--brand-2);
  text-transform: uppercase;
  letter-spacing: .22em;
  margin-top: 6px;
}

h1 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
p.lead { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-bottom: 18px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ── Campi ──────────────────────────────────────────────────── */
label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 500;
  margin: 14px 0 6px;
}

input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--line-3);
  border-radius: var(--r-1);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: box-shadow .15s, border-color .15s;
}
input:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--focus); }

button {
  width: 100%;
  margin-top: 22px;
  height: 42px;
  background: var(--brand);
  color: var(--on-brand);
  border: none;
  border-radius: var(--r-1);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, transform .1s, opacity .15s;
}
button:hover { background: var(--brand-2); }
button:focus-visible { outline: none; box-shadow: var(--focus); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }

/* ── Messaggi ───────────────────────────────────────────────── */
.msg, .error {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: var(--r-1);
  font-size: 13.5px;
  line-height: 1.55;
  display: none;
}
.msg.ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-text); }
.msg.err, .error { background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text); }

.back { text-align: center; margin-top: 20px; font-size: 13px; }
.back a { color: var(--accent-light); text-decoration: none; }

.footer { text-align: center; margin-top: 22px; font-size: 11px; color: var(--muted); }

/* ── Interruttore chiaro/scuro ────────────────────────────────
   Qui non c'è una navbar dove metterlo, quindi sta fisso in alto a destra:
   la scheda è centrata e non lo copre mai, a nessuna altezza di finestra.
   È un <button> perché si deve poter raggiungere da tastiera. */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 46px;
  height: 25px;
  padding: 0;
  background: var(--veil);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background .25s, border-color .25s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.theme-toggle::after {
  content: '';
  width: 19px;
  height: 19px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform .25s;
}
[data-theme="light"] .theme-toggle::after { transform: translateX(21px); }
.theme-toggle .ico {
  position: absolute;
  top: 4px;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}
.theme-toggle .ico-moon { left: 5px; }
.theme-toggle .ico-sun { right: 5px; }
