@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  /* Colori del marchio dell'app: ogni capitolo è una parte dell'euro incassato. */
  --cream: #F7F8F4;
  --navy: #102D35;
  --teal: #0A766B;
  --mint: #DDF3E9;
  --sand: #E4E7E2;
  --paper: #FFFFFF;
  --ink: #102D35;
  --ink-soft: #3E5A61;

  --font: "Cabinet Grotesk", -apple-system, "Segoe UI", sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
  --step-giant: clamp(3rem, 1rem + 8vw, 9rem);

  --margin: clamp(20px, 3vw, 40px);
  --gap: 10px;
  --radius: 0;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 800ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: var(--step-body); line-height: 1.5; color: var(--ink); background: var(--cream); accent-color: var(--teal); }
h1, h2, h3, .contact { text-wrap: balance; }
p, li, figcaption { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; transition: opacity var(--t-hover) ease; }
a:hover { opacity: 0.75; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; margin: 0; }
p { margin: 0; }
.wrap { padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
figure { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.button { display: inline-flex; align-items: center; gap: 0.5em; padding: 16px 24px; background: var(--teal); color: var(--paper); font-weight: 500; text-decoration: none; border: 0; border-radius: var(--radius); font: inherit; font-weight: 500; cursor: pointer; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.button:hover { opacity: 1; background: #085E56; }
.button:active { transform: scale(0.97); }
.button.on-dark { background: var(--mint); color: var(--navy); }
.button.on-dark:hover { background: var(--paper); }

/* Navigazione */
.nav { display: flex; align-items: center; gap: 28px; padding: 28px var(--margin) 0; font-size: 15px; background: var(--cream); }
.nav .mark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; letter-spacing: -0.02em; }
.nav .mark img { width: 32px; height: 32px; }
.nav nav { margin-left: auto; }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav ul a { text-decoration: none; font-weight: 500; }

/* Hero: frammento dell'app su un palco a taglio */
.hero { position: relative; min-height: 100svh; background: var(--cream); overflow: hidden; }
.hero .copy { position: relative; z-index: 2; padding: 150px var(--margin) 0; max-width: 760px; }
.hero h1 { font-size: clamp(52px, 5.2vw, 80px); font-weight: 800; }
.hero .lead { margin-top: 24px; font-size: 18px; max-width: 40ch; }
.hero .button { margin-top: 28px; }
.stage { position: absolute; left: 33.333%; top: 42%; right: 0; bottom: 0; background: var(--teal); clip-path: polygon(0 72px, 72px 0, 100% 0, 100% 100%, 0 100%); }
.stage .ui { position: absolute; left: 56px; top: 56px; }

/* Frammenti di interfaccia dell'app */
.app { width: 620px; max-width: calc(100vw - 32px); background: var(--cream); padding: 22px; color: var(--navy); font-size: 15px; }
.app .card { background: var(--paper); padding: 20px; margin-top: 14px; }
.app .hero-card { background: var(--navy); color: var(--paper); padding: 22px; }
.app .label { font-size: 13px; font-weight: 500; color: #B0DFD2; }
.app .big { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.app .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.app .row b { font-weight: 800; }
.app .accent { background: var(--mint); padding: 18px 20px; margin-bottom: 14px; }
.app .accent .label { color: var(--teal); }
.app .accent .big { font-size: 28px; color: var(--navy); }
.app .muted { color: var(--ink-soft); }
.app .sep { height: 10px; }
.app .actions { display: flex; gap: 10px; margin-top: 14px; }
.app .actions span { flex: 1; text-align: center; padding: 14px; background: var(--teal); color: var(--paper); font-weight: 500; }
.app .actions span + span { background: #E4EFEB; color: var(--teal); }

/* Capitoli a colore pieno */
.chapter { position: relative; min-height: 92svh; padding-block: 96px; overflow: hidden; }
.chapter h2 { font-size: var(--step-head); }
.navy { background: var(--navy); color: var(--paper); }
.teal { background: var(--teal); color: var(--paper); }
.mint { background: var(--mint); color: var(--navy); }
.sand { background: var(--sand); color: var(--navy); }
.cream { background: var(--cream); color: var(--navy); }

/* Il controllo: incasso e aliquota */
.split { transition: background-color 500ms var(--ease-out); }
.split .intro { max-width: 34ch; }
.split h2 { font-size: clamp(32px, 4vw, 64px); max-width: 16ch; }
.split .intro p { margin-top: 18px; font-size: 17px; max-width: 46ch; }
.control { position: absolute; right: -6vw; bottom: -4vh; width: min(980px, 70vw); font-size: clamp(14px, 1.45vw, 22px); background: var(--cream); color: var(--navy); padding: 1.6em; }
.control .amount { font-size: 4.2em; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.control label { display: block; font-weight: 500; }
.control input[type=range] { width: 100%; margin: 1em 0 1.2em; accent-color: var(--teal); height: 2.2em; }
.control .rates { display: flex; gap: 0.5em; margin-bottom: 1.2em; }
.control .rates button { font: inherit; font-weight: 500; padding: 0.55em 0.9em; border: 0; background: #E4EFEB; color: var(--teal); cursor: pointer; transition: transform var(--t-press) var(--ease-out); }
.control .rates button[aria-pressed=true] { background: var(--teal); color: var(--paper); }
.control .rates button:active { transform: scale(0.96); }
.control .bar { display: flex; height: 1.6em; }
.control .bar span { display: block; transition: flex-grow 400ms var(--ease-out); }
.control .bar .b-tax { background: var(--navy); flex-grow: 117; }
.control .bar .b-inps { background: var(--teal); flex-grow: 203; }
.control .bar .b-left { background: var(--mint); flex-grow: 680; }
.control .legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1em; margin-top: 1em; }
.control .legend b { display: block; font-size: 1.6em; font-weight: 800; }
.control .note { margin-top: 1em; font-size: 0.75em; color: var(--ink-soft); }

/* Tre passi: riquadri che crescono */
.steps { padding-block: 120px; }
.steps .tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end; }
.steps .tile { overflow: hidden; }
.steps .tile img { width: 100%; height: 100%; object-fit: cover; }
.steps .t1 { grid-column: 1 / span 3; grid-row: 2; height: 30vh; }
.steps .t2 { grid-column: 4 / span 4; grid-row: 2; height: 44vh; }
.steps .t3 { grid-column: 8 / span 5; grid-row: 2; height: 60vh; }
.steps .head { grid-column: 1 / span 7; grid-row: 1 / span 2; align-self: start; }
.steps h2 { font-size: clamp(40px, 4vw, 56px); max-width: 12ch; }
.steps .cap { grid-row: 3; margin-top: 20px; align-self: start; }
.steps .c1 { grid-column: 1 / span 3; }
.steps .c2 { grid-column: 4 / span 4; }
.steps .c3 { grid-column: 8 / span 5; }
.steps h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.steps .cap p { margin-top: 6px; font-size: 16px; max-width: 38ch; }

/* Scadenze: il calendario dei versamenti */
.deadlines .lead { margin-top: 24px; max-width: 46ch; font-size: var(--step-lead); line-height: 1.35; }
.deadlines ol { list-style: none; margin: 64px 0 0; padding: 0; }
.deadlines li { display: grid; grid-template-columns: minmax(140px, 3fr) 6fr 3fr; gap: 24px; align-items: baseline; padding: 22px 0; }
.deadlines li + li { margin-top: 6px; }
.deadlines li:nth-child(odd) { background: rgba(255,255,255,0.06); }
.deadlines .date { font-size: clamp(28px, 3vw, 44px); font-weight: 800; letter-spacing: -0.03em; padding-left: 16px; }
.deadlines .what { font-size: 18px; }
.deadlines .amount { font-size: 22px; font-weight: 800; text-align: right; padding-right: 16px; font-variant-numeric: tabular-nums; }
.deadlines .foot { margin-top: 32px; max-width: 60ch; font-size: 16px; }

/* Prezzo */
.price h2 { font-size: clamp(48px, 8.5vw, 140px); line-height: 0.95; max-width: 14ch; }
.price .fig { background: var(--mint); color: var(--navy); padding: 0 0.15em; }
.price .base { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; margin-top: 64px; }
.price .base p { grid-column: 1 / span 6; font-size: 20px; max-width: 52ch; }
.price .base .cta { grid-column: 9 / span 4; justify-self: end; text-align: right; }
.price .base .cta a.alt { display: block; margin-top: 14px; font-size: 17px; }
.price .free { margin-top: 48px; max-width: 60ch; font-size: 17px; }

/* Dichiarazione con lo studio */
.studio-ch { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding: 0; min-height: 100svh; overflow: hidden; }
.studio-ch .photo { grid-column: 7 / span 6; position: relative; min-height: 60svh; overflow: hidden; }
.studio-ch .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.studio-ch .photo figcaption { position: absolute; left: 20px; bottom: 20px; right: 20px; background: var(--navy); color: var(--paper); padding: 10px 14px; font-size: 14px; max-width: 46ch; }
.studio-ch .text { grid-column: 1 / span 6; padding: 120px var(--margin); }
.studio-ch h2 { font-size: clamp(40px, 5vw, 76px); max-width: 12ch; }
.studio-ch .amount { font-size: clamp(64px, 9vw, 132px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-top: 32px; }
.studio-ch .sub { font-size: 18px; margin-top: 8px; }
.studio-ch ul { margin: 32px 0 0; padding: 0 0 0 1.1em; font-size: 18px; }
.studio-ch li + li { margin-top: 8px; }
.studio-ch .flow { margin-top: 28px; font-size: 17px; max-width: 52ch; }

/* Domande */
.faq { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding-block: 120px; min-height: auto; }
.faq .head { grid-column: 1 / span 4; }
.faq h2 { font-size: clamp(40px, 4vw, 60px); position: sticky; top: 96px; }
.faq .list { grid-column: 5 / span 8; }
.faq details { background: var(--paper); margin-bottom: 8px; transition: background-color var(--t-ui) ease; }
.faq details[open] { background: var(--teal); color: var(--paper); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 72px; padding: 18px 24px; font-size: 20px; font-weight: 500; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { position: relative; flex: none; width: 16px; height: 16px; }
.faq .plus::before, .faq .plus::after { content: ""; position: absolute; left: 0; top: 6.5px; width: 16px; height: 3px; background: currentColor; transition: transform var(--t-ui) var(--ease-out); }
.faq .plus::after { transform: rotate(90deg); }
.faq details[open] .plus::after { transform: rotate(0deg); }
.faq details p { padding: 0 24px 24px; font-size: 17px; max-width: 52ch; }

/* Chiusura: il contatto come titolo */
.close { min-height: 90svh; display: flex; flex-direction: column; padding: 40px var(--margin) 28px; }
.close .top { display: flex; gap: 32px; font-size: 15px; }
.close .top p { max-width: 34ch; }
.close .top a.up { margin-left: auto; }
.close .contact { margin-top: auto; font-size: clamp(36px, 7.2vw, 128px); font-weight: 800; letter-spacing: -0.04em; line-height: 0.95; text-decoration: none; display: block; overflow-wrap: anywhere; }
.close .meta { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 24px; margin-top: 40px; font-size: 14px; }
.close .meta .links a + a { margin-left: 16px; }
.close .meta .where { text-align: right; }
.close .credits a { text-decoration: underline; }

/* Pagine di testo (privacy, termini) */
.doc { max-width: 760px; padding: 64px var(--margin) 120px; }
.doc h1 { font-size: clamp(44px, 6vw, 80px); }
.doc .updated { margin-top: 16px; color: var(--ink-soft); }
.doc h2 { font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; margin-top: 48px; }
.doc p, .doc li { margin-top: 12px; }
.doc ul { padding-left: 1.2em; }

/* Movimento: miglioramento progressivo, solo se l'utente non chiede movimento ridotto */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .stage { animation: shutter 1.1s var(--ease-soft) both; }
  .stage .ui { animation: settle 1.1s var(--ease-soft) both; }

  /* Entrate legate allo scroll: decorative, quindi nessun fallback dove non sono supportate */
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .rise { animation: rise auto linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .rise.d1 { animation-range: entry 8% entry 78%; }
    .rise.d2 { animation-range: entry 16% entry 86%; }
    .rise.d3 { animation-range: entry 24% entry 94%; }
    .tile img { animation: settle-scale auto linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
    .studio-ch .photo img { animation: parallax auto linear both; animation-timeline: view(); animation-range: cover; }
  }
}
@keyframes rise { from { opacity: 0; translate: 0 24px; } }
@keyframes settle-scale { from { scale: 1.08; } }
@keyframes parallax { from { translate: 0 -4%; scale: 1.08; } to { translate: 0 4%; scale: 1.08; } }
@keyframes shutter { from { clip-path: polygon(0 72px, 72px 0, 72px 0, 72px 100%, 0 100%); } to { clip-path: polygon(0 72px, 72px 0, 100% 0, 100% 100%, 0 100%); } }
@keyframes settle { from { transform: scale(1.12); opacity: 0; } to { transform: none; opacity: 1; } }

/* Telefono */
@media (max-width: 760px) {
  .nav ul { display: none; }
  .hero { min-height: auto; }
  .hero .copy { padding-top: 48px; }
  .hero h1 { font-size: 10vw; }
  .hero .lead { font-size: 16px; }
  .stage { position: relative; left: auto; top: auto; margin-top: 40px; height: 520px; clip-path: polygon(0 72px, 72px 0, 100% 0, 100% 100%, 0 100%); }
  .stage .ui { left: 16px; top: 56px; }
  .app { width: 560px; max-width: none; }
  .chapter { min-height: 86svh; padding-block: 64px; }
  .split h2 { font-size: 26px; }
  .split .intro p { font-size: 16px; }
  .control { position: relative; right: auto; bottom: auto; width: calc(100% + 2 * var(--margin)); margin: 40px calc(-1 * var(--margin)) -64px; font-size: 15px; }
  .control .amount { font-size: 3.2em; }
  .steps .tiles { display: block; }
  .steps .tile { height: auto !important; margin-top: 28px; }
  .steps .t1 { aspect-ratio: 100 / 34; } .steps .t2 { aspect-ratio: 100 / 46; } .steps .t3 { aspect-ratio: 100 / 62; }
  .steps h2 { font-size: 30px; }
  .steps .cap { margin-top: 12px; }
  .deadlines li { grid-template-columns: 1fr; gap: 4px; padding: 16px; }
  .deadlines .date, .deadlines .amount { padding: 0; text-align: left; }
  .price h2 { font-size: 11vw; }
  .price .base { display: block; }
  .price .base .cta { text-align: left; margin-top: 24px; }
  .price .base .cta .button { width: 100%; justify-content: center; }
  .studio-ch { display: block; }
  .studio-ch .text { padding: 64px var(--margin); }
  .studio-ch .photo { min-height: 70vw; }
  .faq { display: block; padding-block: 64px; }
  .faq h2 { position: static; font-size: 9vw; margin-bottom: 24px; }
  .faq details { margin-bottom: 6px; }
  .faq summary { font-size: 18px; min-height: 64px; }
  .faq details p { font-size: 16px; padding: 0 20px 20px; }
  .close .top { flex-direction: column; gap: 12px; }
  .close .top a.up { margin-left: 0; }
  .close .contact { font-size: 7.2vw; }
  .close .meta { grid-template-columns: 1fr; gap: 8px; font-size: 13px; }
  .close .meta .where { text-align: left; }
}
