/* =====================================================================
   Tema "manifesto riso" del Gestionale San Michele (dal 14/10/2026)
   Un solo foglio, caricato in fondo all'<head> di ogni pagina: cambia
   solo l'aspetto, mai il funzionamento. Le pagine tengono il loro CSS;
   qui si ridefiniscono le variabili comuni (--blue, --bg, …) e i
   componenti condivisi (testata, riquadri, bottoni, campi, tabelle).
   I selettori iniziano con "body" per vincere sul CSS delle pagine.
   Palette: carta, blu campo, rosa fluo, giallo pallina, inchiostro.
   ===================================================================== */

@font-face { font-family: "Unbounded"; src: url("/static/fonts/unbounded-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; src: url("/static/fonts/unbounded-latin-ext.woff2") format("woff2"); font-weight: 400 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; src: url("/static/fonts/spacegrotesk-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; src: url("/static/fonts/spacegrotesk-latin-ext.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --carta: #F2F4F7;
  --blu-campo: #1F4FD8;
  --rosa: #FF4FA3;
  --giallo: #E4F23A;
  --inchiostro: #1B1E3D;
  --display: "Unbounded", "Arial Black", sans-serif;
  --corpo: "Space Grotesk", "Segoe UI", Arial, sans-serif;

  /* le variabili che usano già tutte le pagine */
  --blue: #1F4FD8;
  --blue-dark: #1B1E3D;
  --green: #0B8F5A;
  --red: #E0264A;
  --orange: #C2620A;
  --bg: #F2F4F7;
  --card: #FFFFFF;
  --border: #C9CEDF;
  --text: #1B1E3D;
  --muted: #555B7C;
}

/* ---------------- base ---------------- */
html body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--corpo);
  -webkit-font-smoothing: antialiased;
}
/* via la filigrana del logo: al suo posto la fascia di puntini di stampa */
html body::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none; opacity: 1;
  left: -20%; right: -20%; top: 58%; height: 42vh; inset-inline: -20%;
  background: radial-gradient(circle, rgba(255, 79, 163, .38) 1.5px, transparent 1.9px) 0 0 / 10px 10px;
  background-position: 0 0; background-size: 10px 10px; background-repeat: repeat;
  transform: rotate(-9deg);
}
/* grana della carta */
html body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9000; opacity: .2; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .12  0 0 0 0 .24  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
body ::selection { background: var(--giallo); color: var(--inchiostro); }

/* ---------------- testata ---------------- */
body header {
  position: relative;
  background: var(--inchiostro);
  color: #fff;
  padding: 18px clamp(14px, 3vw, 28px) 22px;
  border-bottom: 6px solid var(--rosa);
  box-shadow: 0 6px 0 var(--giallo);
  margin-bottom: 10px;
}
body header h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: .07em .06em 0 var(--rosa), -.05em .09em 0 var(--blu-campo);
  margin: 0;
}
body header h1 .h1-club {
  display: block;
  font-size: .42em;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--giallo);
  text-shadow: none;
  margin-bottom: .35em;
}
body header nav.header-nav { gap: 6px; }
body header a,
body header button.link {
  font-family: var(--corpo);
  font-weight: 600;
  font-size: .88rem;
  color: #fff;
  padding: 7px 13px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: transparent;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
body header a:hover,
body header button.link:hover {
  background: var(--giallo);
  border-color: var(--giallo);
  color: var(--inchiostro);
  transform: rotate(-2deg);
}
body header a:focus-visible,
body header button.link:focus-visible { outline: 3px solid var(--rosa); outline-offset: 2px; }

/* ---------------- riquadri ---------------- */
body .card {
  background: #fff;
  border: 3px solid var(--inchiostro);
  border-radius: 6px;
  box-shadow: 7px 7px 0 var(--blu-campo);
  margin-bottom: 26px;
}
body main > .card:nth-of-type(3n+2),
body #app main > .card:nth-of-type(3n+2) { box-shadow: 7px 7px 0 var(--rosa); }
body main > .card:nth-of-type(3n),
body #app main > .card:nth-of-type(3n) { box-shadow: 7px 7px 0 var(--giallo); }
body .card h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--inchiostro);
  /* evidenziatore giallo che segue ogni riga del titolo */
  text-decoration-line: underline;
  text-decoration-color: var(--giallo);
  text-decoration-thickness: .42em;
  text-underline-offset: -.22em;
  text-decoration-skip-ink: none;
}
body .card h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }

/* ---------------- bottoni ---------------- */
body button {
  font-family: var(--corpo);
}
body button.principale,
body button.salva,
body button.btn-finalizza,
body button.conferma,
body #btn-login,
body .btn-primario {
  background: var(--blu-campo);
  color: #fff;
  border: 3px solid var(--inchiostro);
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--inchiostro);
  transition: transform 100ms ease, box-shadow 100ms ease;
}
body button.principale:not(:disabled):hover,
body button.salva:not(:disabled):hover,
body button.btn-finalizza:not(:disabled):hover,
body button.conferma:not(:disabled):hover,
body #btn-login:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--inchiostro); }
body button.principale:not(:disabled):active,
body button.salva:not(:disabled):active,
body button.btn-finalizza:not(:disabled):active,
body button.conferma:not(:disabled):active,
body #btn-login:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--inchiostro); }
/* il verde "conferma" resta verde: è il colore del si va */
body button.conferma,
body button.principale:not(.chiusura) { background: var(--green); }
body button.principale.chiusura { background: var(--blu-campo); }

body button.secondario,
body button.btn-secondario,
body button.annulla {
  background: #fff;
  color: var(--inchiostro);
  border: 2px solid var(--inchiostro);
  border-radius: 6px;
  font-weight: 600;
}
body button.secondario:hover,
body button.btn-secondario:hover,
body button.annulla:hover { background: var(--giallo); }

body button.elimina {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 6px;
  font-weight: 700;
}
body button.elimina:hover { background: var(--red); color: #fff; }
body button:disabled { box-shadow: none !important; transform: none !important; }
body button:focus-visible,
body a:focus-visible { outline: 3px solid var(--rosa); outline-offset: 2px; }

/* ---------------- campi ---------------- */
body input[type=text], body input[type=number], body input[type=password], body input[type=date],
body input[type=time], body input[type=tel], body input[type=email], body input:not([type]),
body select, body textarea {
  font-family: var(--corpo);
  border: 2px solid var(--inchiostro);
  border-radius: 5px;
  background: #fff;
  color: var(--inchiostro);
}
body input:focus, body select:focus, body textarea:focus {
  outline: none;
  border-color: var(--blu-campo);
  box-shadow: 0 0 0 3px var(--rosa);
}
body input[type=checkbox], body input[type=radio] { accent-color: var(--blu-campo); }
body input[type=password] { padding: 8px 10px; font-size: 1rem; }
body label { color: var(--muted); font-weight: 600; }

/* ---------------- tabelle ---------------- */
body table { font-family: var(--corpo); }
body th {
  font-family: var(--display);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--inchiostro);
  border-bottom: 3px solid var(--inchiostro);
}
body tbody tr:hover > td { background: rgba(228, 242, 58, .28); }

/* ---------------- etichette e avvisi ---------------- */
body .pill, body .badge-override { border-radius: 6px; font-weight: 700; line-height: 1.25; }
body .toast {
  font-family: var(--display);
  font-weight: 700;
  border: 3px solid var(--inchiostro);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--inchiostro);
  transform: rotate(-1.5deg);
}
body .toast.ok { background: var(--green); }
body .toast.errore { background: var(--red); }
body .vuoto-msg { font-style: normal; }
body details > summary { cursor: pointer; font-weight: 700; color: var(--blu-campo); }

/* ---------------- accesso con password ---------------- */
body #login-box {
  max-width: 420px;
  width: calc(100% - 32px);
  margin: 9vh auto 40px;
  padding: 30px 28px 26px;
  background: #fff;
  border: 3px solid var(--inchiostro);
  border-radius: 6px;
  box-shadow: 9px 9px 0 var(--rosa);
  transform: rotate(-1deg);
}
body #login-box h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: var(--blu-campo);
  text-shadow: .06em .05em 0 var(--rosa);
  margin: 0 0 12px;
}
body #login-box h1 .h1-club { display: block; font-size: .45em; color: var(--muted); text-shadow: none; margin-bottom: .4em; }
body #login-box input { border: 3px solid var(--inchiostro); border-radius: 6px; font-family: var(--display); letter-spacing: .1em; }

/* ---------------- movimento ---------------- */
@media (prefers-reduced-motion: reduce) {
  body header a, body button { transition: none !important; }
  body header a:hover, body .toast, body #login-box { transform: none; }
}
@media print {
  html body::before, html body::after { display: none; }
  body header { box-shadow: none; }
  body .card { box-shadow: none; }
}
