/* Ideal Consulting — idealconsulting.cloud
   Archivo = la nostra voce. Newsreader = la voce di chi scrive a te (email, documenti, citazioni). */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-var.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic-var.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --carta: #F1F3F6;
  --foglio: #FBFCFD;
  --inchiostro: #16213A;
  --grafite: #56637A;
  --rigo: #D3DAE5;
  --verde: #50AC4D;
  --verde-testo: #2F7A2D;
  --verde-chiaro: #DDEFDC;
  --ambra: #B86E00;
  --ambra-chiaro: #FBEBD3;
  --rosso: #C2412D;
  --notte-testo: #E6EAF1;
  --notte-muto: #9AA6BA;
  --notte-rigo: #2A3753;

  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --header: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Transizioni tra pagine (Chrome, Edge, Safari recenti; altrove navigazione normale) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-24px); } }
@keyframes vt-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
.site-header { view-transition-name: header; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body {
  margin: 0; background: var(--carta); color: var(--inchiostro);
  font-family: var(--sans); font-size: 17px; line-height: 1.55; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 3px; border-radius: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--inchiostro); color: var(--carta); padding: 10px 16px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Tipografia di sezione ---------- */
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 24px; margin-bottom: clamp(32px, 6vh, 64px); }
.section-head h2 { grid-column: 1 / span 7; }
.section-head p { grid-column: 8 / span 5; align-self: end; color: var(--grafite); }
h2 { font-size: clamp(2rem, 4.4vw, 3.8rem); line-height: 1; font-weight: 650; letter-spacing: -0.028em; font-stretch: 110%; text-wrap: balance; }
.link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--verde); text-decoration-thickness: 2px; text-underline-offset: 5px; transition: font-stretch .35s var(--ease); }
.link:hover { font-stretch: 114%; }
@media (max-width: 820px) { .section-head h2, .section-head p { grid-column: 1 / -1; } }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: font-stretch .35s var(--ease), background-color .3s ease, color .3s ease, transform .2s ease;
}
.btn:hover { font-stretch: 114%; }
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--inchiostro); color: var(--carta); }
.btn-line { box-shadow: inset 0 0 0 1.5px var(--inchiostro); background: transparent; }
.btn-line:hover { background: var(--inchiostro); color: var(--carta); }
.btn-light { background: var(--carta); color: var(--inchiostro); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 60; height: var(--header);
  background: color-mix(in srgb, var(--carta) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  transition: transform .45s var(--ease), box-shadow .3s ease;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--rigo); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { width: 128px; flex: none; }
.nav { display: flex; gap: clamp(14px, 2vw, 28px); margin-left: auto; font-size: 15px; font-weight: 500; }
.nav a { text-decoration: none; transition: font-stretch .35s var(--ease); position: relative; }
.nav a:hover { font-stretch: 116%; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--verde); }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: clamp(8px, 2vw, 28px); }
.team { position: relative; }
.team-btn { all: unset; cursor: pointer; font-size: 14px; color: var(--grafite); padding: 8px 4px; }
.team-btn:hover { color: var(--inchiostro); }
.team-btn:focus-visible { outline: 2px solid var(--verde); }
.team-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; padding: 8px;
  background: var(--foglio); border: 1px solid var(--rigo); border-radius: 14px;
  box-shadow: 0 20px 40px -20px rgba(22, 33, 58, .35);
}
.team-menu a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; font-weight: 600; }
.team-menu a span { display: block; font-weight: 400; font-size: 14px; color: var(--grafite); }
.team-menu a:hover { background: var(--carta); }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: none; position: relative; cursor: pointer; }
.menu-btn span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--inchiostro); transition: transform .4s var(--ease); }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.menu-mobile {
  position: fixed; inset: var(--header) 0 0; z-index: 55; background: var(--carta);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.menu-mobile nav { display: grid; gap: 4px; }
.menu-mobile nav a { font-size: clamp(2rem, 9vw, 3rem); font-weight: 650; letter-spacing: -0.03em; text-decoration: none; line-height: 1.15; }
.menu-mobile-foot { display: grid; gap: 16px; color: var(--grafite); font-size: 15px; }

@media (max-width: 1080px) {
  .nav, .team, .header-actions > .btn { display: none; }
  .menu-btn { display: block; }
  .header-actions { margin-left: auto; }
}

/* ---------- Hero ---------- */
.hero { position: relative; display: flex; flex-direction: column; padding-top: calc(var(--header) + clamp(24px, 6vh, 72px)); overflow: hidden; }
.hero-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; position: relative; z-index: 2; pointer-events: none; }
.hero-top a, .hero-top button { pointer-events: auto; }
.hero-title {
  grid-column: 1 / span 8;
  font-size: clamp(2.7rem, 6.6vw, 7.2rem); line-height: .92; font-weight: 700; letter-spacing: -0.04em; font-stretch: 100%;
  text-wrap: balance;
}
h1 .w, .mp-testo .w { display: inline-block; white-space: nowrap; }
h1 .c, .mp-testo .c { display: inline-block; font-stretch: calc(var(--w, 100) * 1%); }
/* Evita il lampo del titolo prima dell'animazione; se lo script non parte, il titolo compare comunque. */
.js-anim .hero-title, .js-anim .page-hero h1, .js-anim .quiz-intro h1 { visibility: hidden; animation: mostra-titolo 0s 2.5s forwards; }
.js-anim h1.is-split { visibility: visible; animation: none; }
@keyframes mostra-titolo { to { visibility: visible; } }
.hero-dot { display: inline-block; width: .19em; height: .19em; margin-left: .04em; border-radius: 50%; background: var(--verde); }
.hero-side { grid-column: 9 / span 4; align-self: end; display: grid; gap: 24px; }
.hero-lede { font-size: clamp(17px, 1.35vw, 19px); color: var(--grafite); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pile { position: relative; height: clamp(150px, 20vh, 210px); width: 100%; max-width: var(--max); margin: clamp(40px, 8vh, 96px) auto 0; padding-inline: var(--gutter); }
.pile-done { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.pile-done[hidden] { display: none; }
.pd {
  display: inline-flex; align-items: center; gap: .9em; white-space: nowrap;
  padding: .85em 1.4em; border-radius: 999px; background: var(--inchiostro); color: var(--carta);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace; font-size: clamp(14px, 1.35vw, 19px);
  letter-spacing: .02em; box-shadow: 0 18px 40px -18px rgba(22, 33, 58, .55);
}
.pd-dot { width: .6em; height: .6em; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 0 rgba(80, 172, 77, .6); animation: pd-pulse 1.8s ease-out infinite; }
.pd-agente { color: var(--notte-muto); text-transform: uppercase; font-size: .78em; letter-spacing: .12em; }
.pd-testo { min-width: 16ch; }
.pd-testo::after { content: "_"; margin-left: .1em; color: var(--verde); animation: pd-cursore 1s steps(1) infinite; }
.pd-conta { color: var(--verde); font-weight: 600; padding-left: .9em; border-left: 1px solid var(--notte-rigo); }
@keyframes pd-pulse { to { box-shadow: 0 0 0 .7em rgba(80, 172, 77, 0); } }
@keyframes pd-cursore { 50% { opacity: 0; } }
/* Le attività in fila, ordinate: all'avvio convergono nel punto verde del titolo. */
.pile-tags { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 10px 12px; height: 100%; max-width: 900px; margin: 0 auto; }
.pile-tags li {
  white-space: nowrap; padding: .55em 1.1em; border-radius: 999px;
  font-size: clamp(14px, 1.05vw, 16px); font-weight: 500; color: var(--grafite);
  background: var(--foglio); box-shadow: inset 0 0 0 1px var(--rigo);
}
.pile-tags li.t-ink { background: var(--inchiostro); color: var(--carta); box-shadow: none; }
.pile-tags li.t-green { background: var(--verde); color: var(--inchiostro); box-shadow: none; }
.js-anim .pile-tags li { opacity: 0; }
.js-anim .pile.is-static .pile-tags li { opacity: 1; }

@media (max-width: 960px) {
  .hero-title { grid-column: 1 / -1; font-size: clamp(2.5rem, 10.5vw, 4.6rem); }
  .hero-side { grid-column: 1 / -1; }
  .pile { min-height: 170px; }
  .hero { height: auto; }
  .pile { height: auto; min-height: 150px; margin-top: 32px; }
  .pile-tags { gap: 8px; }
  .pd { font-size: 13px; gap: .7em; padding: .8em 1.1em; }
  .pd-conta { padding-left: .7em; }
}
@media (hover: none) { .pile-hint { display: none; } }

/* ---------- Manifesto ---------- */
.manifesto { padding-block: clamp(64px, 12vh, 140px) clamp(96px, 18vh, 200px); }
.manifesto-text { font-size: clamp(1.7rem, 3.9vw, 3.5rem); line-height: 1.12; font-weight: 600; letter-spacing: -0.025em; max-width: 22ch; max-width: min(100%, 26ch); text-wrap: pretty; }
.manifesto-text .mw { opacity: var(--o, 1); transition: opacity .2s linear; }
.manifesto-text .hl, .chi-teaser .hl { font-weight: 800; color: var(--verde-testo); }
.manifesto-text .hl-rosso { color: var(--rosso); }
.manifesto-punch { margin-top: clamp(56px, 11vh, 128px); text-align: center; font-size: clamp(2.6rem, 7.4vw, 7rem); line-height: .95; font-weight: 800; letter-spacing: -0.04em; color: var(--inchiostro); }
.mp-dot { display: inline-block; width: .19em; height: .19em; margin-left: .04em; border-radius: 50%; background: var(--verde); }
.mp-testo.is-split .c, .mp-testo.is-split + .mp-dot { opacity: 0; }

/* ---------- Demo agente ---------- */
.demo { padding-block: clamp(64px, 10vh, 120px); }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.demo-tabs button {
  border: 0; cursor: pointer; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 16px;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--rigo); transition: background-color .3s, color .3s, box-shadow .3s, font-stretch .35s var(--ease);
}
.demo-tabs button:hover { box-shadow: inset 0 0 0 1.5px var(--inchiostro); }
.demo-tabs button[aria-selected="true"] { background: var(--inchiostro); color: var(--carta); box-shadow: none; font-stretch: 112%; }

.scenario { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 4fr); gap: clamp(16px, 2.4vw, 40px); align-items: start; }
.sc-label { font-size: 14px; color: var(--grafite); margin-bottom: 10px; }
.mail { background: var(--foglio); border: 1px solid var(--rigo); border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 48px -36px rgba(22, 33, 58, .4); }
.mail-meta { display: flex; flex-direction: column; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rigo); }
.mail-meta span { color: var(--grafite); font-size: 15px; }
.mail-body { font-family: var(--serif); font-size: 19px; line-height: 1.5; font-variation-settings: "opsz" 18; }
.fattura table { width: 100%; border-collapse: collapse; font-family: var(--serif); font-size: 16px; font-variant-numeric: tabular-nums; }
.fattura td { padding: 5px 0; vertical-align: top; }
.fattura td:not(:first-child) { text-align: right; white-space: nowrap; padding-left: 10px; }
.fattura tr.tot td { border-top: 1px solid var(--rigo); font-weight: 600; }
.fattura .hl { background: var(--ambra-chiaro); box-shadow: 0 0 0 3px var(--ambra-chiaro); border-radius: 2px; }

.sc-steps { position: relative; display: grid; gap: 22px; padding: 30px 0 0 34px; }
.sc-steps::before { content: ""; position: absolute; left: 7px; top: 36px; bottom: 8px; width: 2px; background: var(--rigo); }
.sc-steps .track { position: absolute; left: 7px; top: 36px; width: 2px; height: 0; background: var(--verde); }
.sc-steps .agent { position: absolute; left: 0; top: 30px; width: 16px; height: 16px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 6px rgba(80, 172, 77, .18); }
.sc-steps li { display: grid; gap: 4px; }
.sc-steps strong { font-size: 18px; font-stretch: 108%; }
.sc-steps span { color: var(--grafite); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chips em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--inchiostro); background: var(--verde-chiaro); padding: 3px 10px; border-radius: 999px; }
.chips em.warn { background: var(--ambra-chiaro); color: #7A4900; }

.sc-out { display: grid; gap: 10px; }
.out-card { background: var(--foglio); border: 1px solid var(--rigo); border-radius: 14px; padding: 14px 16px; }
.out-title { font-size: 13px; font-weight: 600; color: var(--verde-testo); margin-bottom: 4px; }
.out-serif { font-family: var(--serif); font-size: 17px; line-height: 1.45; }
.out-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.out-row p:last-child { font-size: 15px; }
.out-alert { background: var(--ambra-chiaro); border-color: #F0D3A6; }
.out-alert .out-title { color: #7A4900; }
.approva { justify-self: start; margin-top: 6px; }
.approva.is-done { background: var(--verde); color: var(--inchiostro); pointer-events: none; }
.approva.is-done::before { content: ""; width: 14px; height: 8px; margin-right: 10px; border: solid currentColor; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }
.demo-note { margin-top: 32px; font-size: 14px; color: var(--grafite); }
.demo-replay { border: 0; background: none; padding: 0; margin-left: 8px; cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--verde); text-underline-offset: 3px; }

@media (max-width: 960px) {
  .scenario { grid-template-columns: 1fr; }
  .sc-steps { padding-top: 8px; }
  .sc-steps::before { top: 14px; }
  .sc-steps .track { top: 14px; }
  .sc-steps .agent { top: 8px; }
  .demo-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .demo-tabs button { flex: none; }
}
@media (max-width: 520px) { .out-row { grid-template-columns: 1fr; } }

/* ---------- Metodo (scorrimento orizzontale su desktop) ---------- */
.metodo { background: var(--foglio); border-block: 1px solid var(--rigo); overflow: hidden; }
.metodo-track { display: flex; }
.metodo-panel {
  flex: none; width: 100vw; min-height: 100vh; display: grid; align-content: center; gap: clamp(24px, 5vh, 48px);
  padding: calc(var(--header) + 24px) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 48px;
}
.metodo-verb {
  font-size: clamp(3.6rem, 11.5vw, 12rem); line-height: .85; font-weight: 800; letter-spacing: -0.05em;
  font-stretch: calc(var(--w, 100) * 1%);
}
.metodo-verb .dot { display: inline-block; width: .16em; height: .16em; border-radius: 50%; background: var(--verde); margin-left: .03em; }
.metodo-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 24px; }
.metodo-body h3 { grid-column: 1 / span 5; font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 650; font-stretch: 108%; line-height: 1.1; }
.metodo-body p { grid-column: 6 / span 5; font-size: 18px; color: var(--grafite); }
.metodo-body .link { grid-column: 6 / span 5; justify-self: start; }
@media (max-width: 960px) {
  .metodo-track { flex-direction: column; }
  .metodo-panel { width: auto; min-height: 0; padding-block: 72px; border-bottom: 1px solid var(--rigo); }
  .metodo-body h3, .metodo-body p, .metodo-body .link { grid-column: 1 / -1; }
}

/* ---------- Formazione (home) ---------- */
.formazione-home { background: var(--inchiostro); color: var(--notte-testo); padding-block: clamp(96px, 16vh, 160px); }
.formazione-home .section-head p { color: var(--notte-muto); }
.formati { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.formati li { border-top: 2px solid var(--verde); padding-top: 18px; }
.formati h3 { font-size: 22px; font-weight: 650; font-stretch: 110%; margin-bottom: 8px; }
.formati p { color: var(--notte-muto); }
.formazione-nota { margin: clamp(40px, 7vh, 64px) 0 28px; max-width: 46rem; font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--notte-testo); }
@media (max-width: 960px) { .formati { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .formati { grid-template-columns: 1fr; } }

/* ---------- Teaser test ---------- */
.test-teaser { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding-block: clamp(96px, 16vh, 180px); align-items: start; }
.teaser-copy { grid-column: 1 / span 5; display: grid; gap: 20px; }
.teaser-copy p { color: var(--grafite); font-size: 18px; }
.teaser-q { grid-column: 7 / span 6; background: var(--foglio); border: 1px solid var(--rigo); border-radius: 24px; padding: clamp(24px, 3vw, 40px); box-shadow: 0 40px 80px -50px rgba(22, 33, 58, .45); }
.teaser-n { font-size: 14px; color: var(--grafite); }
.teaser-domanda { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 600; line-height: 1.2; margin: 10px 0 22px; font-stretch: 104%; }
.teaser-opzioni { display: grid; gap: 8px; }
.teaser-opzioni button, .opzione {
  text-align: left; border: 0; cursor: pointer; padding: 16px 18px; border-radius: 14px; font-size: 17px; font-weight: 500;
  background: var(--carta); transition: background-color .25s, color .25s, transform .25s var(--ease), font-stretch .3s var(--ease);
}
.teaser-opzioni button:hover, .opzione:hover { background: var(--inchiostro); color: var(--carta); transform: translateX(6px); font-stretch: 108%; }
@media (max-width: 960px) { .teaser-copy, .teaser-q { grid-column: 1 / -1; } }

/* ---------- Teaser chi sono ---------- */
.chi-teaser { padding-block: clamp(48px, 8vh, 96px) clamp(96px, 14vh, 160px); }
.chi-teaser blockquote p { font-family: var(--serif); font-size: clamp(1.8rem, 3.8vw, 3.4rem); line-height: 1.15; font-weight: 400; letter-spacing: -0.01em; max-width: 24ch; font-variation-settings: "opsz" 60; text-wrap: pretty; }
.chi-firma { margin-top: 28px; color: var(--grafite); }
.chi-firma strong { color: var(--inchiostro); }
.chi-firma .link { margin-left: 8px; color: var(--inchiostro); }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding-block: clamp(64px, 10vh, 120px); border-top: 1px solid var(--rigo); }
.faq > h2 { grid-column: 1 / span 4; }
.faq-list { grid-column: 6 / span 7; border-top: 1.5px solid var(--inchiostro); }
.faq-item { border-bottom: 1px solid var(--rigo); }
.faq-item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center;
  padding: 22px 0; font-size: clamp(18px, 1.5vw, 21px); font-weight: 600;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; flex: none; width: 12px; height: 12px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-3px, -3px); transition: transform .4s var(--ease); }
.faq-item[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq-a { overflow: hidden; }
.faq-a p { padding-bottom: 22px; color: var(--grafite); max-width: 60ch; }
@media (max-width: 960px) { .faq > h2, .faq-list { grid-column: 1 / -1; } }

/* ---------- Pagine interne ---------- */
.page-hero { padding: calc(var(--header) + clamp(48px, 12vh, 140px)) 0 clamp(48px, 8vh, 96px); }
.page-hero .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.page-hero h1 { grid-column: 1 / span 9; font-size: clamp(2.6rem, 6.4vw, 6.4rem); line-height: .94; font-weight: 700; letter-spacing: -0.04em; text-wrap: balance; }
.page-hero .lede { grid-column: 1 / span 6; font-size: clamp(18px, 1.5vw, 21px); color: var(--grafite); }
.page-hero .hero-actions { grid-column: 1 / -1; }
@media (max-width: 960px) { .page-hero h1, .page-hero .lede { grid-column: 1 / -1; } }

.blocco { padding-block: clamp(64px, 11vh, 128px); border-top: 1px solid var(--rigo); }
.blocco-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.blocco-grid > h2 { grid-column: 1 / span 5; align-self: start; position: sticky; top: calc(var(--header) + 32px); }
.blocco-grid > .blocco-body { grid-column: 7 / span 6; display: grid; gap: 1.1em; font-size: 18px; }
.blocco-body h3 { font-size: 22px; font-weight: 650; font-stretch: 108%; margin-top: .6em; }
.blocco-body p, .blocco-body li { color: var(--grafite); }
.blocco-body strong { color: var(--inchiostro); }
.elenco { display: grid; gap: 0; border-top: 1.5px solid var(--inchiostro); }
.elenco li { padding: 16px 0 16px 28px; border-bottom: 1px solid var(--rigo); position: relative; }
.elenco li::before { content: ""; position: absolute; left: 4px; top: 25px; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); }
.elenco li strong { display: block; font-size: 19px; }
.fasi { counter-reset: fase; display: grid; gap: 0; border-top: 1.5px solid var(--inchiostro); }
.fasi li { counter-increment: fase; display: grid; grid-template-columns: 72px 1fr; gap: 4px 16px; padding: 20px 0; border-bottom: 1px solid var(--rigo); }
.fasi li::before { content: counter(fase); grid-row: span 2; font-size: 40px; line-height: 1; font-weight: 750; font-stretch: 125%; color: var(--verde-testo); }
.fasi li strong { font-size: 19px; color: var(--inchiostro); }
@media (max-width: 960px) {
  .blocco-grid > h2 { grid-column: 1 / -1; position: static; }
  .blocco-grid > .blocco-body { grid-column: 1 / -1; }
}

.agenti-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; border-top: 1.5px solid var(--inchiostro); }
.agenti-grid li { padding: 22px 0; border-bottom: 1px solid var(--rigo); }
.agenti-grid h3 { font-size: 21px; font-weight: 650; font-stretch: 108%; margin-bottom: 6px; }
.agenti-grid p { color: var(--grafite); }
@media (max-width: 720px) { .agenti-grid { grid-template-columns: 1fr; } }

.cta-band { background: var(--inchiostro); color: var(--notte-testo); padding-block: clamp(72px, 12vh, 128px); }
.cta-band .wrap { display: grid; gap: 24px; justify-items: start; }
.cta-band h2 { max-width: 20ch; }
.cta-band p { color: var(--notte-muto); max-width: 44rem; font-size: 18px; }

/* Chi sono */
.bio { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding-block: 0 clamp(64px, 11vh, 128px); }
.bio-foto { grid-column: 1 / span 4; position: relative; }
.bio-foto img, .bio-iniziali { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; }
.bio-iniziali { display: grid; place-items: center; background: var(--inchiostro); color: var(--carta); font-size: clamp(4rem, 10vw, 8rem); font-weight: 800; font-stretch: 125%; letter-spacing: -0.04em; }
.bio-iniziali i { display: inline-block; width: .16em; height: .16em; margin-left: .04em; border-radius: 50%; background: var(--verde); }
.bio-foto figcaption { margin-top: 12px; font-size: 13px; color: var(--grafite); letter-spacing: .01em; }
.bio-testo { grid-column: 6 / span 7; display: grid; gap: 1.1em; font-size: 19px; }
.bio-testo p { color: var(--grafite); }
.bio-testo p:first-child { font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.3; color: var(--inchiostro); font-variation-settings: "opsz" 36; }
@media (max-width: 960px) { .bio-foto { grid-column: 1 / span 8; max-width: 360px; } .bio-testo { grid-column: 1 / -1; } }

/* Privacy */
.testo-legale { max-width: 70ch; display: grid; gap: 1em; padding-bottom: 96px; }
.testo-legale h2 { font-size: 24px; font-stretch: 105%; margin-top: 1.2em; letter-spacing: -0.01em; }
.testo-legale p, .testo-legale li { color: var(--grafite); }
.testo-legale ul { list-style: disc; padding-left: 1.2em; }

/* ---------- Test AI ---------- */
.quiz { min-height: 100svh; padding: calc(var(--header) + clamp(24px, 6vh, 64px)) 0 64px; }
.quiz .wrap { max-width: 980px; }
.quiz-intro h1 { font-size: clamp(2.4rem, 6vw, 5.4rem); line-height: .95; font-weight: 700; letter-spacing: -0.04em; text-wrap: balance; }
.quiz-intro p { margin: 24px 0 32px; font-size: 19px; color: var(--grafite); max-width: 40rem; }
.quiz-bar { height: 4px; background: var(--rigo); border-radius: 4px; overflow: hidden; margin-bottom: 32px; }
.quiz-bar span { display: block; height: 100%; width: 0; background: var(--verde); transition: width .6s var(--ease); }
.quiz-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; color: var(--grafite); font-size: 15px; }
.quiz-back { border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--inchiostro); padding: 6px 0; }
.quiz-back[disabled] { opacity: 0; pointer-events: none; }
.quiz-domanda { font-size: clamp(1.7rem, 3.6vw, 3rem); line-height: 1.08; font-weight: 650; letter-spacing: -0.025em; margin-bottom: 32px; text-wrap: balance; }
.quiz-opzioni { display: grid; gap: 10px; }
.opzione { display: flex; gap: 16px; align-items: center; font-size: 18px; padding: 20px 22px; background: var(--foglio); box-shadow: inset 0 0 0 1px var(--rigo); }
.opzione kbd { font: inherit; font-size: 13px; font-weight: 700; width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.opzione.is-scelta { background: var(--verde); color: var(--inchiostro); box-shadow: none; }
@media (hover: none) { .opzione kbd { display: none; } }

.risultato { display: grid; gap: clamp(40px, 7vh, 72px); }
.ris-head h2 { font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: .98; letter-spacing: -0.035em; }
.ris-head p { margin-top: 18px; font-size: 19px; color: var(--grafite); max-width: 44rem; }
.ris-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.matrice { position: relative; aspect-ratio: 1; background: var(--foglio); border: 1px solid var(--rigo); border-radius: 20px; overflow: hidden; }
.matrice::before, .matrice::after { content: ""; position: absolute; background: var(--rigo); }
.matrice::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.matrice::after { top: 50%; left: 0; right: 0; height: 1px; }
.matrice .q { position: absolute; width: 50%; height: 50%; padding: 14px; font-size: 13px; font-weight: 600; color: var(--grafite); line-height: 1.25; }
.matrice .q.on { color: var(--inchiostro); background: var(--verde-chiaro); }
.q-tl { left: 0; top: 0; } .q-tr { right: 0; top: 0; text-align: right; } .q-bl { left: 0; bottom: 0; display: flex; align-items: flex-end; } .q-br { right: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: flex-end; text-align: right; }
.matrice .punto { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 8px rgba(80, 172, 77, .22); left: 50%; top: 50%; z-index: 2; }
.assi { display: flex; justify-content: space-between; font-size: 13px; color: var(--grafite); margin-top: 8px; }
.barre { display: grid; gap: 18px; }
.barra-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.barra-top span:last-child { font-variant-numeric: tabular-nums; color: var(--grafite); font-weight: 500; }
.barra { height: 10px; border-radius: 10px; background: var(--rigo); overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--inchiostro); }
.barra-nota { font-size: 15px; color: var(--grafite); margin-top: 6px; }
.consigli { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.consigli h3 { grid-column: 1 / span 4; font-size: 26px; font-stretch: 108%; line-height: 1.1; }
.consigli ol { grid-column: 6 / span 7; }
.ris-cta { background: var(--inchiostro); color: var(--notte-testo); border-radius: 24px; padding: clamp(28px, 4vw, 48px); display: grid; gap: 18px; justify-items: start; }
.ris-cta p { color: var(--notte-muto); max-width: 40rem; }
.ris-cta .azioni { display: flex; flex-wrap: wrap; gap: 10px; }
.ris-cta .btn-line { box-shadow: inset 0 0 0 1.5px var(--notte-testo); color: var(--notte-testo); }
.ris-cta .btn-line:hover { background: var(--notte-testo); color: var(--inchiostro); }
@media (max-width: 860px) {
  .ris-grid { grid-template-columns: 1fr; }
  .matrice { max-width: 440px; }
  .consigli h3, .consigli ol { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer { padding-block: clamp(72px, 12vh, 128px) 32px; border-top: 1px solid var(--rigo); font-size: 15px; }
.footer-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: clamp(48px, 8vh, 80px); }
.footer-claim { font-size: clamp(2.4rem, 7vw, 6.4rem); font-weight: 750; letter-spacing: -0.045em; line-height: .95; font-stretch: 92%; transition: font-stretch .7s var(--ease); }
.footer-cta:hover .footer-claim { font-stretch: 112%; }
.claim-dot { display: inline-block; width: .17em; height: .17em; margin-left: .04em; border-radius: 50%; background: var(--verde); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2fr)); gap: 32px; padding-block: 40px; border-top: 1.5px solid var(--inchiostro); }
.footer-brand img { width: 128px; margin-bottom: 16px; }
.footer-brand p { color: var(--grafite); max-width: 34ch; }
.footer-grid nav { display: grid; gap: 8px; align-content: start; }
.footer-grid h2 { font-size: 15px; font-weight: 650; letter-spacing: 0; font-stretch: 100%; line-height: 1.4; margin-bottom: 4px; }
.footer-grid nav a { text-decoration: none; color: var(--grafite); overflow-wrap: anywhere; }
.footer-grid nav a:hover { color: var(--inchiostro); text-decoration: underline; text-decoration-color: var(--verde); text-underline-offset: 4px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--rigo); color: var(--grafite); }
.social { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.social a { text-decoration: none; font-weight: 500; color: var(--inchiostro); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Prenota (dialog) ---------- */
.prenota {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 24px;
  background: var(--foglio); color: var(--inchiostro); box-shadow: 0 40px 100px -30px rgba(22, 33, 58, .6);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
.prenota[open] { animation: dlg-in .55s var(--ease) both; }
.prenota[open]::backdrop { animation: bd-in .4s ease both; }
.prenota.is-closing { animation: dlg-out .25s cubic-bezier(.4, 0, 1, 1) both; }
.prenota.is-closing::backdrop { animation: bd-in .25s ease reverse both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(48px); } }
@keyframes dlg-out { to { opacity: 0; transform: translateY(28px); } }
@keyframes bd-in { from { opacity: 0; } }
.prenota-ok:not([hidden]) .ok-dot { animation: pop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { transform: scale(0); } }
.prenota::backdrop { background: rgba(22, 33, 58, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.prenota-form, .prenota-ok { padding: clamp(22px, 4vw, 40px); display: grid; gap: 20px; }
.prenota-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.prenota-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.prenota-close { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: var(--carta); cursor: pointer; position: relative; }
.prenota-close::before, .prenota-close::after { content: ""; position: absolute; left: 12px; right: 12px; top: 19px; height: 2px; background: var(--inchiostro); transform: rotate(45deg); }
.prenota-close::after { transform: rotate(-45deg); }
.prenota-lede { color: var(--grafite); }
.prenota fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.prenota legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; padding: 0; }
.giorni { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; width: 100%; }
.chip { position: relative; cursor: pointer; flex: none; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: grid; place-items: center; text-align: center; min-height: 44px; padding: 8px 16px; border-radius: 12px; background: var(--carta); font-weight: 600; font-size: 15px; line-height: 1.2; transition: background-color .2s, color .2s; }
.chip span small { display: block; font-weight: 400; font-size: 12px; opacity: .75; }
.chip input:checked + span { background: var(--inchiostro); color: var(--carta); }
.chip input:focus-visible + span { outline: 2px solid var(--verde); outline-offset: 2px; }
.campi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campo { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.campo-wide { grid-column: 1 / -1; }
.campo input, .campo select, .campo textarea {
  font: inherit; font-weight: 400; font-size: 16px; color: var(--inchiostro); background: var(--carta);
  border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%;
}
.campo textarea { resize: vertical; min-height: 88px; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--verde); background: var(--foglio); }
.campo input[aria-invalid="true"] { border-color: #C2410C; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.consenso { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--grafite); }
.consenso input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--inchiostro); flex: none; }
.prenota-errore { color: #9A3412; background: #FFF1E8; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.prenota-azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.prenota-cal { font-size: 15px; color: var(--grafite); }
.prenota-ok { justify-items: start; }
.ok-dot { width: 56px; height: 56px; border-radius: 50%; background: var(--verde); position: relative; }
.ok-dot::after { content: ""; position: absolute; left: 18px; top: 19px; width: 20px; height: 11px; border: solid var(--inchiostro); border-width: 0 0 3px 3px; transform: rotate(-45deg); }
.prenota-ok p { color: var(--grafite); font-size: 18px; }
@media (max-width: 560px) {
  .campi { grid-template-columns: 1fr; }
  .prenota { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
}

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Stampa (risultato del test) ---------- */
@media print {
  .site-header, .site-footer, .menu-mobile, .ris-cta, .quiz-bar, .skip { display: none !important; }
  body { background: #fff; }
  .quiz { padding-top: 0; }
}
