/* Kapidea: base comune a tutte le pagine (colori e caratteri da brand/STILE.md).
   Ogni area ha il suo foglio (landing.css, cassa.css, grazie.css, admin.css...) che parte da qui. */

/* ---------- caratteri, ospitati dal sito ----------
   public/fonts/: solo il sottoinsieme latino (lo stesso di Google Fonts) e solo i pesi usati, licenza SIL OFL 1.1 accanto.
   Sono font variabili: un file per famiglia copre tutto l'intervallo di pesi.
   Fraunces 600–800 (titoli) · Literata 400–600 e corsivo 400 (testo) · Shantell Sans 400–700 (note a mano).
   I due file usati in alto (Fraunces e Literata) sono anche in <link rel="preload"> in views/base.njk. */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url('/static/fonts/fraunces-v38-latino.woff2') format('woff2');
  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: 'Literata'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('/static/fonts/literata-v40-latino.woff2') format('woff2');
  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: 'Literata'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/static/fonts/literata-v40-corsivo-latino.woff2') format('woff2');
  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: 'Shantell Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/static/fonts/shantell-sans-v13-latino.woff2') format('woff2');
  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 {
  --carta: #FBF7EF;
  --inchiostro: #283044;
  --giallo: #FFE27A;
  --postit: #FFE995;
  --rosso: #C8394F;
  --verde-ok: #2F7A5F;
  --bianco: #FFFFFF;
  --grigio: #5C606E; /* almeno 4,5:1 su carta, crema e bianco (il vecchio #6B7080 scendeva a 4,3:1 sulla crema) */
  --linea: rgba(40, 48, 68, .14);
  /* colore della verticale: lo cambia data-verticale sul body.
     --scuro è il colore pieno (bordi, fondi, icone); --scuro-testo è la sua versione per le scritte piccole,
     scurita quanto basta per stare sopra 4,5:1 anche sul pastello. */
  --pastello: #C9DDF2;
  --medio: #92B9E6;
  --scuro: #2F64A6;
  --scuro-testo: #2C5E9C;
  --fuoco: var(--inchiostro); /* l'anello del fuoco da tastiera; sui fondi scuri diventa giallo */
  --raggio: 14px;
  --ombra: 0 1px 1px rgba(0,0,0,.04), 0 10px 24px rgba(70,55,30,.10);
  --titoli: 'Fraunces', Georgia, serif;
  --testo: 'Literata', Georgia, serif;
  --mano: 'Shantell Sans', 'Comic Sans MS', sans-serif;
}
[data-verticale="sanita"]   { --pastello: #BFE6D5; --medio: #86CFAF; --scuro: #2F7A5F; --scuro-testo: #296A53; }
[data-verticale="lavoro"]   { --pastello: #FFD3B8; --medio: #FFB088; --scuro: #B4532A; --scuro-testo: #974623; }
[data-verticale="ufficio"]  { --pastello: #DCD3F2; --medio: #B7A6EA; --scuro: #6A4FB0; --scuro-testo: #644AA5; }
[data-verticale="mestieri"] { --pastello: #C9DDF2; --medio: #92B9E6; --scuro: #2F64A6; --scuro-testo: #2C5E9C; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--testo);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--scuro-testo); }
h1, h2, h3 { font-family: var(--titoli); line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 800; }
h2 { font-size: clamp(24px, 4.6vw, 34px); font-weight: 700; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 1em; }

/* il fuoco da tastiera si vede sempre: inchiostro sui fondi chiari, giallo su quelli scuri (--fuoco) */
:focus-visible { outline: 3px solid var(--fuoco); outline-offset: 3px; }

.contenitore { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.contenitore.stretto { max-width: 680px; }

/* evidenziatore giallo del marchio */
.evidenzia { background: linear-gradient(transparent 38%, var(--giallo) 38%, var(--giallo) 88%, transparent 88%); padding: 0 .12em; }
.mano { font-family: var(--mano); }

/* bottoni */
.bottone {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 14px 26px;
  border: 0; border-radius: 999px;
  background: var(--inchiostro); color: var(--bianco);
  font-family: var(--titoli); font-weight: 700; font-size: 19px; text-decoration: none; text-align: center;
  cursor: pointer; box-shadow: 0 6px 0 rgba(40,48,68,.25);
  transition: transform .08s ease, box-shadow .08s ease;
}
.bottone:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(40,48,68,.25); }
.bottone.giallo { background: var(--giallo); color: var(--inchiostro); box-shadow: 0 6px 0 #D9B94B; }
.bottone.contorno { background: var(--bianco); color: var(--inchiostro); box-shadow: inset 0 0 0 2px var(--inchiostro), 0 4px 0 rgba(40,48,68,.18); }
.bottone.largo { width: 100%; }
.bottone[disabled] { opacity: .6; cursor: wait; }

.scheda { background: var(--bianco); border-radius: var(--raggio); box-shadow: var(--ombra); padding: 20px; }
.postit { background: var(--postit); padding: 18px 18px 14px; transform: rotate(-1deg); box-shadow: 0 10px 14px -8px rgba(90,70,0,.3); font-family: var(--mano); }
.barrato { text-decoration: line-through; opacity: .7; }
.piccolo { font-size: 14px; }
.nascosto { display: none !important; }

/* il logo in alto: l'altezza la decide il CSS (l'attributo height da solo non basta, perché img ha height:auto) */
.logo-testata { display: inline-flex; align-items: center; min-height: 44px; margin: 14px 0; line-height: 0; }
.logo-testata img { height: 34px; width: auto; }
.avviso-simulato { background: var(--rosso); color: #fff; text-align: center; font: 600 14px/1.4 system-ui, sans-serif; padding: 8px 12px; }
.avviso-simulato code { background: rgba(255,255,255,.2); padding: 0 4px; border-radius: 4px; }

/* ---------- pagina d'errore e 404 (views/errore.njk) ---------- */
.pagina-errore { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.errore-testata { border-bottom: 1px solid var(--linea); }
.errore-pagina { flex: 1 0 auto; display: grid; align-content: center; padding-top: 32px; padding-bottom: 72px; }
.errore-pagina__scheda { display: grid; justify-items: center; gap: 6px; max-width: 560px; margin: 0 auto; text-align: center; }
.errore-pagina__ben { width: min(62vw, 260px); margin-bottom: 4px; }
.errore-pagina__ben img { width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.errore-pagina__codice {
  margin: 0; font: 800 clamp(72px, 24vw, 128px)/1 var(--titoli); letter-spacing: -.03em; color: var(--inchiostro);
}
.errore-pagina__codice span { background: linear-gradient(transparent 52%, var(--giallo) 52%, var(--giallo) 90%, transparent 90%); padding: 0 .06em; }
.errore-pagina h1 { margin: 6px 0 4px; font-size: clamp(28px, 7vw, 40px); text-wrap: balance; }
.errore-pagina__testo { max-width: 30em; margin: 0 0 10px; }
.errore-pagina__azioni { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; width: 100%; }
.errore-pagina__azioni .bottone { min-height: 52px; font-size: 18px; padding: 12px 22px; }
.errore-pagina__aiuto { margin: 18px 0 0; font-size: 16px; color: var(--grigio); }
.errore-pagina__aiuto a { display: inline-block; padding: 10px 2px; font-weight: 600; }
.dettaglio-errore { white-space: pre-wrap; font-size: 12px; background: #fff; padding: 12px; border-radius: 8px; overflow: auto; margin-top: 28px; max-width: 100%; }
@media (max-width: 479px) {
  .errore-pagina__azioni li { flex: 1 1 100%; }
  .errore-pagina__azioni .bottone { width: 100%; }
}
@media (min-width: 760px) {
  .errore-pagina__scheda--ben { grid-template-columns: 280px minmax(0, 460px); justify-content: center; column-gap: 44px; max-width: 920px; justify-items: start; align-items: center; text-align: left; }
  .errore-pagina__scheda--ben .errore-pagina__ben { grid-row: span 6; width: 100%; }
  .errore-pagina__scheda--ben .errore-pagina__azioni { justify-content: flex-start; }
}

@media (max-width: 600px) { body { font-size: 17px; } }
