/* ==========================================================================
   Scorporo IVA — foglio di stile
   Sistema: strumento finanziario di precisione.
   Palette: verde mastro (netto/azione) + ocra caldo (IVA) su carta calda.
   Tipografia: Space Grotesk (display) · IBM Plex Sans (testo) · IBM Plex Mono (cifre)
   Firma: il risultato come scontrino digitale con bordo strappato.
   ========================================================================== */

:root {
  /* colore */
  --ink:        #0E1D1B;
  --ink-2:      #16302C;
  --paper:      #F5F6F1;
  --surface:    #FFFFFF;
  --fill:       #EEF1EA;
  --line:       #E0E4DA;
  --line-2:     #CDD4C8;
  --muted:      #5C6A63;
  --brand:      #0C6E57;
  --brand-700:  #0A5645;
  --brand-050:  #E4F0EB;
  --iva:        #B7761A;
  --iva-700:    #8F5C12;
  --iva-050:    #F7EEDB;
  --danger:     #B23A2E;

  /* tipografia */
  --f-display: "Space Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --f-body:    "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* spazio & forma */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(14,29,27,.06), 0 12px 34px -18px rgba(14,29,27,.28);
  --shadow-soft: 0 1px 2px rgba(14,29,27,.05), 0 8px 22px -16px rgba(14,29,27,.2);
  --wrap: 1120px;
  --wrap-narrow: 760px;
}

/* --- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3, h4, h5, h6 { font-family: var(--f-display); font-weight: 600; line-height: 1.14; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* --- layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap--narrow { max-width: var(--wrap-narrow); }
.section { padding-block: 68px; }
.section--tint { background: var(--fill); }
.eyebrow {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin: 0 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--iva); display: inline-block; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }

/* --- header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--f-display); font-weight: 600; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-weight: 600; font-size: .95rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 4px 12px -6px var(--brand);
}
.brand__mark small { font-size: .5rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { font-family: var(--f-body); font-size: .95rem; font-weight: 500; color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 9px; white-space: nowrap; }
.nav a:hover { background: var(--brand-050); color: var(--brand-700); }
.nav a[aria-current="page"] { color: var(--brand-700); background: var(--brand-050); }
.nav__toggle { display: none; }

/* --- hero --------------------------------------------------------------- */
.hero { padding-block: 56px 40px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% 40%;
  height: 460px; z-index: 0;
  background: radial-gradient(60% 60% at 60% 30%, rgba(12,110,87,.09), transparent 70%);
  pointer-events: none;
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.02fr .98fr; gap: 52px; align-items: start; }
.hero h1 { font-size: clamp(2.15rem, 4.6vw, 3.35rem); margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero__sub { font-size: 1.16rem; color: var(--muted); max-width: 46ch; margin: 0 0 26px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 4px; padding: 0; list-style: none; }
.trust li { font-size: .86rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 7px 12px 7px 30px; border-radius: 999px; position: relative; }
.trust li::before { content: ""; position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }

/* ==========================================================================
   CALCOLATORE — la firma della pagina
   ========================================================================== */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
}
.calc-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 4px 16px; }
.calc-card__head h2 { font-size: 1.12rem; margin: 0; }
.calc-card__tag { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.calc { display: block; }
.calc__modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--fill); padding: 5px; border-radius: var(--r); margin-bottom: 18px; }
.calc__mode {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--f-body); font-weight: 600; font-size: .96rem; color: var(--muted);
  background: transparent; padding: 10px 12px; border-radius: 10px; line-height: 1.15;
  transition: background .18s, color .18s, box-shadow .18s;
  display: flex; flex-direction: column; gap: 2px;
}
.calc__mode small { font-weight: 500; font-size: .74rem; color: inherit; opacity: .72; font-family: var(--f-body); }
.calc__mode.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.calc__mode:hover:not(.is-active) { color: var(--ink-2); }

.calc__label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink-2); margin: 0 2px 8px; }
.calc__input { display: flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--surface); transition: border-color .18s, box-shadow .18s; overflow: hidden; }
.calc__input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-050); }
.calc__cur { font-family: var(--f-mono); font-size: 1.4rem; color: var(--muted); padding: 0 4px 0 16px; }
.calc__input input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-family: var(--f-mono); font-size: 1.7rem; font-weight: 500; color: var(--ink);
  padding: 14px 16px 14px 6px; width: 100%; min-width: 0;
  font-variant-numeric: tabular-nums;
}
.calc__hint { font-size: .8rem; color: var(--muted); margin: 8px 2px 0; }

.calc__rates { margin-top: 20px; }
.calc__rateslabel { display: block; font-size: .88rem; font-weight: 600; color: var(--ink-2); margin: 0 2px 10px; }
.calc__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.calc__chip { position: relative; cursor: pointer; }
.calc__chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.calc__chip span {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-weight: 600; font-size: .98rem;
  padding: 9px 15px; border-radius: 999px;
  border: 1.5px solid var(--line-2); color: var(--ink-2); background: var(--surface);
  transition: border-color .16s, background .16s, color .16s;
}
.calc__chip:hover span { border-color: var(--brand); }
.calc__chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -6px var(--brand); }
.calc__chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.calc__chip--custom span { border-style: dashed; }
.calc__custom { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-family: var(--f-mono); }
.calc__custom input { width: 88px; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-family: var(--f-mono); font-size: 1rem; }
.calc__custom input:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-050); }

/* --- scontrino (risultato) --------------------------------------------- */
.receipt {
  margin-top: 22px; background: var(--ink);
  border-radius: var(--r) var(--r) 0 0; color: #EAF1EE;
  padding: 20px 22px 26px; position: relative;
}
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 12px;
  background:
    linear-gradient(-45deg, var(--ink) 8px, transparent 0) 0 0 / 16px 12px repeat-x,
    linear-gradient(45deg, var(--ink) 8px, transparent 0) 0 0 / 16px 12px repeat-x;
}
.receipt__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed rgba(234,241,238,.16); }
.receipt__row span { font-family: var(--f-body); font-size: .96rem; color: rgba(234,241,238,.82); }
.receipt__row span small { display: block; font-size: .72rem; color: rgba(234,241,238,.5); }
.receipt__val { font-family: var(--f-mono); font-weight: 600; font-size: 1.18rem; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.receipt__row--iva small { color: var(--iva); }
.receipt__row--iva .receipt__val { color: #F2C879; }
.receipt__row--total { border-bottom: 0; padding-top: 12px; margin-top: 2px; }
.receipt__row--total span { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; color: #fff; }
.receipt__row--total .receipt__val { font-size: 1.5rem; color: #7FE3C4; }
.receipt__formula { font-family: var(--f-mono); font-size: .78rem; color: rgba(234,241,238,.62); margin: 14px 0 0; line-height: 1.5; min-height: 1.2em; }
.receipt__formula b { color: #7FE3C4; font-weight: 600; }
.receipt__copy {
  margin-top: 16px; width: 100%; appearance: none; cursor: pointer;
  font-family: var(--f-body); font-weight: 600; font-size: .92rem; color: #EAF1EE;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  padding: 11px; border-radius: 10px; transition: background .16s;
}
.receipt__copy:hover { background: rgba(255,255,255,.14); }
.receipt__copy.is-done { background: var(--brand); border-color: var(--brand); color: #fff; }

/* --- prosa / contenuto -------------------------------------------------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 1.6em; }
.prose h3 { font-size: 1.24rem; margin-top: 1.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose strong { color: var(--ink); }
.callout {
  border-left: 4px solid var(--brand); background: var(--brand-050);
  padding: 16px 20px; border-radius: 0 var(--r) var(--r) 0; margin: 1.4em 0;
}
.callout--iva { border-left-color: var(--iva); background: var(--iva-050); }
.callout p:last-child { margin-bottom: 0; }
.callout__title { font-family: var(--f-display); font-weight: 600; margin-bottom: .3em; display: block; }

/* formula visuale */
.formula-box {
  background: var(--ink); color: #EAF1EE; border-radius: var(--r); padding: 22px 24px;
  font-family: var(--f-mono); font-size: 1.02rem; text-align: center; margin: 1.4em 0; line-height: 1.9;
  overflow-x: auto;
}
.formula-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .1em .45em; margin: .35em 0; }
.formula-box .frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; margin: 0 .3em; }
.formula-box .frac span:first-child { border-bottom: 1.5px solid rgba(234,241,238,.5); padding: 0 .5em .1em; }
.formula-box .frac span:last-child { padding: .1em .5em 0; }
.formula-box .hl { color: #7FE3C4; }
.formula-box .hl-iva { color: #F2C879; }

/* tabelle */
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: .96rem; background: var(--surface); min-width: 440px; }
table.data caption { text-align: left; font-size: .82rem; color: var(--muted); padding: 12px 16px 0; caption-side: top; }
table.data th, table.data td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { font-family: var(--f-display); font-weight: 600; font-size: .82rem; letter-spacing: .02em; color: var(--ink-2); background: var(--fill); border-bottom: 1.5px solid var(--line-2); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--brand-050); }
table.data td.num, table.data th.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
table.data td.hl { color: var(--brand-700); font-weight: 600; }
table.data td.hl-iva { color: var(--iva-700); font-weight: 600; }

/* griglia di card (aliquote / strumenti) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 8px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; text-decoration: none; color: inherit; transition: transform .16s, box-shadow .16s, border-color .16s;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); border-color: var(--line-2); }
.card__rate { font-family: var(--f-mono); font-weight: 600; font-size: 1.9rem; color: var(--brand); line-height: 1; }
.card h3 { font-size: 1.08rem; margin: 12px 0 6px; }
.card p { font-size: .92rem; color: var(--muted); margin: 0; }
.card__link { display: inline-block; margin-top: 12px; font-family: var(--f-body); font-weight: 600; font-size: .9rem; color: var(--brand-700); }

/* passi (HowTo) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.4em 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 18px 20px 18px 62px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.steps li::before {
  counter(step); content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff;
  font-family: var(--f-mono); font-weight: 600; display: grid; place-items: center; font-size: .95rem;
}
.steps li h3 { display: block; font-family: var(--f-display); font-size: 1rem; margin: 0 0 3px; }
.steps li p { margin: 0; font-size: .96rem; color: var(--ink-2); }

/* FAQ */
.faq { margin-top: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.faq details[open] { border-color: var(--line-2); box-shadow: var(--shadow-soft); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-family: var(--f-display); font-weight: 600; font-size: 1.06rem; position: relative; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 1.5rem; color: var(--brand); transition: transform .2s; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq__body { padding: 0 20px 18px; color: var(--ink-2); }
.faq__body p:first-child { margin-top: 0; }
.faq__body p:last-child { margin-bottom: 0; }

/* --- blocco annunci (AdSense) ------------------------------------------ */
.ad-slot { margin: 34px auto; max-width: 100%; text-align: center; min-height: 90px; }
.ad-slot__label { display: block; font-family: var(--f-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--line-2); margin-bottom: 6px; }

/* --- breadcrumb --------------------------------------------------------- */
.crumbs { font-size: .85rem; color: var(--muted); padding: 18px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: "›"; margin-left: 6px; color: var(--line-2); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-700); }
.crumbs [aria-current] { color: var(--ink-2); }

/* --- footer ------------------------------------------------------------- */
.site-footer { background: var(--ink); color: rgba(234,241,238,.72); padding-block: 54px 30px; margin-top: 30px; }
.site-footer a { color: rgba(234,241,238,.9); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-grid h3 { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; font-family: var(--f-mono); font-weight: 600; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 9px; font-size: .94rem; }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: .92rem; max-width: 34ch; }
.footer-bottom { border-top: 1px solid rgba(234,241,238,.14); margin-top: 34px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .84rem; color: rgba(234,241,238,.55); }
.footer-legal { max-width: var(--wrap-narrow); font-size: .82rem; color: rgba(234,241,238,.5); margin-top: 18px; line-height: 1.6; }

/* --- utility ------------------------------------------------------------ */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.section-head { max-width: 60ch; margin-bottom: 34px; }
.section-head.center { margin-inline: auto; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }

/* --- responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  body { font-size: 1rem; }
  .section { padding-block: 48px; }
  .hero { padding-block: 36px 20px; }
  .nav { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 20px 16px; transform: translateY(-120%); transition: transform .24s ease; box-shadow: var(--shadow); }
  .nav.is-open { transform: translateY(0); }
  .nav a { padding: 12px; }
  .nav__toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
  .nav__toggle span, .nav__toggle span::before, .nav__toggle span::after { content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative; }
  .nav__toggle span::before { position: absolute; top: -6px; }
  .nav__toggle span::after { position: absolute; top: 6px; }
  .calc__modes { grid-template-columns: 1fr; }
  .receipt__row--total .receipt__val { font-size: 1.3rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
@media (min-width: 721px) { .nav__toggle { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================================
   AGGIUNTE v2 — cronologia, condivisione, banner cookie, pagine testuali, 404
   (blocco appeso: non modifica le regole preesistenti)
   ========================================================================== */

/* --- Azioni ricevuta (copia + condividi) -------------------------------- */
.receipt__actions{
  display:flex; flex-wrap:wrap; gap:10px; margin-top:14px;
}
.receipt__actions .receipt__copy{ margin-top:0; flex:1 1 auto; }
.receipt__share{
  background:var(--surface); color:var(--brand-700);
  border:1px solid var(--line-2);
}
.receipt__share:hover{ background:var(--brand-050); border-color:var(--brand); }
.receipt__share.is-done{ color:var(--brand-700); border-color:var(--brand); }

/* --- Cronologia calcoli (localStorage) ---------------------------------- */
.cronologia{
  margin-top:16px; padding:14px 16px;
  background:var(--fill); border:1px solid var(--line);
  border-radius:var(--r);
}
.cronologia__head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:8px;
}
.cronologia__title{
  font-family:var(--f-display); font-weight:600; font-size:.92rem; color:var(--ink);
}
.cronologia__clear{
  border:0; background:transparent; color:var(--muted);
  font-size:.82rem; cursor:pointer; padding:4px 6px; border-radius:var(--r-sm);
}
.cronologia__clear:hover{ color:var(--danger); background:var(--surface); }
.cronologia__list{ list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.cronologia__item{
  display:flex; flex-direction:column; gap:2px;
  padding:8px 10px; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r-sm);
}
.cronologia__amounts{ font-family:var(--f-mono); font-size:.86rem; color:var(--ink); }
.cronologia__amounts small{ color:var(--muted); font-family:var(--f-body); }
.cronologia__meta{ font-size:.76rem; color:var(--muted); }

/* --- Banner cookie ------------------------------------------------------- */
.cookie-banner{
  position:fixed; left:50%; bottom:16px; transform:translate(-50%, 140%);
  width:min(720px, calc(100vw - 24px)); z-index:9999;
  background:var(--surface); color:var(--ink);
  border:1px solid var(--line-2); border-radius:var(--r-lg);
  box-shadow:var(--shadow);
  transition:transform .28s cubic-bezier(.2,.7,.2,1);
}
.cookie-banner.is-in{ transform:translate(-50%, 0); }
.cookie-banner__body{ padding:16px 18px; }
.cookie-banner__text{ margin:0 0 12px; font-size:.9rem; line-height:1.5; color:var(--ink-2); }
.cookie-banner__text a{ color:var(--brand-700); text-decoration:underline; }
.cookie-banner__actions{ display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.cookie-btn{
  font-family:var(--f-body); font-weight:600; font-size:.88rem;
  padding:9px 16px; border-radius:999px; cursor:pointer; border:1px solid transparent;
}
.cookie-btn--ghost{ background:var(--fill); color:var(--ink-2); border-color:var(--line-2); }
.cookie-btn--ghost:hover{ background:var(--line); }
.cookie-btn--solid{ background:var(--brand); color:#fff; }
.cookie-btn--solid:hover{ background:var(--brand-700); }
@media (max-width:480px){
  .cookie-banner__actions{ justify-content:stretch; }
  .cookie-btn{ flex:1 1 auto; text-align:center; }
}

/* --- Pagine testuali (legali / chi siamo / contatti) -------------------- */
.prose{
  max-width:var(--wrap-narrow); margin:0 auto; padding:8px 0 8px;
}
.prose h2{
  font-family:var(--f-display); font-size:1.35rem; color:var(--ink);
  margin:32px 0 12px; line-height:1.25;
}
.prose h3{
  font-family:var(--f-display); font-size:1.08rem; color:var(--ink-2);
  margin:22px 0 8px;
}
.prose p, .prose li{ font-size:1rem; line-height:1.7; color:var(--ink-2); }
.prose ul{ padding-left:1.2em; margin:10px 0; display:grid; gap:6px; }
.prose a{ color:var(--brand-700); text-decoration:underline; }
.prose .updated{
  font-size:.85rem; color:var(--muted); margin-top:4px;
}
.prose table{
  width:100%; border-collapse:collapse; margin:14px 0; font-size:.92rem;
}
.prose th, .prose td{
  text-align:left; padding:9px 12px; border:1px solid var(--line);
}
.prose th{ background:var(--fill); font-weight:600; color:var(--ink); }

/* --- Modulo contatti (statico, mailto) ---------------------------------- */
.contact-card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:22px; box-shadow:var(--shadow-soft);
  margin:18px 0;
}
.contact-card a{ color:var(--brand-700); font-weight:600; }

/* --- Pagina 404 ---------------------------------------------------------- */
.err404{ text-align:center; padding:48px 0 40px; max-width:var(--wrap-narrow); margin:0 auto; }
.err404__code{
  font-family:var(--f-display); font-weight:700; font-size:clamp(64px, 18vw, 132px);
  line-height:1; color:var(--brand); letter-spacing:-.02em;
}
.err404__title{ font-family:var(--f-display); font-size:1.5rem; margin:8px 0 10px; color:var(--ink); }
.err404__text{ color:var(--ink-2); font-size:1.02rem; line-height:1.6; margin-bottom:22px; }
.err404__links{ display:flex; flex-wrap:wrap; gap:12px; justify-content:center; }
.err404__links a{
  padding:11px 20px; border-radius:999px; font-weight:600; text-decoration:none;
  border:1px solid var(--line-2); color:var(--brand-700); background:var(--surface);
}
.err404__links a.is-primary{ background:var(--brand); color:#fff; border-color:var(--brand); }
.err404__links a:hover{ background:var(--brand-050); }
.err404__links a.is-primary:hover{ background:var(--brand-700); }

/* --- Colonna footer aggiuntiva (informazioni legali) -------------------- */
.footer-legal-links a[data-cookie-settings]{ cursor:pointer; }

/* --- Figure / immagini di contenuto ------------------------------------- */
.figure { margin: 26px 0; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper);
}
.figure figcaption {
  margin-top: 10px; font-size: .9rem; color: var(--muted);
  text-align: center; line-height: 1.45;
}

/* --- Voci / scenari d'uso (testimonianze statiche) ---------------------- */
.voices {
  display: grid; gap: 18px; margin-top: 26px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.voice {
  margin: 0; padding: 22px 22px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; display: flex; flex-direction: column; gap: 14px;
}
.voice blockquote {
  margin: 0; font-size: .98rem; line-height: 1.5; color: var(--ink);
  position: relative; padding-left: 16px;
}
.voice blockquote::before {
  content: "\201C"; position: absolute; left: -2px; top: -6px;
  font-family: var(--f-display); font-size: 1.8rem; color: var(--brand); line-height: 1;
}
.voice figcaption {
  font-size: .82rem; color: var(--muted); font-weight: 500;
  border-top: 1px solid var(--line); padding-top: 12px;
}

/* --- Informazioni derivate nel risultato ------------------------------- */
.receipt__insights {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: grid; gap: 8px;
}
.insight {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: .9rem;
}
.insight__k { color: var(--muted); }
.insight__v {
  font-family: var(--f-mono); font-weight: 600; color: var(--ink);
  white-space: nowrap;
}
.insight__check {
  margin: 6px 0 0; font-size: .88rem; color: var(--muted);
  font-family: var(--f-mono);
}
.insight__check b { color: var(--brand); }

/* --- Pulsante Calcola + feedback risultato ----------------------------- */
.calc__cta { margin: 16px 0 4px; }
.calc__go {
  display: block; width: 100%;
  padding: 15px 20px; min-height: 52px;
  font-family: var(--f-display); font-size: 1.05rem; font-weight: 600;
  color: #fff; background: var(--brand);
  border: none; border-radius: var(--r);
  cursor: pointer; letter-spacing: .01em;
  transition: background .15s ease, transform .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.calc__go:hover { background: var(--brand-700, #0a5a47); }
.calc__go:active { transform: translateY(1px); }
.calc__go:focus-visible { outline: 3px solid var(--iva); outline-offset: 2px; }

/* Evidenziazione del risultato dopo il calcolo (guida l'occhio, utile su mobile) */
@keyframes receiptFlash {
  0%   { box-shadow: 0 0 0 0 rgba(12,110,87,.0); }
  25%  { box-shadow: 0 0 0 4px rgba(12,110,87,.35); }
  100% { box-shadow: 0 0 0 0 rgba(12,110,87,.0); }
}
.receipt--flash { animation: receiptFlash 1s ease-out 1; }
@media (prefers-reduced-motion: reduce) {
  .receipt--flash { animation: none; }
}

/* ============================================================================
   FIX v3 — Menu selettore lingua (era privo di stile)
   Problema: .lang-switch__menu non aveva CSS -> restava nel flusso anche da
   chiuso (gonfiava lo scrollWidth) e da aperto era testo nudo sovrapposto,
   rompendo l'impaginazione su mobile. Qui lo rendiamo un dropdown a scheda
   nascosto di default e mostrato solo quando <details> è aperto.
   Blocco solo additivo: non modifica regole preesistenti.
   ========================================================================== */
.lang-switch { position: relative; list-style: none; }
.lang-switch > summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-body); font-size: .92rem; font-weight: 600;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap;
  list-style: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.lang-switch > summary:hover { background: var(--brand-050); border-color: var(--brand); color: var(--brand-700); }
.lang-switch > summary:focus-visible { outline: 3px solid var(--iva); outline-offset: 2px; }
/* nasconde il triangolino nativo di <details> su tutti i browser */
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::marker { content: ""; }

/* Menu: nascosto di default (chiave del fix), scheda flottante quando aperto */
.lang-switch__menu {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1200;
  min-width: 190px; max-width: min(260px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 6px; overflow: hidden;
}
.lang-switch[open] > .lang-switch__menu { display: block; }
.lang-switch__menu a {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-body); font-size: .92rem; font-weight: 500;
  color: var(--ink-2); text-decoration: none;
  padding: 9px 12px; border-radius: 9px; white-space: nowrap;
}
.lang-switch__menu a:hover { background: var(--brand-050); color: var(--brand-700); }
.lang-switch__menu a[aria-current="page"] { background: var(--brand-050); color: var(--brand-700); font-weight: 600; }

/* RTL: apri il menu ancorandolo a sinistra invece che a destra */
[dir="rtl"] .lang-switch__menu { right: auto; left: 0; }

/* Mobile: il menu resta ancorato al pulsante, con margine dallo schermo */
@media (max-width: 720px) {
  .lang-switch__menu { right: 0; max-width: calc(100vw - 24px); }
  [dir="rtl"] .lang-switch__menu { left: 0; right: auto; }
}
