/* =====================================================================
   schedebianche.it — Foglio di stile principale
   Identita': istituzionale, minimale, credibile. Il segno grafico e' il
   "tratto sulla scheda": un accento cremisi usato con parsimonia su una
   base di carta e inchiostro.
   ===================================================================== */

:root {
  --ink:        #14213d;   /* inchiostro / navy istituzionale */
  --ink-soft:   #33415c;
  --paper:      #fbfbf8;   /* carta */
  --paper-2:    #f2f1ea;
  --line:       #e3e2d8;
  --accent:     #b3122f;   /* cremisi: il "segno" sulla scheda */
  --accent-dk:  #8f0e26;
  --muted:      #5a6273;
  --ok:         #1c7c54;
  --focus:      #1f6feb;
  --radius:     10px;
  --shadow-sm:  0 1px 2px rgba(20,33,61,.06), 0 2px 8px rgba(20,33,61,.05);
  --shadow-md:  0 6px 24px rgba(20,33,61,.08);
}

/* ---- Base ---------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display-title {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.15;
}
p { color: var(--ink-soft); }
a { color: var(--accent-dk); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

.sb-eyebrow {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
}
.sb-brand-accent { color: var(--accent); }

/* Accessibilita': focus sempre visibile */
a:focus-visible, button:focus-visible, .btn:focus-visible,
.form-control:focus-visible, .form-select:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: none;
}
.skip-link {
  position: absolute; top: .5rem; left: .5rem; z-index: 1080;
  background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: 6px;
}

/* ---- Navbar -------------------------------------------------------- */
.sb-navbar {
  background: rgba(251,251,248,.92);
  backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
  padding-top: .7rem; padding-bottom: .7rem;
}
.sb-navbar .navbar-brand { color: var(--ink); font-size: 1.12rem; }
.sb-navbar .nav-link { color: var(--ink-soft); font-weight: 500; border-radius: 6px; padding: .4rem .7rem; }
.sb-navbar .nav-link:hover { color: var(--ink); background: var(--paper-2); }
.sb-navbar .nav-link.active { color: var(--accent); }
.sb-mark {
  width: 16px; height: 16px; display: inline-block;
  border: 2px solid var(--ink); border-radius: 3px; position: relative;
}
.sb-mark::after {
  content: ""; position: absolute; inset: 2px;
  background: linear-gradient(135deg, transparent 45%, var(--accent) 45%, var(--accent) 58%, transparent 58%);
}

/* ---- Bottoni ------------------------------------------------------- */
.btn-sb-primary {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.btn-sb-primary:hover, .btn-sb-primary:focus { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }
.btn-sb-ink {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600;
}
.btn-sb-ink:hover, .btn-sb-ink:focus { background: #0e1730; color:#fff; }
.btn-sb-outline {
  border: 1.5px solid var(--ink); color: var(--ink); font-weight: 600; background: transparent;
}
.btn-sb-outline:hover { background: var(--ink); color: #fff; }

/* ---- Hero ---------------------------------------------------------- */
.sb-hero {
  background:
    radial-gradient(1100px 500px at 82% -10%, rgba(179,18,47,.06), transparent 60%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}
.sb-hero h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
.sb-hero .lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 46ch; }

/* Scheda simbolica del hero */
.sb-ballot {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 1.25rem 1.25rem 1.4rem;
}
.sb-ballot .sb-ballot-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .2rem; border-bottom: 1px dashed var(--line);
}
.sb-ballot .sb-ballot-row:last-child { border-bottom: 0; }
.sb-ballot .box {
  width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 4px; flex: none;
}
.sb-ballot .box.marked { position: relative; }
.sb-ballot .box.marked::after {
  content:""; position:absolute; inset:-4px;
  background:
    linear-gradient(45deg, transparent 44%, var(--accent) 44%, var(--accent) 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, var(--accent) 44%, var(--accent) 56%, transparent 56%);
}

/* ---- Sezioni ------------------------------------------------------- */
.sb-section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.sb-section--alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sb-lead-measure { max-width: 68ch; }

/* Card concetto (astensione/bianca/nulla) */
.sb-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; /*height: 100%;*/ box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.sb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.sb-card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.sb-card .sb-tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px; margin-bottom: .8rem;
}
.sb-tag--gray { background: #ecebe3; color: var(--muted); }
.sb-tag--white { background: #eef1f7; color: var(--ink); }
.sb-tag--null { background: #fbe4e8; color: var(--accent-dk); }

/* Mito / verita' */
.sb-myth {
  border-left: 4px solid var(--accent); background: #fff;
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
}
.sb-myth .badge-false {
  background: var(--accent); color: #fff; font-weight: 600; letter-spacing: .04em;
}

/* ---- KPI dashboard ------------------------------------------------- */
.sb-kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); height: 100%;
}
.sb-kpi .kpi-value {
  font-family: 'Fraunces', serif; font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600; color: var(--ink); line-height: 1;
}
.sb-kpi .kpi-label { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sb-kpi .kpi-accent { color: var(--accent); }

/* ---- Grafici ------------------------------------------------------- */
.sb-chart-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.5rem; box-shadow: var(--shadow-sm); height: 100%;
}
.sb-chart-card h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.sb-chart-card .sb-chart-sub { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.sb-chart-wrap { position: relative; min-height: 260px; }

/* ---- Form ---------------------------------------------------------- */
.sb-form-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: clamp(1.4rem, 4vw, 2.4rem);
}
.form-label { font-weight: 600; color: var(--ink); font-size: .93rem; }
.form-text { color: var(--muted); }
.form-control, .form-select {
  border-color: #d7d6cc; border-radius: 8px; padding: .6rem .8rem;
}
.form-control:focus, .form-select:focus { border-color: var(--ink); }
.sb-required { color: var(--accent); }
/* Marcatore "(facoltativo)" accanto alle etichette dei campi opzionali */
.sb-optional {
  font-weight: 400; font-size: .82rem; color: var(--muted); letter-spacing: 0;
}
.sb-fieldset-title {
  font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600;
  margin: 1.5rem 0 .3rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
}
/* Honeypot: nascosto a occhi umani ma non con display:none per i bot */
.sb-hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* Alert */
.sb-alert { border-radius: var(--radius); border: 1px solid var(--line); }
.sb-alert-ok { background: #e9f6ef; border-color: #bfe3d0; color: #14603f; }
.sb-alert-err { background: #fdeaed; border-color: #f4c2cc; color: var(--accent-dk); }

/* ---- FAQ ----------------------------------------------------------- */
.accordion-button:not(.collapsed) { background: var(--paper-2); color: var(--ink); box-shadow: none; }
.accordion-button:focus { box-shadow: none; }
.accordion-item { border-color: var(--line); }

/* ---- Tabelle statistiche ------------------------------------------ */
.sb-table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.sb-table td { color: var(--ink); }
.sb-bar {
  height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-dk));
}
.sb-bar-track { background: var(--paper-2); border-radius: 999px; overflow: hidden; }

/* ---- Footer -------------------------------------------------------- */
.sb-footer { background: var(--ink); color: #cfd6e6; padding: 3rem 0 2rem; margin-top: 3rem; }
.sb-footer .fw-semibold { color: #fff; }
.sb-footer-text { color: #b6bfd4; font-size: .93rem; }
.sb-footer-title { color: #fff; font-weight: 600; margin-bottom: .7rem; font-size: .95rem; }
.sb-footer-links a { color: #b6bfd4; text-decoration: none; display: block; padding: .18rem 0; }
.sb-footer-links a:hover { color: #fff; }
.sb-footer-rule { border-color: rgba(255,255,255,.12); margin: 2rem 0 1.2rem; }
.sb-footer-note { color: #8f9ab5; font-size: .82rem; }

/* ---- Utility ------------------------------------------------------- */
.text-accent { color: var(--accent) !important; }
.bg-paper-2 { background: var(--paper-2); }
.sb-divider { height: 1px; background: var(--line); border: 0; margin: 2rem 0; }

/* ---- Motion ridotto ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
