/* Caratteri e colori del kit Unisenior (Inter Tight, Source Serif 4, licenza OFL in ../font/OFL.txt),
   serviti dall'app: nessuna risorsa esterna. Mobile-first, stile editoriale: filetti sottili,
   niente ombre, niente schede che sembrano pulsanti. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/font/inter-tight-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/font/inter-tight-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/font/inter-tight-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/font/inter-tight-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/font/source-serif-4-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/static/font/source-serif-4-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/font/source-serif-4-latin-600-normal.woff2") format("woff2");
}

:root {
  --bg: #FAF7F1; /* avorio del kit */
  --bg-tinta: #F2EEE5;
  --surface: #FFFFFF;
  --fg: #14213D;
  --heading: #0F2240;
  --muted: #5E6573;
  --filetto: #E4E2DA; /* tra una riga e l'altra */
  --filetto-forte: #C9CDD5; /* in testa a una sezione */
  --azione: #1F3559;
  --azione-forte: #0F2240;
  --salvia: #4F8A7B;
  --logo-navy: #30486E;
  --logo-word: #5D7FBF;
  --ff-sans: "Inter Tight", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --ff-serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2.5rem;
  --misura: 40rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ff-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.salta {
  position: absolute;
  left: var(--sp-2);
  top: -4rem;
  padding: var(--sp-1) var(--sp-2);
  background: var(--azione);
  color: #FFFFFF;
}
.salta:focus { top: var(--sp-1); }

.visivamente-nascosto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.testata {
  border-bottom: 1px solid var(--filetto-forte);
  background: var(--bg);
  padding-top: env(safe-area-inset-top);
}
.testata-riga {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--sp-2);
}
.marchio {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--heading);
  text-decoration: none;
}
.marchio-nome {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--muted);
  padding-left: var(--sp-2);
  border-left: 1px solid var(--filetto-forte);
}
.logo { display: block; flex: none; width: 6.5rem; height: auto; }
.logo .l-navy { fill: var(--logo-navy); }
.logo .l-blue { fill: var(--logo-word); }
.logo .l-word { fill: var(--logo-word); }

.pagina {
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-2) var(--sp-4);
}
.pagina-stretta { max-width: var(--misura); }

h1, h2, h3 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--sp-2);
}
h1 { font-size: 1.75rem; font-weight: 500; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 var(--sp-2); max-width: var(--misura); }

a { color: var(--azione); text-underline-offset: 0.2em; }
a:hover { color: var(--azione-forte); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--azione);
  outline-offset: 2px;
}
.link-esteso { display: inline-block; padding: var(--sp-1) 0; }

@media (min-width: 40rem) {
  .testata-riga { padding: var(--sp-2) var(--sp-3); }
  .pagina { padding: var(--sp-4) var(--sp-3) 4rem; }
  h1 { font-size: 2.25rem; }
  .logo { width: 7.5rem; }
}

/* ---------- accesso ---------- */
.introduzione { color: var(--fg); }
.nota { color: var(--muted); font-size: 0.9375rem; }

.modulo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  margin: var(--sp-3) 0;
  max-width: 24rem;
}
.etichetta {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.campo {
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--filetto-forte);
  border-bottom: 2px solid var(--azione);
  border-radius: 0;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 1.1875rem;
}
.campo-cf, .campo-codice {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.campo[aria-invalid="true"] { border-bottom-color: #9B2C2C; }
.errore {
  margin: 0;
  color: #9B2C2C;
  font-size: 0.9375rem;
}

.azione {
  display: inline-block;
  min-height: 3rem;
  margin-top: var(--sp-1);
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--azione);
  border-radius: 0;
  background: var(--azione);
  color: #FFFFFF;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.azione:hover { background: var(--azione-forte); border-color: var(--azione-forte); color: #FFFFFF; }
.azione-secondaria { background: transparent; color: var(--azione); }
.azione-secondaria:hover { background: var(--bg-tinta); color: var(--azione-forte); }

.sfida, .emergenza {
  border-top: 1px solid var(--filetto-forte);
  padding-top: var(--sp-3);
  margin-top: var(--sp-3);
}
.passo {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 1.25rem;
}
.messaggio {
  font-family: var(--ff-serif);
  font-size: 1.125rem;
  padding: var(--sp-1) 0 var(--sp-1) var(--sp-2);
  border-left: 2px solid var(--salvia);
}
.codice { font-variant-numeric: tabular-nums; }
.numero { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stato-attesa { color: var(--muted); font-style: italic; font-family: var(--ff-serif); }

.qr-blocco { margin: 0 0 var(--sp-2); }
.qr { display: block; width: 12rem; height: auto; margin-bottom: var(--sp-1); }
.qr-blocco figcaption { color: var(--muted); font-size: 0.9375rem; max-width: 24rem; }

/* Al telefono il pulsante, al computer il QR con lo stesso link. */
.solo-computer { display: none; }
@media (min-width: 48rem) and (pointer: fine) {
  .solo-computer { display: block; }
  .solo-telefono { display: none; }
}

/* ---------- informativa ---------- */
.bozza {
  margin: 0 0 var(--sp-2);
  padding-left: var(--sp-1);
  border-left: 2px solid var(--salvia);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.informativa .sezione {
  border-top: 1px solid var(--filetto-forte);
  padding-top: var(--sp-2);
  margin-top: var(--sp-3);
}
.informativa ul { margin: 0 0 var(--sp-2); padding-left: 1.25rem; max-width: var(--misura); }
.informativa li { margin-bottom: var(--sp-1); }

/* ---------- corsi ---------- */
.elenco-corsi, .elenco-video { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.elenco-corsi li {
  border-top: 1px solid var(--filetto-forte);
  padding: var(--sp-2) 0;
}
.elenco-corsi h2 { margin-bottom: var(--sp-1); }
.elenco-corsi p { margin-bottom: 0; }
.elenco-video li {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  border-top: 1px solid var(--filetto);
  padding: var(--sp-2) 0;
}
.video-titolo { color: var(--heading); font-weight: 500; }
.video-esito { color: var(--muted); font-size: 0.9375rem; }

/* ---------- player ---------- */
.pagina-player { max-width: 52rem; }
.elenco-video a.video-titolo { text-decoration: none; padding: var(--sp-1) 0; }
.elenco-video a.video-titolo:hover { text-decoration: underline; }

.player { margin: 0 0 var(--sp-3); border-top: 1px solid var(--filetto-forte); padding-top: var(--sp-2); }
.player video {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #0B1424;
  aspect-ratio: 16 / 9;
}
.player-controlli {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  padding: var(--sp-1) 0;
}
.player-pulsante {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--azione);
  border-radius: 0;
  background: transparent;
  color: var(--azione);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.player-pulsante:hover { background: var(--bg-tinta); color: var(--azione-forte); }
.player-play { background: var(--azione); color: #FFFFFF; min-width: 7rem; }
.player-play:hover { background: var(--azione-forte); color: #FFFFFF; }
.player-barra {
  flex: 1 1 12rem;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  min-width: 0;
}
.player-intervallo, .player-volume { accent-color: var(--azione); min-height: 2.75rem; }
.player-intervallo { flex: 1 1 auto; min-width: 0; }
.player-tempo { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }
.player-secondari {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
}
.player-volume { width: 7rem; }
.player-avviso { min-height: 1.55em; margin: var(--sp-1) 0 0; color: var(--fg); font-family: var(--ff-serif); }
.nota-player { margin-top: var(--sp-2); }

@media (min-width: 40rem) {
  .player-secondari { flex: 0 0 auto; }
}

/* Schermo intero finto: il video riempie la finestra, i controlli sono quelli di sempre. */
.senza-scorrimento, .senza-scorrimento body { overflow: hidden; }
.player-schermo-intero {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: env(safe-area-inset-top) var(--sp-2) env(safe-area-inset-bottom);
  border: 0;
  background: #0B1424;
  color: #FFFFFF;
}
.player-schermo-intero video { flex: 1 1 auto; min-height: 0; max-height: none; aspect-ratio: auto; object-fit: contain; }
.player-schermo-intero .player-pulsante { border-color: #FFFFFF; color: #FFFFFF; }
.player-schermo-intero .player-pulsante:hover { background: #1F3559; }
.player-schermo-intero .player-play { background: #FFFFFF; color: #0F2240; }
.player-schermo-intero .player-tempo, .player-schermo-intero .player-avviso { color: #FFFFFF; }
.player-schermo-intero a { color: #FFFFFF; }

/* ---------- registro del referente ---------- */
.tabella-scorrevole { overflow-x: auto; margin: 0 0 var(--sp-2); }
.tabella { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: 0.9375rem; }
.tabella th, .tabella td {
  text-align: left;
  vertical-align: top;
  padding: var(--sp-1) var(--sp-2) var(--sp-1) 0;
  border-top: 1px solid var(--filetto);
}
.tabella thead th {
  border-top: 1px solid var(--filetto-forte);
  border-bottom: 1px solid var(--filetto-forte);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.tabella tbody th { font-weight: 500; }
.nota-fotografia { overflow-wrap: anywhere; margin-top: var(--sp-3); }

/* Estrazioni del registro: pulsanti di solo testo, sottolineati come i collegamenti */
.estrazione { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-2); }
.azione-testo {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: var(--sp-1) 0;
  text-decoration: underline;
  cursor: pointer;
}
