/*
 * Correzioni e aggiunte di H.E.L.P. al tema del designer (theme.css), caricato DOPO.
 * Per tornare all'export originale basta non caricare questo file (restano i font: vedi sotto).
 *
 * Contrasti WCAG MISURATI nel browser (non dedotti dal token). Le coppie dell'export che non
 * arrivano a 4,5:1 (testo) sono state corrette qui, mantenendo tinta e croma:
 *
 *   destructive (chiaro)   L 0.671 -> 0.591   bianco sul riempimento: 3,29:1 -> 4,55:1
 *                          (pulsante, badge, toast distruttivi).
 *   text-destructive       L 0.587 -> 0.548   rosso di allarme su allerta-100 (card emergenza):
 *   (chiaro)                                  3,85:1 -> 4,55:1; su bianco 5,40:1.
 *   destructive-foreground (scuro) bianco -> notte: 3,29:1 -> 6,01:1 sul riempimento allerta.
 *   help-testo-terziario   chiaro L 0.619 -> 0.52 (3,6:1 su bianco, 3,2:1 sulla sidebar -> >= 4,5:1);
 *                          scuro  L 0.592 -> 0.638 (4,25:1 su card -> 5,1:1).
 *
 *   ⚠️ NON corretti, per fedelta' al design (decisione del designer/utente):
 *   - bordo dei campi (--input) e --border: ~1,4:1 sul bianco, sotto il 3:1 di WCAG 1.4.11
 *     (per arrivarci servirebbe L ~0.665, molto piu' scuro del design);
 *   - chart-3 (segnale) e chart-5 (grigio-300) su bianco: 2,3:1 e 2,2:1, sotto il 3:1 dei grafici.
 *     Ogni serie ha un secondo canale (tratteggio, legenda, tooltip, tabella);
 *   - help-posizione-punto (laguna): 1,8:1 su bianco, e' un puntino.
 *
 * ⚠️ `:root` e `.dark` hanno la stessa specificita' e questo file e' dopo theme.css: un token
 * corretto in `:root` qui batterebbe il `.dark` dell'export, quindi va ridefinito anche nel
 * `.dark` di questo file (con il valore dell'export se non va corretto).
 */

/*
 * Atkinson Hyperlegible Next (testo) e Mono (codici, orari, numeri), ospitati in locale
 * (wwwroot/fonts): niente CDN, perche' l'ospedale puo' non avere accesso a internet e un
 * font esterno bloccato farebbe cadere tutta l'UI sul font di sistema senza dire nulla.
 * Variabili 200-800, solo i sottoinsiemi latin e latin-ext (copre l'italiano e l'inglese).
 * Licenza SIL OFL 1.1: wwwroot/fonts/OFL-Atkinson.txt.
 */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/AtkinsonHyperlegibleNext-Variable-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/AtkinsonHyperlegibleNext-Variable-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("../fonts/AtkinsonHyperlegibleMono-Variable-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("../fonts/AtkinsonHyperlegibleMono-Variable-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --destructive: oklch(0.591 0.2168 29.1942);
  --text-destructive: oklch(0.548 0.1981 29.6435);
  --help-testo-terziario: oklch(0.52 0.0200 174.9004);

  /*
   * Token di stato. L'export non ha success/warning/info, ma i badge e i toast li usano e
   * un sistema di emergenza vive di semantica di stato. Ogni coppia colore/foreground e'
   * >= 4,5:1 (6,67 / 9,59 / 6,21).
   * ⚠️ --warning chiaro (1,89:1 sul bianco) e' un colore di RIEMPIMENTO con il suo
   * foreground scuro: non usarlo come colore del testo o di un'icona su sfondo chiaro.
   * Come con tutto il sistema, il colore non e' mai l'unico canale: ogni stato ha
   * anche icona e testo.
   * Da chiedere al designer: i valori di success, warning e info.
   */
  --success: oklch(0.45 0.13 150);
  --success-foreground: oklch(0.985 0 0);
  --warning: oklch(0.80 0.16 85);
  --warning-foreground: oklch(0.20 0 0);
  --info: oklch(0.48 0.15 250);
  --info-foreground: oklch(0.985 0 0);
}

.dark {
  /* Valori dell'export, tranne il foreground del pulsante distruttivo e il testo terziario. */
  --destructive: oklch(0.6710 0.2168 29.1942);
  --destructive-foreground: oklch(0.1425 0.0258 180.1895);
  --text-destructive: oklch(0.7091 0.1835 28.3704);
  --help-testo-terziario: oklch(0.638 0.0250 175.3726);

  --success: oklch(0.72 0.17 150);
  --success-foreground: oklch(0.15 0 0);
  --warning: oklch(0.82 0.16 85);
  --warning-foreground: oklch(0.15 0 0);
  --info: oklch(0.72 0.13 250);
  --info-foreground: oklch(0.15 0 0);
}
