/* Drittabox · stile (proposta B «Un passo alla volta»). Palette: Viola Elettrico, Menta, Rosa Pacco, Cartone. */

/* Font ospitati sul sito (assets/fonts/), nessuna richiesta a Google o ad altri siti: Bricolage Grotesque (titoli)
   e Inter (testo), entrambi sotto SIL Open Font License 1.1 (licenze in assets/fonts/OFL-*.txt). Sono gli stessi
   file WOFF2 che serviva Google Fonts (sottoinsiemi latin e latin-ext; sono font variabili: Bricolage con gli assi
   opsz 12–96 e wght 200–800, Inter con wght 100–900) e le stesse regole, con gli stessi pesi dichiarati
   (Bricolage 600, 700, 800; Inter 400, 500, 600) e lo stesso unicode-range: il browser scarica latin-ext solo se
   nella pagina c'è un carattere di quel gruppo. font-display: swap: finché il font non arriva si vede quello di
   sistema. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin.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: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin.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: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin.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: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-latin.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: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-latin.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: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-latin.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;
}

/* Palette «Un passo alla volta»: Viola Elettrico, Menta, Rosa Pacco, Cartone, su bianco. Nel tema scuro: notte viola. */
:root {
  --viola: #6A2BEA;
  --viola-scuro: #4B16B8;
  --lilla: #F3EEFF;
  --menta: #3BE3B4;
  --rosa: #FF4F96;
  --cartone: #F5BF7A;

  --bg: #FFFFFF;
  --bg-tint: #F6F2FF;
  --surface: #FFFFFF;
  --surface-2: #F3EEFF;
  --ink: #22124F;
  --text: #3B3260;
  --muted: #5F587D;
  --line: #E4DCF7;
  --line-strong: #C9BCEF;
  --primary: var(--viola);
  --primary-ink: #FFFFFF;
  --primary-soft: #EDE5FF;
  --primary-soft-ink: #4B16B8;
  --accent: #5A1FD8;
  --save: #C2105C;
  --save-bg: #FFE8F1;
  --ok: #08795B;
  --ok-bg: #DDFBF1;
  --warn-bg: #FFF0F5;
  --warn-ink: #A30D4E;
  --tip-bg: #E2FBF2;
  --tip-ink: #0A6B50;
  --focus: #6A2BEA;
  --tile-on: #F3EEFF;
  --shadow: 0 1px 2px rgba(34, 18, 79, .06), 0 10px 30px rgba(74, 31, 184, .10);
  --shadow-pop: 0 2px 0 rgba(34, 18, 79, .9);

  --lg-bolla: #6A2BEA;
  --lg-cella: #8B5CF6;
  --lg-maniglia: #D9CCFF;
  --lg-word: #22124F;
  /* macchie pastello dietro le illustrazioni (assets/img/): disegnate qui, così nel tema scuro si scuriscono */
  --macchia-lilla: #E9E0FF;
  --macchia-menta: #CCF7EA;
  --macchia-rosa: #FFD9E8;
  /* la scena in testata (disegnata in index.html): i colori che cambiano col tema, di giorno e (sotto) di sera */
  --sc-cielo: #E9E0FF;
  --sc-astro: #FFD9E8;
  --sc-nuvola: #FFFFFF;
  --sc-prato: #CCF7EA;
  --sc-strada: #FFFFFF;
  --sc-trattini: #7B3FF2;
  --sc-notte: 0; /* stelle e luna: si vedono solo di sera */

  --radius: 22px;
  --radius-sm: 14px;
  --font-head: 'Bricolage Grotesque', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body: 'Inter', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* Tema scuro: solo se scelto col pulsante in alto (assets/tema.js), mai in automatico dal sistema. */
:root[data-theme="scuro"] {
  --bg: #140C2B;
  --bg-tint: #1A1037;
  --surface: #1F1540;
  --surface-2: #2A1E52;
  --ink: #F7F3FF;
  --text: #D8CFF3;
  --muted: #ADA2D2;
  --line: #362A63;
  --line-strong: #4D3E86;
  --primary: #A98BFF;
  --primary-ink: #170B38;
  --primary-soft: #2F2160;
  --primary-soft-ink: #E1D6FF;
  --accent: #C7B4FF;
  --save: #FF8DBD;
  --save-bg: #3A1534;
  --ok: #5EF0C4;
  --ok-bg: #12392F;
  --warn-bg: #3A1530;
  --warn-ink: #FFA6CA;
  --tip-bg: #123A33;
  --tip-ink: #8FF5D3;
  --focus: #C7B4FF;
  --tile-on: #2F2160;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-pop: 0 2px 0 rgba(0, 0, 0, .6);
  --lg-bolla: #8B5CF6;
  --lg-cella: #6A2BEA;
  --lg-maniglia: #D9CCFF;
  --lg-word: #F7F3FF;
  --macchia-lilla: #33256A;
  --macchia-menta: #173F3B;
  --macchia-rosa: #43204A;
  --sc-cielo: #241A4E;
  --sc-astro: #E9E0FF;
  --sc-nuvola: #3A2D70;
  --sc-prato: #173F3B;
  --sc-strada: #2E2462;
  --sc-trattini: #A98BFF;
  --sc-notte: 1;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; } /* titoli che ricevono il focus via script */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Logo */
.lg-bolla { fill: var(--lg-bolla); stroke: var(--lg-bolla); }
.lg-cella { fill: var(--lg-cella); }
.lg-maniglia { fill: var(--lg-maniglia); }
.lg-word { stroke: var(--lg-word); }
.logo { height: 34px; width: auto; display: block; }
.logo--footer { height: 30px; }

/* Barra in alto */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.nav > a svg { width: 20px; height: 20px; color: var(--primary); }
.nav > a:hover { background: var(--surface-2); }
.nav__cta { background: var(--primary); color: var(--primary-ink) !important; }
.nav__cta:hover { background: var(--primary) !important; opacity: .92; }
/* Pulsante del tema: sole/luna, 44×44 da toccare. In chiaro mostra la luna (passa allo scuro), in scuro il sole. */
.tema { flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.tema:hover { background: var(--surface-2); }
.tema:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tema svg { width: 22px; height: 22px; }
.tema__sole { display: none; }
:root[data-theme="scuro"] .tema__sole { display: block; }
:root[data-theme="scuro"] .tema__luna { display: none; }
/* Telefono: logo e voci un po' più strette, così logo, voci e pulsante del tema stanno in una riga anche a 360 px */
@media (max-width: 420px) {
  .topbar__in { gap: 8px; }
  .topbar .logo { height: 26px; }
  .nav { gap: 2px; }
  .nav > a { padding: 8px 9px; font-size: 14px; }
  .tema { width: 40px; height: 40px; }
}
@media (max-width: 420px) { .home .nav > a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .home .nav > a { padding: 8px; } .home .nav > a svg { width: 26px; height: 26px; } }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 16px/1 var(--font-body); padding: 14px 20px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; min-height: 50px; }
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn--primary-soft { background: var(--primary-soft); color: var(--primary-soft-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--block { width: 100%; }
.btn--big { font-size: 18px; min-height: 58px; }

/* Testata */
.stage { display: grid; gap: 14px; padding-top: 16px; padding-bottom: 40px; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.hero h1 { font-size: clamp(32px, 9vw, 64px); font-weight: 800; letter-spacing: -0.025em; }
.hl { color: var(--primary); }
.lede { margin-top: 6px; font: 600 18px/1.3 var(--font-body); color: var(--muted); }
.hero__van { width: 112px; height: auto; }
.hero__scene { display: none; }
/* aprendo un link a un risultato, la pagina iniziale non si vede per un attimo prima del risultato (index.html, data-apre) */
:root[data-apre] body > :not(.topbar) { visibility: hidden; }
/* la scena: di giorno nel tema chiaro, di sera nel tema scuro (niente pannello lavanda che abbaglia) */
.sc-cielo, .sc-ombra { fill: var(--sc-cielo); }
.sc-astro { fill: var(--sc-astro); }
.sc-nuvola__c { fill: var(--sc-nuvola); }
.sc-prato { fill: var(--sc-prato); }
.sc-strada { stroke: var(--sc-strada); }
.sc-trattini { stroke: var(--sc-trattini); }
.sc-notte { opacity: var(--sc-notte); }
.trust { display: none; }
@media (min-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr) 560px; gap: 48px; align-items: start; padding-top: 40px; padding-bottom: 72px; }
  .hero { grid-template-columns: 1fr; position: sticky; top: 96px; }
  .hero h1 { font-size: 66px; }
  .lede { font-size: 22px; }
  .hero__van { display: none; }
  .hero__scene { display: block; width: 100%; height: auto; margin-top: 24px; border-radius: 36px; }
  .trust { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 20px 0 0; }
  .trust li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 15px; }
  .trust svg { width: 18px; height: 18px; color: var(--primary); }
}

/* Illustrazioni (assets/img/): la macchia di colore dietro il disegno è uno sfondo, nei colori del tema.
   Le misure sono quelle dell'ellisse che stava dentro il disegno (in % della sua larghezza e altezza). */
img[src$="img/busta.svg"], img[src$="img/scatola-l.svg"] { background: radial-gradient(41.667% 40% at 50% 54%, var(--macchia-lilla) 98.5%, transparent 100%); }
img[src$="img/metro.svg"], img[src$="img/scatola-s.svg"] { background: radial-gradient(41.667% 40% at 50% 54%, var(--macchia-menta) 98.5%, transparent 100%); }
img[src$="img/scatola-m.svg"] { background: radial-gradient(41.667% 40% at 50% 54%, var(--macchia-rosa) 98.5%, transparent 100%); }
img[src$="img/confronta.svg"] { background: radial-gradient(43.333% 42% at 50% 54%, var(--macchia-lilla) 98.5%, transparent 100%); }
img[src$="img/locker.svg"] { background: radial-gradient(43.333% 42% at 50% 54%, var(--macchia-menta) 98.5%, transparent 100%); }
img[src$="img/casa.svg"] { background: radial-gradient(43.333% 42% at 50% 54%, var(--macchia-rosa) 98.5%, transparent 100%); }
img[src$="img/persona.svg"] { background: radial-gradient(43.333% 40% at 50% 53.333%, var(--macchia-lilla) 98.5%, transparent 100%); }

/* La procedura */
.wizard { padding: 16px; border-radius: 28px; }
@media (min-width: 520px) { .wizard { padding: 24px; } }
.progress { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.progress button { position: relative; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 0 10px; background: none; border: 0; border-bottom: 5px solid var(--line); border-radius: 0; font: 600 14px/1.2 var(--font-body); color: var(--muted); cursor: pointer; text-align: left; }
.progress button:disabled { cursor: default; }
.progress__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-weight: 700; flex-shrink: 0; }
.progress .is-done button { color: var(--ink); }
.progress .is-done .progress__n { background: var(--menta); color: #0E3B2F; }
.progress .is-now button { color: var(--ink); }
/* la barra sotto ogni passo: grigia, si riempie (da sinistra) di viola sul passo attuale e di menta su quelli fatti */
.progress button::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px; background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .8, .2, 1), background-color .2s ease; }
.progress .is-now button::after { transform: none; }
.progress .is-done button::after { transform: none; background: var(--menta); }
.progress .is-now .progress__n { background: var(--primary); color: var(--primary-ink); }
.progress button:not(:disabled):hover .progress__t { text-decoration: underline; text-underline-offset: 3px; }

.step { border: 0; padding: 0; margin: 0; min-width: 0; animation: entra .28s ease; }
/* il passo nuovo entra da destra andando avanti, da sinistra tornando indietro (data-dir lo mette app.js) */
.wizard[data-dir="indietro"] .step { animation-name: entra-indietro; }
@keyframes entra { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes entra-indietro { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.step legend { padding: 0; margin-bottom: 14px; width: 100%; }
.step__q { font-size: clamp(26px, 6.5vw, 34px); font-weight: 800; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; display: block; cursor: pointer; }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile > span { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; height: 100%; padding: 12px 8px 14px; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); transition: transform .18s cubic-bezier(.2, .8, .2, 1), border-color .12s ease, background .12s ease, box-shadow .18s ease; }
.tile img { width: 100%; max-width: 116px; aspect-ratio: 6 / 5; }
.tile__label { font: 800 18px/1.15 var(--font-head); color: var(--ink); margin-top: 4px; }
.tile__sub { font-size: 14px; color: var(--muted); }
.tile__tag { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--save); background: var(--save-bg); padding: 3px 9px; border-radius: 999px; }
.tile:hover > span { border-color: var(--line-strong); }
@media (hover: hover) { .tile:hover > span { transform: translateY(-3px); box-shadow: var(--shadow); } } /* col mouse si solleva un poco */
.tile:active > span { transform: translateY(0) scale(.97); box-shadow: none; transition-duration: .15s; } /* al tocco si schiaccia */
.tile input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile input:checked + span { border-color: var(--primary); background: var(--tile-on); box-shadow: inset 0 0 0 1px var(--primary); }
.tile input:checked + span::after { content: ''; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; animation: scatta .22s cubic-bezier(.3, 1.6, .5, 1) both; }
/* .22 s: finisce prima che il tocco porti al passo dopo (160 ms più il cambio) */
@keyframes scatta { from { opacity: 0; transform: scale(.2) rotate(-25deg); } } /* la spunta della scelta «scatta» */
.tile--row { grid-column: 1 / -1; }
.tile--row > span { display: grid; grid-template-columns: 64px 1fr; grid-auto-rows: auto; align-items: center; align-content: center; text-align: left; gap: 0 12px; padding: 8px 40px 8px 12px; }
.tile--row img { width: 64px; grid-row: 1 / span 2; }
.tile--row .tile__label { margin-top: 0; align-self: end; }
.tile--row .tile__sub { align-self: start; }
.tile--row .tile__label:only-of-type { grid-row: 1 / span 2; align-self: center; }
.tile--soft > span { background: var(--bg-tint); border-style: dashed; }
@media (min-width: 520px) { .tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.misure { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--bg-tint); border: 1px solid var(--line); }
.dims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 420px) { .dims { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field__label { font-size: 13px; font-weight: 700; color: var(--ink); }
.field__box { display: flex; align-items: center; background: var(--surface); border: 2px solid var(--line-strong); border-radius: 12px; padding: 0 10px; transition: border-color .12s ease; }
.field__box:focus-within { border-color: var(--primary); }
.field__box input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font: 700 19px/1 var(--font-body); color: var(--ink); padding: 12px 0; outline: none; }
.field__box input::placeholder { color: var(--muted); opacity: .55; }
.unit { color: var(--muted); font-size: 14px; font-weight: 600; }
.field__err { font-size: 13px; line-height: 1.35; color: var(--warn-ink); font-weight: 600; }
.field__err:empty { display: none; }
.has-err .field__box { border-color: var(--warn-ink); background: var(--warn-bg); animation: vibra .32s ease both; }
@keyframes vibra { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.field select { width: 100%; font: 500 16px var(--font-body); color: var(--ink); background: var(--surface); border: 2px solid var(--line-strong); border-radius: 12px; padding: 11px 10px; }
.hint { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.presets__label { font-size: 13px; font-weight: 700; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 14px/1 var(--font-body); padding: 9px 14px; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.more { margin-top: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-tint); }
.more summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 13px 16px; font-weight: 700; color: var(--ink); font-size: 15px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+'; color: var(--primary); font-weight: 800; margin-right: -4px; }
.more[open] summary::before { content: '–'; }
.more summary > span:first-of-type { flex: 1; }
.more__sum { color: var(--muted); font-weight: 500; font-size: 14px; }
.more__grid { display: grid; gap: 12px; padding: 0 16px 16px; }
@media (min-width: 520px) { .more__grid { grid-template-columns: 1fr 1fr; } .field--wide { grid-column: 1 / -1; } }

.step__nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.step__nav [data-next] { margin-left: auto; }
.step__nav:not(:has(button:not([hidden]))) { display: none; }

/* Risultato a tutto schermo */
.results { padding: 16px 0 48px; }
body[data-view="r"] .stage { display: none; }
@media (min-width: 720px) { .results { padding: 28px 0 72px; } }
.recap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (min-width: 860px) { .recap { grid-template-columns: 1.4fr 1fr 1fr 1.3fr; } }
.recap__chip { display: flex; align-items: center; gap: 6px; min-width: 0; text-align: left; padding: 6px 10px 6px 6px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.recap__chip:hover { border-color: var(--primary); }
.recap__chip img { width: 38px; flex-shrink: 0; }
@media (min-width: 520px) { .recap__chip img { width: 46px; } .recap__chip { gap: 8px; } }
.recap__chip > span { display: grid; min-width: 0; flex: 1; }
.recap__chip small { font-size: 12px; color: var(--muted); font-weight: 600; }
.recap__chip b { font-size: 14px; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.recap__edit { width: 18px; height: 18px; color: var(--primary); }
.recap__chip:first-child { grid-column: 1 / -1; }
.recap__chip--opts { grid-column: 1 / -1; padding-left: 14px; }
@media (min-width: 860px) { .recap__chip:first-child, .recap__chip--opts { grid-column: auto; } }

.res-grid { display: grid; gap: 16px; }
.col { display: grid; gap: 14px; align-content: start; min-width: 0; }
@media (min-width: 980px) { .res-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; } .res-grid > .col:first-child { position: sticky; top: 84px; } }
.res-grid--more { margin-top: 16px; }

.dritta { position: relative; background: var(--surface); border: 3px solid var(--primary); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
@media (min-width: 520px) { .dritta { padding: 26px; } }
.dritta__route { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 22px; background: var(--bg-tint); }
.dritta__place { width: 84px; }
.dritta__road { flex: 1; position: relative; display: flex; justify-content: center; align-items: center; min-height: 40px; }
.dritta__road::before { content: ''; position: absolute; left: 0; right: 0; top: 70%; border-top: 4px dashed var(--line-strong); }
.dritta__road img { position: relative; width: min(110px, 100%); }
.badge { justify-self: start; display: inline-flex; align-items: center; gap: 6px; background: var(--menta); color: #0E3B2F; font: 800 14px/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-radius: 999px; }
.badge svg { width: 16px; height: 16px; }
.dritta__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.dritta__name { font-size: clamp(26px, 6vw, 34px); font-weight: 800; }
.dritta__via { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.dritta__price { margin-left: auto; font: 800 clamp(48px, 13vw, 64px)/0.95 var(--font-head); color: var(--primary); letter-spacing: -0.03em; text-align: right; }
.dritta__price small { display: block; font: 600 13px/1.4 var(--font-body); color: var(--muted); letter-spacing: 0; margin-top: 4px; text-align: right; }
.dritta__from { font-size: .45em; }
@media (max-width: 519px) { .dritta__price { margin-left: 0; } .dritta__price small { text-align: left; } }
.route { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route__leg { background: var(--bg-tint); border-radius: 16px; padding: 10px 12px; min-width: 0; }
.route__k { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.route__k svg { width: 16px; height: 16px; color: var(--primary); }
.route__v { margin-top: 2px; font-weight: 700; color: var(--ink); line-height: 1.3; font-size: 15px; overflow-wrap: anywhere; }
.dritta__days { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.dritta__days svg { width: 20px; height: 20px; color: var(--primary); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; }
.note svg { width: 20px; height: 20px; margin-top: 1px; }
.note--warn { background: var(--warn-bg); color: var(--warn-ink); }
.note--tip { background: var(--tip-bg); color: var(--tip-ink); }
.note--info { background: var(--surface-2); color: var(--text); }
.verifica { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.verifica svg { width: 18px; height: 18px; color: var(--ok); }
.verifica--check { color: var(--warn-ink); }
.verifica--check svg { color: var(--warn-ink); }
.why { color: var(--text); }
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.reqs li { display: flex; gap: 8px; align-items: flex-start; }
.reqs svg { width: 18px; height: 18px; color: var(--primary); margin-top: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
@media (min-width: 520px) { .panel { padding: 22px; } }
.panel h3 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.panel__img { width: 52px; }
.panel__sub { color: var(--muted); font-size: 14px; }
.saving { background: linear-gradient(160deg, var(--save-bg), var(--surface) 70%); }
.saving__big { margin-top: 10px; font: 800 clamp(44px, 12vw, 58px)/1 var(--font-head); color: var(--save); letter-spacing: -0.03em; }
.saving__big small { font-size: .4em; letter-spacing: 0; }
.saving__msg { margin-top: 6px; color: var(--text); }
.bars { display: grid; gap: 12px; margin-top: 16px; }
.bar__top { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.bar__track { height: 14px; border-radius: 999px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--line-strong); transform-origin: left; animation: cresce .6s ease; }
.bar--win .bar__fill { background: linear-gradient(90deg, var(--menta), #19C496); }
@keyframes cresce { from { transform: scaleX(0); } to { transform: none; } }
.bar__sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.market { display: grid; gap: 8px; font-size: 15px; border-left: 6px solid var(--primary); }
.market b { color: var(--ink); }
.counter { display: flex; gap: 12px; align-items: center; font-size: 15px; padding: 14px 16px; background: var(--tip-bg); color: var(--tip-ink); border: 0; box-shadow: none; }
.counter svg { width: 24px; height: 24px; }
.counter b { color: inherit; }
/* paesi nuovi: «un po' troppo piccolo per…», un consiglio in più, più discreto di quello dello sportello */
.counter--piccolo { font-size: 14px; line-height: 1.45; padding: 10px 14px; gap: 10px; }
.counter--piccolo svg { width: 20px; height: 20px; flex: none; }

/* Sezioni richiudibili del risultato */
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; font: 800 18px/1.2 var(--font-head); color: var(--ink); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary > span:first-of-type { flex: 1; }
.fold > summary::after { content: ''; width: 12px; height: 12px; border-right: 3px solid var(--primary); border-bottom: 3px solid var(--primary); transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s ease; flex-shrink: 0; }
.fold[open] > summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.fold__img { width: 52px; }
.fold__sum { font: 700 13.5px/1.2 var(--font-body); padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.fold__sum.is-ok { background: var(--ok-bg); color: var(--ok); }
.fold__sum.is-no { background: var(--warn-bg); color: var(--warn-ink); }
.fold__body { padding: 0 16px 16px; display: grid; gap: 12px; }
.fold--inner { border: 0; background: var(--bg-tint); }
.fold--inner > summary { font: 700 15px/1.2 var(--font-body); padding: 13px 16px; }

.fit { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 520px) { .fit { grid-template-columns: 1fr 1fr; } }
.fit li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.fit li > svg { width: 22px; height: 22px; padding: 3px; border-radius: 50%; margin-top: 1px; }
.fit .yes > svg { background: var(--menta); color: #0E3B2F; }
.fit .no > svg { background: var(--warn-bg); color: var(--warn-ink); }
.fit b { color: var(--ink); display: block; font-size: 14.5px; }
.fit small { color: var(--muted); font-size: 13px; line-height: 1.35; display: block; }
.fit__vol { font-size: 14px; color: var(--muted); }
.fit__vol b { color: var(--ink); }

.alts { display: grid; gap: 8px; }
.alt { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); text-decoration: none; color: var(--text); }
.alt:hover { border-color: var(--primary); }
.alt__name { font-weight: 700; color: var(--ink); }
.alt__tag { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); padding: 2px 8px; border-radius: 999px; }
.alt__price { font: 800 20px/1 var(--font-head); color: var(--ink); align-self: center; grid-row: span 2; }
.alt__sub { font-size: 13.5px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-weight: 700; color: var(--ink); white-space: nowrap; }
.svc { display: grid; justify-items: start; font-weight: 600; color: var(--ink); }
.svc small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.svc__tag { order: 2; margin: 3px 0 1px; font: 800 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: #0E3B2F; background: var(--menta); padding: 4px 7px; border-radius: 999px; }
.svc small { order: 1; }
tr.is-best td { background: var(--tile-on); }
tr.is-best td:first-child { box-shadow: inset 4px 0 0 var(--primary); }
tr.is-off td { opacity: .55; }
/* Telefono: la tabella diventa un elenco di schede (servizio e prezzo in alto, poi percorso e tempi), niente colonne
   tagliate né scorrimento di lato. I ruoli nel codice (role="table", "row", "cell") la tengono una tabella per i
   lettori di schermo; le intestazioni restano lì per loro, nascoste alla vista. */
@media (max-width: 599px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  table.opts { min-width: 0; display: block; }
  table.opts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.opts tbody { display: grid; gap: 8px; }
  table.opts tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  table.opts td { display: block; padding: 0; border: 0; min-width: 0; }
  table.opts td:nth-child(1) { grid-column: 1; grid-row: 1; }
  table.opts td.num { grid-column: 2; grid-row: 1; font: 800 19px/1.1 var(--font-head); align-self: start; }
  table.opts td:nth-child(2), table.opts td:nth-child(3) { grid-column: 1 / -1; font-size: 14px; color: var(--text); }
  table.opts td:nth-child(2)::before, table.opts td:nth-child(3)::before { content: attr(data-label) " "; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; }
  table.opts tr.is-best { border: 2px solid var(--primary); background: var(--tile-on); }
  table.opts tr.is-best td, table.opts tr.is-best td:first-child { background: none; box-shadow: none; }
}

.excluded { font-size: 14px; }
.excluded summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.excluded ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }

.res-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* telefono: «Copia il link» e «Nuovo pacco» affiancati, larghi uguali */
@media (max-width: 519px) { .res-actions { display: grid; grid-template-columns: 1fr 1fr; } .res-actions .btn { padding: 14px 10px; } .res-actions .toast { grid-column: 1 / -1; } }
.toast { font-size: 14px; font-weight: 600; color: var(--ok); }
.toast:empty { display: none; }
.res-foot { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.res-foot svg { width: 18px; height: 18px; margin-top: 1px; color: var(--primary); }

.empty { text-align: center; display: grid; justify-items: center; gap: 12px; padding: 24px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty img { width: 120px; }
.empty h2 { font-size: 26px; font-weight: 800; }
.empty p { max-width: 520px; }
.empty__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Come funziona (pagina a parte) */
.page { padding: 28px 0 64px; }
@media (min-width: 720px) { .page { padding: 48px 0 80px; } }
.page__head { display: grid; gap: 8px; }
.page__head h1 { font-size: clamp(36px, 8vw, 58px); font-weight: 800; letter-spacing: -0.025em; }
.page__head p { font-size: 18px; color: var(--muted); font-weight: 500; }
.section { margin-top: 44px; scroll-margin-top: 80px; }
.section__title { font-size: clamp(26px, 5vw, 36px); font-weight: 800; }
.section__lede { font-size: 16px; margin-top: 8px; max-width: 640px; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.how { padding: 18px; display: grid; justify-items: start; gap: 6px; }
.how img { width: auto; height: 90px; } /* proporzioni del disegno: la macchia di sfondo resta sotto il disegno */
.how h3 { font-size: 20px; }
.how__n { font: 800 13px/1 var(--font-body); color: var(--primary-ink); background: var(--primary); border-radius: 999px; padding: 5px 10px; }
.facts { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.fact { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.fact .fact__big { font: 800 40px/1 var(--font-head); color: var(--save); }
.fact h3 { font-size: 18px; }
.fact p { font-size: 15px; }
.src { font-size: 13.5px; font-weight: 600; margin-top: auto; padding-top: 6px; }
.money { padding: 18px; margin-top: 16px; display: grid; gap: 10px; }
.money b { color: var(--ink); }
.faq { margin-top: 16px; display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--primary); font-size: 22px; line-height: 1; font-weight: 800; }
.faq details[open] summary::after { content: '–'; }
.faq p { padding: 0 0 16px; }
.howcheck { margin-top: 12px; font-size: 15px; }
.howcheck summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.howcheck p { margin-top: 8px; color: var(--text); }

/* Fonti e storico (come-funziona.html e note-legali.html) */
.sources { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sources li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14.5px; flex-wrap: wrap; }
.sources b { color: var(--ink); }
.sources__svc { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.sources small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.sources small.is-check { color: var(--warn-ink); }
.sources a { align-self: flex-start; overflow-wrap: anywhere; }
.storico { margin-top: 16px; font-size: 14px; color: var(--muted); }
.storico summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.storico p { margin: 8px 0 0; line-height: 1.5; }
.storico ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; }
.storico b { color: var(--ink); font-weight: 600; }
.storico small { display: block; font-size: 13px; }
.storico a { overflow-wrap: anywhere; }

/* Piè di pagina */
.footer { border-top: 1px solid var(--line); padding: 32px 0; background: var(--bg-tint); }
.footer__in { display: grid; gap: 18px; }
@media (min-width: 820px) { .footer__in { grid-template-columns: auto 1fr; gap: 48px; align-items: center; } }
.footer__tag { margin-top: 8px; color: var(--ink); font-weight: 600; }
.footer__small { font-size: 13px; color: var(--muted); max-width: 640px; margin-top: 10px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14.5px; }
.footer__links a { color: var(--ink); font-weight: 600; }

/* Pagine di testo (privacy.html, note-legali.html): una colonna leggibile, stessi titoli e card della pagina */
.legal { padding: 40px 0 64px; }
@media (min-width: 720px) { .legal { padding: 56px 0 80px; } }
.legal h1 { font-size: clamp(34px, 7vw, 52px); font-weight: 800; }
.legal__meta { margin-top: 10px; color: var(--muted); font-size: 14px; }
.legal__brief { padding: 20px 22px; margin-top: 24px; display: grid; gap: 10px; }
.legal__brief ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal__brief b, .legal b { color: var(--ink); }
.legal h2 { font-size: clamp(22px, 4vw, 28px); font-weight: 700; margin-top: 40px; scroll-margin-top: 80px; }
.legal h3 { font-size: 18px; font-weight: 700; margin-top: 22px; }
.legal p, .legal ul, .legal ol { margin: 12px 0 0; }
.legal ul, .legal ol { padding-left: 22px; display: grid; gap: 6px; }
.legal .sources { padding-left: 0; }
.legal a { overflow-wrap: anywhere; }
.legal__toc { margin-top: 20px; font-size: 15px; }
.legal__toc ol { margin-top: 6px; }

/* Animazioni. Solo transform e opacity (niente salti nella pagina), brevi; le uniche infinite sono quelle della scena
   in testata, che assets/animazioni.js ferma quando la scena non si vede o la scheda è in background (classe is-ferma).
   Con prefers-reduced-motion: reduce le spegne tutte la regola in cima al file; in stampa le spegne @media print. */

/* Scena in testata (index.html): il furgoncino va avanti e indietro sulla strada, il pacco dondola, il segnaposto
   rimbalza piano, le nuvole scorrono, ogni tanto lo sportello del locker si chiude e si riapre. Il primo fotogramma di
   ogni animazione è il disegno com'è, quindi ferma (o senza animazioni) la scena è identica. */
[data-scena].is-ferma, [data-scena].is-ferma * { animation-play-state: paused !important; }
.sc-furgone { animation: sc-va 9s ease-in-out infinite; }
.sc-sobbalzo { animation: sc-sobbalzo .8s ease-in-out infinite; }
.sc-scia { animation: sc-scia 9s ease-in-out infinite; }
.sc-pacco { transform-box: fill-box; transform-origin: center; animation: sc-dondola 3.6s ease-in-out infinite; }
.sc-segnaposto { animation: sc-rimbalza 2.4s ease-in-out infinite; }
.sc-nuvola { animation: sc-nuvola 16s ease-in-out infinite; }
.sc-nuvola--2 { animation-duration: 21s; animation-direction: reverse; }
.sc-sportello { transform-box: fill-box; transform-origin: left center; animation: sc-sportello 10s ease-in-out infinite; }
.sc-anta { transform-box: fill-box; transform-origin: right center; transform: scaleX(0); animation: sc-anta 10s ease-in-out infinite; }
@keyframes sc-va { 0%, 100% { transform: none; } 42%, 54% { transform: translate(64px, 2px); } }
@keyframes sc-sobbalzo { 0%, 100% { transform: none; } 50% { transform: translateY(-1.5px); } }
@keyframes sc-scia { 0%, 36% { opacity: 1; } 44%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes sc-dondola { 0%, 100% { transform: none; } 25% { transform: rotate(-6deg); } 75% { transform: rotate(5deg); } }
@keyframes sc-rimbalza { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-8px); } }
@keyframes sc-nuvola { 0%, 100% { transform: none; } 50% { transform: translateX(26px); } }
@keyframes sc-sportello { 0%, 56%, 92%, 100% { transform: none; } 62%, 86% { transform: scaleX(0); } }
@keyframes sc-anta { 0%, 58%, 90%, 100% { transform: scaleX(0); } 64%, 84% { transform: none; } }
/* sul telefono, al posto della scena, il furgoncino accanto al titolo che va piano avanti e indietro */
.hero__van { animation: sc-furgoncino 3.2s ease-in-out infinite; }
@keyframes sc-furgoncino { 0%, 100% { transform: none; } 30% { transform: translate(5px, -1px); } 60% { transform: translate(-2px, 0); } }

/* Il risultato: la dritta sale e appare, il furgoncino attraversa la striscia del percorso, il badge e il risparmio
   compaiono con un piccolo rimbalzo, poi le altre sezioni una dopo l'altra. Il prezzo conta (assets/animazioni.js). */
.recap { animation: appare .3s ease both; }
.dritta, .empty { animation: sale .42s cubic-bezier(.2, .8, .2, 1) both; }
.dritta__road img { animation: attraversa .9s cubic-bezier(.25, .7, .2, 1) .15s both; }
.dritta .badge { transform-origin: left center; animation: rimbalzo .45s cubic-bezier(.3, 1.5, .5, 1) .3s both; }
.saving__big { transform-origin: left center; animation: rimbalzo .5s cubic-bezier(.3, 1.5, .5, 1) .5s both; }
.res-grid > .col:last-child > *, .res-grid--more > .col > *, .results .res-actions, .results .res-foot { animation: sale .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.12s + var(--n, 0) * .07s); }
.res-grid > .col:last-child > :nth-child(2) { --n: 1; }
.res-grid > .col:last-child > :nth-child(3) { --n: 2; }
.res-grid > .col:last-child > :nth-child(4) { --n: 3; }
.res-grid > .col:last-child > :nth-child(5) { --n: 4; }
.res-grid > .col:last-child > :nth-child(6) { --n: 5; }
.res-grid > .col:last-child > :nth-child(n+7) { --n: 6; }
.res-grid--more > .col:last-child > *, .results > .wrap > .res-actions, .results > .wrap > .res-foot { --n: 2; }
.fold[open] > .fold__body, .more[open] > .more__grid { animation: appare .25s ease both; }
@keyframes sale { from { opacity: 0; transform: translateY(14px); } }
@keyframes appare { from { opacity: 0; } }
@keyframes rimbalzo { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes attraversa { 0% { opacity: 0; transform: translateX(-130%); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }

/* Il prezzo che conta: il numero vero resta al suo posto (invisibile durante il conteggio, ma letto, copiato e
   stampato), sopra c'è la copia che conta. inline-block: la copia ha la stessa riga, quindi le cifre combaciano. */
.conta { position: relative; display: inline-block; }
.conta__finto { position: absolute; top: 0; left: 0; right: 0; text-align: right; white-space: nowrap; pointer-events: none; -webkit-user-select: none; user-select: none; }
.conta.is-conta > .conta__vero { opacity: 0; }

/* Stampa: la dritta su carta, senza menu, procedura e pulsanti. Sempre in chiaro, sezioni richiuse aperte. */
@media print {
  :root, :root[data-theme="scuro"] {
    --bg: #fff; --bg-tint: #fff; --surface: #fff; --surface-2: #F3EEFF; --ink: #22124F; --text: #222; --muted: #555;
    --line: #ccc; --line-strong: #999; --primary: #5A1FD8; --primary-ink: #fff; --accent: #5A1FD8; --save: #A30D4E; --save-bg: #fff;
    --ok: #08795B; --ok-bg: #fff; --warn-bg: #fff; --warn-ink: #8A0E45; --tip-bg: #fff; --tip-ink: #0A6B50; --tile-on: #F3EEFF; --shadow: none;
    --lg-bolla: #6A2BEA; --lg-cella: #8B5CF6; --lg-maniglia: #D9CCFF; --lg-word: #22124F;
    --macchia-lilla: #E9E0FF; --macchia-menta: #CCF7EA; --macchia-rosa: #FFD9E8;
    --sc-cielo: #E9E0FF; --sc-astro: #FFD9E8; --sc-nuvola: #FFFFFF; --sc-prato: #CCF7EA; --sc-strada: #FFFFFF; --sc-trattini: #7B3FF2; --sc-notte: 0;
    color-scheme: light;
  }
  body { font-size: 11pt; background: #fff; }
  /* niente animazioni sulla carta: tutto al suo posto, il prezzo vero e non quello che conta */
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .conta__finto { display: none !important; }
  .conta.is-conta > .conta__vero { opacity: 1; }
  .topbar, .skip, .chips, .filters, .res-actions, .btn, .recap__edit, .footer .logo, .dritta__route { display: none !important; }
  body[data-view="r"] .stage { display: none; }
  .results { padding: 0; }
  .res-grid { grid-template-columns: 1fr !important; }
  .res-grid > .col:first-child { position: static; }
  .panel, .fold, .dritta, .empty { box-shadow: none; break-inside: avoid; }
  .fold:has(table) { break-inside: auto; }
  details > :not(summary) { display: block !important; }
  .fold > summary::after { display: none; }
  .table-wrap { overflow: visible; border: 0; }
  table { min-width: 0; }
  th { position: static; }
  .recap__chip { border-width: 1px; }
  a { color: inherit; text-decoration: none; }
}
