@font-face { font-family: "Source Sans"; src: url(fonts/sourcesans3.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Source Serif"; src: url(fonts/sourceserif4.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --ink: #1E2B27;
  --slate: #55625E;
  --line: #D6DEDA;
  --mist: #F1F5F3;
  --paper: #FFFFFF;
  --sage: #DCEEE3;
  --sage-mid: #A9D1BA;
  --leaf: #2E6E50;
  --leaf-dark: #23573F;
  --serif: "Source Serif", Georgia, "Times New Roman", serif;
  --sans: "Source Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--leaf); text-underline-offset: 3px; }
a:hover { color: var(--leaf-dark); }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.1; }
h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }

/* Barra istituzionale */
.notice { background: var(--ink); color: #E3EBE7; font-size: .875rem; padding: 7px 0; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { white-space: nowrap; font-family: var(--serif); font-size: 1.3rem; font-weight: 500; margin: 0; color: var(--ink); }
.brand-name b { font-weight: 700; color: var(--leaf); }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-size: 1rem; }
.nav a:hover { color: var(--leaf); text-decoration: underline; }

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 24px;
  background: var(--leaf); color: #fff; border: 2px solid var(--leaf); border-radius: var(--r-sm);
  font: 700 1.05rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--leaf-dark); border-color: var(--leaf-dark); color: #fff; }
.btn-small { gap: 0; min-height: 44px; padding: 8px 18px; font-size: .95rem; }
.btn-ghost { background: transparent; color: var(--leaf); }
.btn-ghost:hover { background: var(--sage); color: var(--leaf-dark); }
.btn-light { background: #fff; color: var(--leaf-dark); border-color: #fff; }
.btn-light:hover { background: var(--sage); border-color: var(--sage); color: var(--leaf-dark); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.ico { width: 20px; height: 20px; fill: currentColor; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }

/* Hero */
.hero { padding: 64px 0 72px; background: linear-gradient(180deg, var(--mist) 0%, var(--paper) 100%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.lead { font-size: 1.2rem; color: var(--slate); max-width: 34em; }
.assurances { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.assurances li { padding-left: 30px; position: relative; }
.assurances li::before {
  content: ""; position: absolute; left: 0; top: .3em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6' fill='none' stroke='%232E6E50' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.hero-visual { position: relative; padding-bottom: 64px; }
.hero-visual > img { border-radius: var(--r-lg); aspect-ratio: 4 / 3.4; object-fit: cover; width: 100%; }

/* Il fascicolo: l'elemento distintivo */
.pratica {
  position: absolute; left: -36px; bottom: 0; width: min(360px, 92%);
  background: var(--paper); border: 1px solid var(--line); border-top: 5px solid var(--leaf);
  border-radius: var(--r-md); padding: 18px 20px 14px;
  box-shadow: 0 18px 40px -18px rgba(30, 43, 39, .35);
}
.pratica-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.pratica-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.pratica-id { font-size: .8rem; color: var(--slate); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; }
.pratica-steps { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.pratica-steps li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); }
.pratica-steps li:first-child { border-top: 0; }
.pratica-steps em { margin-left: auto; font-style: normal; font-size: .8rem; color: var(--leaf-dark); background: var(--sage); border-radius: 99px; padding: 1px 9px; }
.tick { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line); position: relative; }
.done .tick { background: var(--leaf); border-color: var(--leaf); }
.done .tick::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/90% no-repeat;
}
.now .tick { border-color: var(--leaf); border-style: dashed; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Unico momento animato: i passaggi della pratica si spuntano uno dopo l'altro */
.js .pratica-steps li { opacity: .35; transition: opacity .4s ease; }
.js .pratica-steps li.on { opacity: 1; }
.js .pratica-steps li .tick { transition: background-color .3s, border-color .3s; }
.js .pratica-steps li.done:not(.on) .tick { background: transparent; border-color: var(--line); }
.js .pratica-steps li.done:not(.on) .tick::after { opacity: 0; }

/* Sezioni */
.section { padding: 88px 0; }
.band { padding: 80px 0; background: var(--mist); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lead { color: var(--slate); font-size: 1.2rem; margin-bottom: 40px; }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 36px; }
.fact-ico { width: 40px; height: 40px; fill: none; stroke: var(--leaf); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px; }
.fact p { color: var(--slate); }

/* Passaggi: sequenza reale, quindi numerati */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.steps li { counter-increment: s; position: relative; padding-top: 64px; }
.steps li::before {
  content: counter(s); position: absolute; top: 0; left: 0;
  width: 46px; height: 46px; border-radius: 50%; background: var(--sage); color: var(--leaf-dark);
  font: 600 1.35rem/46px var(--serif); text-align: center;
}
.steps li::after { content: ""; position: absolute; top: 23px; left: 58px; right: -16px; height: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps p { color: var(--slate); font-size: 1.02rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.split-col { padding: 32px 36px; }
.split-you { background: var(--paper); }
.split-we { background: var(--sage); }
.split-time { color: var(--slate); margin-top: -.3em; }
.split-we .split-time { color: var(--leaf-dark); }

.list { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.list li { padding-left: 28px; position: relative; }
.list li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: var(--sage-mid); }
.split-we .list li::before { background: var(--leaf); }

/* Canali */
.canali-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.canali-img { border-radius: var(--r-lg); }
.note { color: var(--slate); font-size: 1rem; border-left: 3px solid var(--sage-mid); padding-left: 14px; }

/* Test */
.test-wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: start; }
.test-intro p { color: var(--slate); }
.test { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.test fieldset { border: 0; padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.test legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.test input[type="date"] {
  font: inherit; color: var(--ink); padding: 10px 12px; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--paper);
}
.help { font-size: .9rem; color: var(--slate); margin: 6px 0 0; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 18px; min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
}
.choices label:hover { border-color: var(--sage-mid); }
.choices input { accent-color: var(--leaf); width: 18px; height: 18px; margin: 0; }
.choices label:has(input:checked) { border-color: var(--leaf); background: var(--sage); }
.form-error { color: #9B2C2C; margin: 14px 0 0; font-size: 1rem; }

.result { grid-column: 2; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--leaf); border-radius: var(--r-md); padding: 26px 28px; }
.result:focus { outline: none; }
.result h3 { margin-bottom: .4em; }
.result .deadline { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--leaf-dark); margin: .2em 0 .6em; }
.result.warn { border-left-color: #B7791F; }
.result.warn .deadline { color: #8A5A12; }
.result .cta-row { margin: 18px 0 0; }
.result-reset { background: none; border: 0; color: var(--leaf); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; margin-top: 14px; }

/* Prezzo */
.price-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.price-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 36px; }
.price { margin: 8px 0 6px; }
.price-num { font-family: var(--serif); font-size: 3.4rem; font-weight: 600; line-height: 1; color: var(--leaf-dark); }
.price-tax { color: var(--slate); font-size: 1rem; }
.price-sub { color: var(--slate); }
.price-other { font-size: .98rem; color: var(--slate); margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.price-side h3 { margin-top: 8px; }
.compare { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.compare th, .compare td { padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.compare td { text-align: right; font-variant-numeric: tabular-nums; }
.compare tr.us th, .compare tr.us td { font-weight: 700; color: var(--leaf-dark); }
.small { font-size: .92rem; color: var(--slate); }
.price-side .small { margin-bottom: 32px; }

/* Guide in home */
.home-guides { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.home-guides a { display: block; height: 100%; background: var(--mist); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px 22px; text-decoration: none; color: var(--ink); }
.home-guides a:hover { border-color: var(--sage-mid); }
.home-guides a:hover strong { text-decoration: underline; }
.home-guides strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--leaf-dark); margin-bottom: 4px; }
.home-guides span { color: var(--slate); font-size: 1rem; }
@media (max-width: 720px) { .home-guides { grid-template-columns: 1fr; } }

/* FAQ */
.faq-wrap { max-width: 820px; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); margin-top: 28px; }
summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-weight: 700; font-size: 1.12rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.5px solid var(--leaf); border-bottom: 2.5px solid var(--leaf); transform: rotate(45deg);
  transition: transform .2s;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details p { color: var(--slate); padding-right: 40px; }

/* Chiusura */
.closing { background: var(--leaf); color: #fff; padding: 64px 0; }
.closing-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.closing h2 { margin: 0; color: #fff; }
.closing .cta-row { margin: 0; }

/* Footer */
.site-footer { background: var(--ink); color: #C9D4CF; padding: 40px 0; }
.site-footer .brand-name { color: #fff; margin-bottom: 8px; }
.site-footer .brand-name b { color: var(--sage-mid); }
.site-footer .small { color: #C9D4CF; }
.site-footer a { color: #fff; margin-right: 18px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .canali-grid, .test-wrap, .price-grid { grid-template-columns: 1fr; gap: 40px; }
  .result { grid-column: 1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li::after { display: none; }
  .pratica { left: 16px; }
  .hero-visual { max-width: 600px; }
}
@media (max-width: 720px) {
  body { font-size: 1.0625rem; }
  .nav { display: none; }
  .header-row { justify-content: space-between; min-height: 64px; }
  .brand-name { font-size: 1.15rem; }
  .hero { padding: 40px 0 52px; }
  .section { padding: 64px 0; }
  .band { padding: 60px 0; }
  .three, .steps, .split, .footer-grid { grid-template-columns: 1fr; }
  .three { gap: 28px; }
  .split-col { padding: 26px 22px; }
  .pratica { position: relative; left: auto; bottom: auto; width: 100%; margin-top: -40px; }
  .hero-visual { padding-bottom: 0; }
  .hero-visual > img { margin: 0 0 0; }
  .pratica { width: calc(100% - 24px); margin-left: 12px; }
  .test, .price-card { padding: 22px; }
  .cta-row .btn { width: 100%; }
  .closing-grid { flex-direction: column; align-items: stretch; }
}
@media (max-width: 420px) {
  .hide-sm { display: none; }
  .btn-small { padding: 8px 12px; font-size: .9rem; }
  .brand-mark { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
