/* Foglio comune delle pagine secondarie (File, Log dei file, Excel originale, Amministrazione, Cambia password,
   pagine di errore) e delle pagine di accesso. Colori, raggi, pulsanti e caratteri sono quelli della pagina
   principale (dashboard_template.html), così tutto il sito si presenta come un'unica applicazione.
   Indice: variabili, base, pulsanti, barra in alto, menu col nome, schede e filtri, riquadri e campi, ricerca, stato vuoto, tabelle,
   badge e messaggi, finestre (<dialog>), avvisi brevi, pagina di errore, scheda centrale delle pagine di accesso,
   telefono. */

/* ---------------------------------------------------------------- variabili */
:root {
  color-scheme: light;
  --bg: #eef1f5; --surface: #ffffff; --surface-2: #f5f7fa; --surface-3: #e9edf3; --border: #dde2ea; --divider: #a9b4c4;
  --text: #0f172a; --text-2: #3f4a5c; --muted: #626b7a;
  --accent: #2a78d6; --accent-soft: #e3eefb; --accent-ink: #1c5cab;
  --accent-fill: #2470cc; --accent-fill-hover: #1c5cab; --bad-fill: #b92828;   /* riempimenti pieni: testo bianco almeno 4,5:1 */
  --good: #0b7a0b; --good-bg: #e4f5e4; --warn: #8a5a00; --warn-bg: #fff1cc; --bad: #b92828; --bad-bg: #fde1e1;
  --neutral: #5b6677; --neutral-bg: #e6eaf0; --orange: #a83b08; --orange-bg: #ffe3d2;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px rgba(15,23,42,.07);
  --shadow-lg: 0 2px 6px rgba(15,23,42,.08), 0 24px 64px rgba(15,23,42,.28);
  --scrim: rgba(15, 23, 42, .45);
  --brand: linear-gradient(135deg, #2a78d6, #6250d6);
  --r: 14px; --r-btn: 11px; --r-sm: 9px; --r-win: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --dur-1: 120ms; --dur-2: 180ms; --dur-3: 240ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1115; --surface: #181b21; --surface-2: #1f232b; --surface-3: #272c36; --border: #2f3542; --divider: #5d6878;
    --text: #eef0f4; --text-2: #b8bfcc; --muted: #8a93a3;
    --accent: #4b93ec; --accent-soft: #1c2a40; --accent-ink: #9cc4f5;
    --accent-fill: #2f6fd0; --accent-fill-hover: #2a63bb; --bad-fill: #c43c3c;
    --good: #4cc44c; --good-bg: #173a17; --warn: #f2b72a; --warn-bg: #3a2d0a; --bad: #f06a6a; --bad-bg: #411c1c;
    --neutral: #a9b2c2; --neutral-bg: #2a303b; --orange: #ff9b6a; --orange-bg: #3f2416;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.4);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 24px 64px rgba(0,0,0,.6);
    --scrim: rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115; --surface: #181b21; --surface-2: #1f232b; --surface-3: #272c36; --border: #2f3542; --divider: #5d6878;
  --text: #eef0f4; --text-2: #b8bfcc; --muted: #8a93a3;
  --accent: #4b93ec; --accent-soft: #1c2a40; --accent-ink: #9cc4f5;
  --accent-fill: #2f6fd0; --accent-fill-hover: #2a63bb; --bad-fill: #c43c3c;
  --good: #4cc44c; --good-bg: #173a17; --warn: #f2b72a; --warn-bg: #3a2d0a; --bad: #f06a6a; --bad-bg: #411c1c;
  --neutral: #a9b2c2; --neutral-bg: #2a303b; --orange: #ff9b6a; --orange-bg: #3f2416;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 24px 64px rgba(0,0,0,.6);
  --scrim: rgba(0, 0, 0, .6);
}

/* movimento: tre durate e due curve; ogni entrata ha la sua uscita */
@keyframes sfp-fade { from { opacity: 0; } }
@keyframes sfp-win-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes sfp-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes sfp-menu-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes sfp-sale { from { opacity: 0; transform: translateY(12px); } }
@keyframes sfp-toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
html.no-tr *, html.no-tr *::before, html.no-tr *::after { transition: none !important; }

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.fuori { position: fixed; left: -9999px; top: 0; opacity: 0; }
html:has(dialog[open]) { overflow: hidden; }

/* ---------------------------------------------------------------- pulsanti
   misura fissa, indipendente dal corpo della pagina: normale 42 px (15/600, padding 10 14), piccolo 34 (13/600),
   solo icona 42x42; al tocco almeno 44 (blocco del telefono). Pieni con --accent-fill e --bad-fill, testo bianco. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--r-btn); font-size: 15px; font-weight: 600; line-height: 20px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1), transform var(--dur-1); }
.btn:hover { background: var(--surface-2); box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.btn.primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: transparent; }
.btn.danger-solid { background: var(--bad-fill); border-color: var(--bad-fill); color: #fff; }
.btn.danger-solid:hover { filter: brightness(.92); background: var(--bad-fill); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.icon { padding: 11px; }
.btn.small { padding: 7px 10px; font-size: 13px; line-height: 18px; border-radius: var(--r-sm); }
.btn.small.icon { padding: 8px; }
.btn.full { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.pulsanti { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* piede dei moduli, come nelle finestre: [Annulla] [Primario] in basso a destra */
.pulsanti.piede { justify-content: flex-end; margin-top: 4px; }

/* ---------------------------------------------------------------- barra in alto (stesse misure della verifica) */
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; color: var(--text); text-decoration: none; }
.brand .logo, .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; text-decoration: none; }
.brand .titolo { overflow: hidden; text-overflow: ellipsis; }
.top .actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top .actions .btn { padding: 10px 12px; }
.top .actions .btn.icon { padding: 11px; }
.indietro-tel { display: none; }   /* freccia in alto a sinistra: solo sul telefono */
.vsep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }

/* ---------------------------------------------------------------- menu col nome (sfp_usermenu_html) */
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); padding: 5px 12px 5px 5px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 210px; padding: 6px; z-index: 46; display: grid; animation: sfp-menu-in var(--dur-2) var(--ease-out); transform-origin: top right; }
.usermenu.closing .menu { animation: sfp-menu-out var(--dur-1) var(--ease-in) forwards; }
.usermenu .menu a, .usermenu .menu button { padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.usermenu .menu form { display: contents; }

/* ---------------------------------------------------------------- schede (come Studenti/Scuole) e filtri */
.views { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 4px; }
.views a, .views button { border: 0; background: transparent; color: var(--text-2); padding: 6px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background-color var(--dur-1), color var(--dur-1), box-shadow var(--dur-1); }
.views a:hover, .views button:hover { color: var(--text); }
.views [aria-current="page"], .views .active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.views .n, .chip .n { background: var(--surface-3); color: var(--text); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.views .n { background: var(--surface); }   /* pillola visibile anche sul binario grigio */
.views [aria-current="page"] .n { background: var(--accent-soft); color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); padding: 5px 11px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1); }
@media (hover: hover) { .chip:hover { box-shadow: var(--shadow); } }
.chip.active, .chip[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.chip.active .n, .chip[aria-current="page"] .n { background: var(--accent-fill); color: #fff; }

/* ---------------------------------------------------------------- pagina, riquadri e campi */
.wrap { max-width: 1120px; margin: 0 auto; padding: 18px 16px 48px; }
.wrap.stretta { max-width: 560px; }
.testa-pagina { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 2px 0 16px; }
.testa-pagina h1 { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; }
.sez { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.sez + .sez { margin-top: 16px; }
.sez > h2 { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 700; }
.sez > h2:not(:first-of-type) { margin-top: 24px; }
.campo { display: grid; gap: 6px; margin: 0 0 14px; min-width: 0; }
.campo > label, .campo > .etichetta { font-weight: 600; font-size: 14px; color: var(--text-2); }
.campo small { color: var(--muted); font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input:not([type]), select, textarea {
  width: 100%; font-size: 15px; line-height: 20px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-btn); background: var(--surface); color: var(--text); outline: none; transition: border-color var(--dur-1), box-shadow var(--dur-1); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: var(--muted); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
textarea { min-height: 104px; resize: vertical; line-height: 1.45; }
.pw { position: relative; }
.pw input { padding-right: 104px; }
.pw .eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.pw .eye:hover { background: var(--surface-2); color: var(--accent-ink); }
/* scelta a pulsanti (radio), con lo stesso aspetto delle schede */
.scelta { display: inline-flex; flex-wrap: wrap; justify-self: start; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 4px; border: 0; margin: 0; min-width: 0; }
.scelta label { position: relative; display: inline-flex; cursor: pointer; }
.scelta input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scelta span { display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--text-2); transition: background-color var(--dur-1), color var(--dur-1), box-shadow var(--dur-1); }
.scelta input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.scelta input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.scelta input:disabled + span { opacity: .45; cursor: not-allowed; }

/* interruttore (casella di spunta): tutta la riga è il bersaglio; la casella vera resta per tastiera e lettori di schermo */
.interruttore-riga { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; padding: 6px 0; cursor: pointer; }
.interruttore-riga input { position: absolute; right: 0; opacity: 0; width: 1px; height: 1px; margin: 0; }
.interruttore { flex: none; position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.interruttore::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--dur-2) var(--ease-out); }
.interruttore-riga input:checked + .interruttore { background: var(--accent); box-shadow: none; }
.interruttore-riga input:checked + .interruttore::after { transform: translateX(18px); }
.interruttore-riga input:focus-visible + .interruttore { outline: 2px solid var(--accent); outline-offset: 2px; }
.interruttore-riga input:disabled + .interruttore { opacity: .45; }
.interruttore-riga:has(input:disabled) { cursor: not-allowed; }

/* ricerca: alta 42 (44 al tocco), sfondo grigio, icona a sinistra (Registro dell'Amministrazione, Log dei file) */
.cerca { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 1 340px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-btn); padding: 0 12px; min-height: 42px; transition: border-color var(--dur-1), box-shadow var(--dur-1); }
.cerca:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cerca svg { color: var(--muted); }
.cerca input { flex: 1; min-width: 0; border: 0; padding: 10px 0; background: transparent; box-shadow: none; }
.cerca input:focus { box-shadow: none; }

/* stato vuoto: un riquadro solo in tutte le pagine */
.vuoto { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 28px 20px; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------------------------------------------------------------- tabelle */
.tbl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.tbl table { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: 14px; }
.tbl th { background: var(--surface-2); font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; font-weight: 700; }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- badge e messaggi */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 18px; white-space: nowrap; }
.b-ok { background: var(--good-bg); color: var(--good); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-neutral { background: var(--neutral-bg); color: var(--neutral); }
.b-accent { background: var(--accent-soft); color: var(--accent-ink); }
.b-outline { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.msg { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 15px; margin: 0 0 16px; overflow-wrap: anywhere; }
.msg.ok { background: var(--good-bg); color: var(--good); }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.info { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------------------------------------------------------------- finestre: <dialog> con entrata e uscita */
dialog.win { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; border-radius: var(--r-win); background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in), overlay var(--dur-2) var(--ease-in) allow-discrete, display var(--dur-2) var(--ease-in) allow-discrete; }
dialog.win[open] { opacity: 1; transform: none; transition-duration: var(--dur-3); transition-timing-function: var(--ease-out); }
@starting-style { dialog.win[open] { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog.win::backdrop { background: transparent; transition: background-color var(--dur-2) var(--ease-in), overlay var(--dur-2) allow-discrete, display var(--dur-2) allow-discrete; }
dialog.win[open]::backdrop { background: var(--scrim); }
@starting-style { dialog.win[open]::backdrop { background: transparent; } }
/* senza transizioni discrete (browser meno recenti): entrata con un'animazione, uscita immediata */
@supports not (transition-behavior: allow-discrete) {
  dialog.win { opacity: 1; transform: none; transition: none; }
  dialog.win[open] { animation: sfp-win-in var(--dur-3) var(--ease-out); }
  dialog.win::backdrop { background: var(--scrim); }
  dialog.win[open]::backdrop { animation: sfp-fade var(--dur-2) var(--ease-out); }
}
dialog.win form { margin: 0; }
.win-head { padding: 16px 20px 12px; }
.win-head h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.win-body { padding: 4px 20px 8px; color: var(--text-2); }
.win-body p { margin: 0; }
.win-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }

/* ---------------------------------------------------------------- avvisi brevi (toast) */
.toasts { position: fixed; right: 16px; bottom: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--good); border-radius: 12px; padding: 8px 8px 8px 12px; box-shadow: 0 2px 6px rgba(15,23,42,.08), 0 12px 32px rgba(15,23,42,.18); font-weight: 600; font-size: 14px;
  transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in); }
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
@supports not (transition-behavior: allow-discrete) { .toast { animation: sfp-toast-in var(--dur-2) var(--ease-out); } }
.toast.err { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--accent); }
.toast > svg.i { color: var(--good); } .toast.err > svg.i { color: var(--bad); } .toast.info > svg.i { color: var(--accent); }
.toast .tm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .tx { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.toast .tx:hover { background: var(--surface-2); }
.toast .tx svg.i { width: 16px; height: 16px; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------------------------------------------------------------- pagina di errore (sfp_error_page) */
body.pagina-errore { display: grid; place-items: center; padding: 20px; }
.errore { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 30px 26px; box-shadow: var(--shadow); animation: sfp-sale var(--dur-3) var(--ease-out); }
.errore .logo { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; margin-bottom: 18px; }
.errore h1 { margin: 0 0 22px; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- scheda centrale delle pagine di accesso */
body.scheda { display: flex; align-items: center; justify-content: center; padding: 20px; background: #0b1220; }
body.scheda::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(1200px 600px at 10% 10%, #1e3a8a 0%, transparent 60%), radial-gradient(900px 500px at 90% 20%, #6d28d9 0%, transparent 55%), radial-gradient(900px 700px at 50% 100%, #0e7490 0%, transparent 55%), #0b1220; }
.scheda .card { position: relative; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 30px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.45); animation: sfp-sale var(--dur-3) var(--ease-out); }
.scheda .card > .logo { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; margin-bottom: 18px; box-shadow: 0 10px 24px rgba(42,120,214,.35); }
.scheda h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.scheda .sub { margin: 0 0 18px; color: var(--text-2); }
.scheda label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--text-2); }
.scheda .msg { margin: 14px 0 0; }
.scheda .btn.full { margin-top: 22px; }
.scheda .btn.full + .btn.full { margin-top: 10px; }

/* ---------------------------------------------------------------- telefono */
@media (pointer: coarse), (max-width: 640px) {
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input:not([type]), select, textarea { font-size: 16px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input:not([type]), select { min-height: 44px; }
  .cerca input { min-height: 0; }   /* il bersaglio è la ricerca intera, alta 44 */
  .btn, .btn.small, .views a, .views button, .chip, .usermenu summary, .scelta span, .pw .eye, .cerca { min-height: 44px; }
  .btn.icon, .top .actions .btn, .toast .tx { min-width: 44px; }
  .toast .tx { min-height: 44px; }
  .usermenu .menu a, .usermenu .menu button { min-height: 44px; display: flex; align-items: center; }
  .brand a.logo { width: 44px; height: 44px; border-radius: 12px; font-size: 14px; }
}
@media (max-width: 640px) {
  .top-row { gap: 6px; padding: 8px 12px; }
  .brand { gap: 8px; font-size: 15px; flex: 1 1 auto; }
  .top .actions { gap: 6px; flex: none; }
  .top .actions .btn { padding: 8px; }
  .top .lbl, .vsep, .da-computer { display: none; }
  .indietro-tel { display: inline-flex; }
  .brand a.logo, .top .actions a[data-back] { display: none; }
  .usermenu summary { font-size: 0; gap: 0; padding: 4px; }
  .usermenu .avatar { width: 34px; height: 34px; font-size: 14px; }
  .wrap { padding: 14px 12px 40px; }
  .sez { padding: 16px; border-radius: 12px; }
  .testa-pagina h1 { font-size: 20px; }
  .views { display: flex; width: 100%; }
  .views a, .views button { flex: 1 1 0; padding: 6px 8px; }
  .scelta { display: flex; justify-self: stretch; }
  .scelta label { flex: 1 1 0; }
  .scelta span { flex: 1; }
  .toasts { left: 12px; right: 12px; align-items: stretch; }
  .toast { width: auto; max-width: none; }
  .scheda .card, .errore { padding: 26px 22px 22px; border-radius: 18px; }
  dialog.win { width: calc(100vw - 20px); border-radius: 14px; }
  .win-head { padding: 14px 16px 10px; }
  .win-body { padding: 2px 16px 8px; }
  .win-foot { padding: 10px 16px 14px; }
  .win-foot .btn { flex: 1 1 auto; }
  .cerca { margin-left: 0; flex: 1 1 100%; }
}
@media (max-width: 359px) { .brand .titolo { display: none; } }
