/* Le pagine fuori dall'app: accesso, registrazione, recupero password.
 *
 * Stava dentro un <style> ripetuto quasi identico in quattro file: cambiare il
 * verde del marchio voleva dire ricordarsi di tutte e quattro, e la quarta era
 * sempre quella dimenticata. Qui c'è l'unione delle regole; le differenze vere
 * fra le pagine sono le poche marcate sotto.
 *
 * L'altro motivo è la CSP: finché il CSS stava in un <style> inline, la
 * direttiva style-src-elem doveva ammettere 'unsafe-inline' per tutti. Adesso
 * no — vedi backend/src/server.js.
 *
 * verify-email.html ha un suo foglio a parte: usa gli stessi nomi (.ok, .err)
 * con un significato diverso — lì sono colori dentro un .box, qui sono avvisi
 * nascosti finché non servono. Unirli spegnerebbe i suoi riquadri.
 */

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

:root {
  --brand: #14ae5c;
  --brand-dark: #0f8f49;
  --bg: #f5f6fa;
  --card: #fff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #ef4444;
}

body {
  font-family: Inter, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
/* La registrazione ha un campo in più: le serve un filo di respiro. */
.card.wide { max-width: 420px; }

.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.logo-box {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #14ae5c, #0f8f49);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.logo-name { font-size: 20px; font-weight: 700; color: var(--text); }

h1 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
p.sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s; margin-bottom: 16px;
}
input:focus { border-color: var(--brand); }

.pwd-wrap { position: relative; margin-bottom: 16px; }
.pwd-wrap input { margin-bottom: 0; padding-right: 44px; }
.pwd-wrap button {
  position: absolute; right: 0; top: 0; bottom: 0; width: 42px;
  background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.pwd-wrap button:hover { color: var(--text); }

button.btn {
  width: 100%; padding: 12px;
  background: var(--brand); color: #fff;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background .15s; margin-top: 4px;
}
button.btn:hover { background: var(--brand-dark); }
button.btn:disabled { opacity: .6; cursor: default; }

/* Avvisi: nascosti finché il JS non li riempie. */
.err {
  background: #fef2f2; color: var(--red); border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 16px; display: none;
}
.ok {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 16px; display: none;
}

.hint { font-size: 11px; color: var(--muted); margin-top: -12px; margin-bottom: 16px; }

/* Checkbox di accettazione termini: `label` di base è a blocco, qui serve
   inline col testo accanto. */
.checkbox-line {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; font-weight: 400; color: var(--muted);
  margin-bottom: 16px;
}
.checkbox-line input[type="checkbox"] {
  width: auto; margin: 2px 0 0; flex-shrink: 0;
}
.checkbox-line a { color: var(--brand); text-decoration: none; }
.checkbox-line a:hover { text-decoration: underline; }

/* Il link di reimpostazione scaduto o già usato. */
.invalid { text-align: center; padding: 20px 0; }
.invalid p { color: var(--muted); margin-bottom: 16px; }

.footer-link { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.footer-link a { color: var(--brand); text-decoration: none; font-weight: 500; }
