/* Landing vendita struttura ricettiva, Matera
   Idea: la pagina si legge come un dossier, ma è fatta della materia di Matera.
   Notte blu sui Sassi per le parti decisive (ingresso, numeri, richiesta),
   tufo per il racconto, un'unica luce color lanterna per le azioni. */

@font-face {
  font-family: "Marcellus";
  src: url("../fonts/marcellus-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --notte: #15223a;
  --notte-2: #1f2f4c;
  --tufo: #cbb58f;
  --tufo-scuro: #8c7550;
  --tufo-chiaro: #e9dfcb;
  --pietra: #f3ecdf;
  --lamp: #e3a43b;
  --lamp-hover: #efb85c;

  --ink: var(--notte);
  --ink-2: #4b5569;
  --on-dark: #ede6d8;
  --on-dark-2: #a9b3c4;
  --rule: rgba(21, 34, 58, 0.16);
  --rule-dark: rgba(203, 181, 143, 0.3);
  --error: #b3261e;
  --error-on-dark: #f4a58f;

  --font-display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.125rem;
  --step-1: 1.35rem;
  --step-2: 1.7rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.2rem, 1.5rem + 2.6vw, 3.3rem);
  --step-5: clamp(2.3rem, 1.2rem + 4.4vw, 4.4rem);

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 66ch;
  --topbar-h: 52px;
  --arch-r: clamp(150px, 26vw, 330px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--tufo-chiaro);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 380;
  font-variant-numeric: lining-nums;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
h3 { font-size: var(--step-2); margin-top: 2.5rem; margin-bottom: 1rem; }
h4 { font-size: var(--step-1); margin-bottom: 0.4rem; }
p { margin: 0 0 1rem; max-width: var(--measure); text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }
.chapter--light :focus-visible, .page-simple :focus-visible { outline-color: var(--notte); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -80px; z-index: 100;
  background: var(--lamp); color: var(--notte); padding: 0.6rem 1rem; font-weight: 600;
}
.skip:focus { top: 16px; }

/* --- Segnaposto di bozza ---------------------------------------------- */
.draft-banner {
  background: #ffe27a; color: var(--notte); font-size: var(--step--1);
  padding: 0.5rem var(--gutter); text-align: center; line-height: 1.4;
}
mark.todo {
  background: #ffe27a; color: var(--notte);
  font-family: var(--font-body); font-size: min(0.82em, 0.95rem); font-weight: 600; letter-spacing: 0;
  line-height: 1.3; padding: 0.05em 0.3em; border-radius: 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.verify { text-decoration: none; }

/* --- Bottoni ------------------------------------------------------------ */
.btn {
  letter-spacing: 0.005em;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.75rem 1.4rem;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none; text-align: center;
  border: 1px solid transparent; border-radius: 3px; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn--lamp { background: var(--lamp); color: var(--notte); }
.btn--lamp:hover { background: var(--lamp-hover); text-decoration: none; }
.btn--quiet { background: transparent; color: inherit; border-color: currentColor; }
.btn--quiet:hover { background: rgba(203, 181, 143, 0.14); }
.btn--small { min-height: 38px; padding: 0.45rem 0.95rem; font-size: 0.92rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.linklike {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* --- Barra superiore con avanzamento ----------------------------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  background: var(--notte); color: var(--on-dark);
  transform: translateY(-100%); transition: transform 0.25s ease;
  border-bottom: 1px solid var(--rule-dark);
}
.topbar.is-visible { transform: none; }
.topbar__progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%;
  background: var(--lamp); transform-origin: 0 50%; transform: scaleX(0);
}
.topbar__inner {
  height: var(--topbar-h); max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar__chapter { font-family: var(--font-display); font-size: 1.15rem; }
.topbar__cta { display: none; }
@media (min-width: 720px) { .topbar__cta { display: inline-flex; } }

/* --- Ingresso: un portale voltato con una lanterna --------------------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--notte); color: var(--on-dark);
  padding: 52px var(--gutter) var(--gutter);
}
.hero__lang {
  position: absolute; top: 14px; right: var(--gutter);
  font-size: var(--step--1); color: var(--on-dark-2);
}
.hero__portal {
  position: relative; max-width: 1120px; margin: 0 auto;
  min-height: calc(100svh - 52px - var(--gutter));
  display: flex; flex-direction: column; justify-content: flex-end;
  isolation: isolate;
}
/* doppia linea dell'arco: volta ribassata, raggio verticale fisso */
.hero__portal::before,
.hero__portal::after {
  content: ""; position: absolute; pointer-events: none; z-index: -1;
  border: 1px solid var(--tufo); border-bottom: 0;
  border-radius: 50% 50% 0 0 / var(--arch-r) var(--arch-r) 0 0;
}
.hero__portal::before { inset: 0; }
.hero__portal::after { inset: 12px 12px 0; opacity: 0.45; border-radius: 50% 50% 0 0 / calc(var(--arch-r) - 12px) calc(var(--arch-r) - 12px) 0 0; }

.hero__glow {
  position: absolute; z-index: -2; left: 50%; top: 0;
  width: min(900px, 120%); height: calc(var(--arch-r) * 2.2);
  transform: translateX(-50%);
  background: radial-gradient(closest-side at 50% 18%, rgba(227, 164, 59, 0.22), rgba(227, 164, 59, 0.06) 55%, transparent 100%);
}
.hero__lamp {
  position: absolute; left: 50%; top: 0; width: 1px; height: calc(var(--arch-r) * 0.32);
  background: var(--tufo); transform: translateX(-50%);
}
.hero__lamp::after {
  content: ""; position: absolute; left: 50%; bottom: -16px; width: 10px; height: 16px;
  transform: translateX(-50%); border-radius: 3px 3px 5px 5px;
  background: var(--lamp);
  box-shadow: 0 0 18px 6px rgba(227, 164, 59, 0.45), 0 0 60px 18px rgba(227, 164, 59, 0.15);
}

.hero__content {
  text-align: center;
  padding: calc(var(--arch-r) * 0.58) clamp(18px, 6%, 96px) clamp(24px, 5vh, 56px);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.9rem; margin: 0 auto 1.1rem;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tufo);
}
.hero__eyebrow::before, .hero__eyebrow::after { content: ""; width: 28px; height: 1px; background: var(--tufo-scuro); }
.hero h1 {
  font-size: var(--step-5); line-height: 1.05; letter-spacing: -0.012em;
  max-width: 19ch; margin: 0 auto 1rem;
}
.hero__rank { display: inline-flex; align-items: center; gap: 0.9rem; margin: 0 auto 1.4rem; padding: 0.55rem 1.4rem 0.55rem 0.7rem; border: 1px solid rgba(227, 164, 59, 0.55); border-radius: 999px; background: rgba(227, 164, 59, 0.08); box-shadow: 0 0 32px rgba(227, 164, 59, 0.14); text-align: left; }
.hero__rank-big { font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); line-height: 1; color: var(--notte); background: var(--lamp); border-radius: 999px; padding: 0.5rem 1rem; white-space: nowrap; }
.hero__rank-text { font-size: clamp(0.95rem, 0.88rem + 0.3vw, 1.08rem); line-height: 1.3; color: var(--on-dark); max-width: 22ch; }
.hero__lead { font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.35rem); line-height: 1.5; max-width: 50ch; margin: 0 auto 1.75rem; color: var(--on-dark); }
.hero__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; margin: 0 auto 2rem; max-width: 880px;
}
.hero__facts > div {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.15rem;
  padding: 0.75rem 0.5rem; border-top: 1px solid var(--rule-dark);
}
.hero__facts dt { font-size: 0.92rem; letter-spacing: 0.01em; color: var(--on-dark-2); line-height: 1.35; }
.hero__facts dd { margin: 0; font-family: var(--font-body); font-weight: 340; letter-spacing: -0.015em; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 760px) {
  .hero__facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero__facts > div + div { border-left: 1px solid var(--rule-dark); }
}
.hero .btn--lamp { min-height: 54px; padding-inline: 1.9rem; font-size: 1.05rem; box-shadow: 0 6px 24px rgba(227, 164, 59, 0.22); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.5rem; margin-bottom: 1.25rem; }
.hero__read { color: var(--on-dark); font-size: 1rem; }
.hero__note { font-size: var(--step--1); color: var(--on-dark-2); max-width: 46ch; margin: 0 auto; }

.hero__cue {
  position: absolute; left: 50%; bottom: 10px; width: 28px; height: 40px; transform: translateX(-50%);
  display: none; justify-content: center; text-decoration: none;
}
.hero__cue span { width: 1px; height: 100%; background: linear-gradient(var(--tufo), transparent); transform-origin: top; }
@media (min-width: 720px) and (min-height: 700px) { .hero__cue { display: flex; } }
@media (prefers-reduced-motion: no-preference) {
  .hero__cue span { animation: cue 2.2s 2.4s ease-in-out infinite; }
}
@keyframes cue { 0%, 100% { transform: scaleY(0.35); opacity: 0.5; } 50% { transform: scaleY(1); opacity: 1; } }

/* un solo momento animato: la volta si disegna e la lanterna si accende */
@media (prefers-reduced-motion: no-preference) {
  .hero__portal::before { animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both; }
  .hero__portal::after { animation: rise 1.4s 0.15s cubic-bezier(.2,.7,.2,1) both; }
  .hero__lamp { animation: drop 0.6s 0.9s ease-out both; }
  .hero__glow { animation: glow 1.6s 1.2s ease-out both; }
}
@keyframes rise { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes glow { from { opacity: 0; } to { opacity: 1; } }

/* --- Capitoli ----------------------------------------------------------- */
main { counter-reset: ch; }
.chapter { padding-block: clamp(56px, 7vw, 96px); counter-increment: ch; }
.chapter--paper { background: var(--pietra); }
.chapter__head::before {
  content: counter(ch, decimal-leading-zero);
  display: block; margin-bottom: 0.7rem;
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.2em; color: var(--tufo-scuro);
}
.chapter--dark .chapter__head::before { color: var(--tufo); }
.chapter__head::after { content: ""; display: block; width: 36px; height: 1px; margin-top: 1rem; background: var(--tufo-scuro); }
.chapter--dark .chapter__head::after { background: var(--tufo); }
#richiesta .chapter__head::after { display: none; }
.chapter--dark { background: var(--notte); color: var(--on-dark); }
.chapter__inner {
  max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 4rem;
}
.chapter__head h2 { font-size: var(--step-4); }
.chapter__body > :last-child { margin-bottom: 0; }
.chapter__body--follow { padding-top: 1rem; }
.chapter__body--follow h3:first-child { margin-top: 0; }
@media (min-width: 980px) {
  .chapter__inner { grid-template-columns: 280px minmax(0, 1fr); }
  .chapter__head { grid-row: 1 / span 3; }
  .chapter__head h2 { position: sticky; top: calc(var(--topbar-h) + 32px); font-size: clamp(2rem, 1.1rem + 1.5vw, 2.7rem); }
  #richiesta .chapter__head h2 { font-size: var(--step-4); }
  .chapter__body, .gallery { grid-column: 2; }
}

.lead { font-size: var(--step-1); line-height: 1.5; font-weight: 360; margin-bottom: 2rem; }
.fine { font-size: var(--step--1); color: var(--ink-2); line-height: 1.5; margin-top: 1.5rem; }
.chapter--dark .fine, .footer .fine { color: var(--on-dark-2); }

/* Fascia con invito, a metà pagina */
.band { background: var(--notte-2); color: var(--on-dark); }
.band__inner {
  max-width: 1180px; margin: 0 auto; padding: 1.6rem var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
}
.band p { margin: 0; font-family: var(--font-display); font-size: var(--step-2); line-height: 1.2; max-width: 30ch; }
@media (max-width: 719px) { .band__inner .btn { width: 100%; } }

/* Sintesi: un registro, una riga per dato */
.ledger { margin: 0; border-top: 1px solid var(--notte); }
.ledger__row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.1rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--rule);
}
.ledger dt { font-size: var(--step--1); color: var(--ink-2); }
.ledger dd { margin: 0; font-weight: 450; }
@media (min-width: 640px) {
  .ledger__row { grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; align-items: baseline; }
  .ledger dt { font-size: 1rem; }
}

/* Grafico arrivi */
.chart { margin: 0 0 2.5rem; max-width: 620px; }
.chart__title { font-family: var(--font-display); font-size: var(--step-1); margin-bottom: 0.75rem; }
.chart__svg { width: 100%; height: auto; overflow: visible; }
.chart__svg .bar path { fill: #66728a; }
.chart__svg .bar--now path { fill: var(--notte); }
.chart__svg .bar:hover path, .chart__svg .bar:focus path { fill: var(--tufo-scuro); }
.chart__svg .bar:focus { outline: none; }
.chart__svg .bar__value { font: 600 21px var(--font-body); fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart__svg .bar__label { font: 400 20px var(--font-body); fill: var(--ink-2); }
.chart__svg .chart__base { stroke: var(--ink); stroke-width: 1; }
.chart__note { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.5rem; }

/* Elenchi di punti con titolo */
.points { margin: 0; display: grid; gap: 0; }
.points > div { padding: 1.1rem 0 1.2rem; border-top: 1px solid var(--rule); }
.points dt { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.25; letter-spacing: 0; margin-bottom: 0.3rem; }
.points dd { margin: 0; max-width: var(--measure); }
@media (min-width: 720px) {
  .points--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
}

.specs, .included { list-style: none; padding: 0; margin: 0 0 2rem; max-width: var(--measure); }
.specs li, .included li { position: relative; padding: 0.35rem 0 0.35rem 1.6rem; }
.specs li::before, .included li::before {
  content: ""; position: absolute; left: 0; top: 1.05em; width: 0.9rem; height: 1px; background: var(--tufo-scuro);
}
@media (min-width: 720px) { .included { columns: 2; column-gap: 2.5rem; } .included li { break-inside: avoid; } }

/* Galleria: cornici voltate come le porte dei Sassi */
.gallery {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: 0.5rem 0 1.5rem; max-width: 100%;
}
.photo { margin: 0; }
.photo img, .photo__ph {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 50% 50% 3px 3px / 40% 40% 3px 3px;
}
.photo--1 { grid-column: 1 / -1; }
.photo--1 img, .photo--1 .photo__ph { aspect-ratio: 4 / 5; border-radius: 50% 50% 3px 3px / 30% 30% 3px 3px; }
.photo figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.4rem; }
.photo__ph {
  display: flex; align-items: center; justify-content: center; padding: 1rem; text-align: center;
  background-color: var(--tufo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .18  0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (min-width: 720px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .photo--1 { grid-column: auto; grid-row: span 2; display: flex; flex-direction: column; }
  .photo--1 img, .photo--1 .photo__ph { aspect-ratio: auto; flex: 1; border-radius: 50% 50% 3px 3px / 22% 22% 3px 3px; }
}

/* Reputazione */
.scores { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; margin-bottom: 1.5rem; }
.score {
  flex: 1 1 11rem; max-width: 15rem; text-align: center;
  padding: 2.2rem 1rem 1.4rem; background: var(--tufo-chiaro);
  border: 1px solid var(--tufo); border-radius: 50% 50% 4px 4px / 34% 34% 4px 4px;
}
.score__value { font-family: var(--font-body); font-weight: 340; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; font-size: clamp(3rem, 2rem + 4vw, 4.6rem); line-height: 1; margin: 0 0 0.35rem; }
.score__label { font-size: 1rem; margin: 0; }
.score__label span { display: block; color: var(--ink-2); font-size: var(--step--1); }
.score--star { border-color: var(--tufo-scuro); box-shadow: inset 0 3px 0 var(--lamp); }
.score--star .score__value { font-family: var(--font-display); font-weight: 400; }
.ranking { font-size: var(--step-1); font-family: var(--font-display); padding: 1rem 0; border-block: 1px solid var(--rule); margin-bottom: 2rem; }
.chapter--paper .score, .chapter--paper .quote { background: #fff8ea; }
.quotes { display: grid; gap: 1.5rem; margin: 0 0 2rem; }
@media (min-width: 900px) { .quotes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.quote { margin: 0; padding: 2.2rem 1.4rem 1.4rem; background: var(--tufo-chiaro); border-radius: 4px; position: relative; }
.quote::before { content: "\201C"; position: absolute; left: 1.2rem; top: 0.2rem; font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--tufo-scuro); }
.quote blockquote { margin: 0; }
.quote p { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.4; margin-bottom: 0.5rem; }
.quote figcaption { font-size: var(--step--1); color: var(--ink-2); }

/* Gestione */
.scenarios { display: grid; gap: 1.5rem 2.5rem; margin-top: 1.5rem; }
.scenario { padding-top: 1rem; border-top: 1px solid var(--notte); }
@media (min-width: 720px) { .scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* I numeri (scuro) */
.chapter--dark .lead { color: var(--on-dark); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 1rem; border-top: 1px solid var(--rule-dark); }
.kpi { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.35rem; padding: 1.2rem 1rem 1.3rem 0; border-bottom: 1px solid var(--rule-dark); }
.kpi dt { font-size: var(--step--1); color: var(--on-dark-2); line-height: 1.35; }
.kpi dd { margin: 0; font-family: var(--font-body); font-weight: 340; letter-spacing: -0.015em; font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); color: var(--tufo-chiaro); line-height: 1.1; font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.table-wrap { overflow-x: auto; margin-bottom: 0.5rem; }
.history { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 520px; }
.history th, .history td { text-align: right; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--rule-dark); }
.history th:first-child { text-align: left; padding-left: 0; }
.history thead th { font-weight: 500; font-size: var(--step--1); color: var(--on-dark-2); }
.history tbody th { font-weight: 500; }
.chapter--dark h3 { color: var(--on-dark); }
.chapter--dark .btn { margin-top: 1rem; }

/* Per chi è */
.profiles { margin: 0; display: grid; gap: 0; }
.profiles > div { padding: 1.2rem 0; border-top: 1px solid var(--rule); }
.profiles dt { font-family: var(--font-display); font-size: var(--step-2); margin-bottom: 0.35rem; }
.profiles dd { margin: 0; max-width: 54ch; }
@media (min-width: 720px) { .profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }

/* La trattativa: una sequenza vera, quindi numerata */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 1.15rem; top: 0.6rem; bottom: 3rem; width: 1px; background: var(--tufo-scuro); }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.6rem 3.6rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -0.1rem;
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
  font-family: var(--font-body); font-size: 1.05rem; font-weight: 500;
  background: var(--tufo-chiaro); border: 1px solid var(--tufo-scuro); border-radius: 50%;
}
.steps h3 { font-size: var(--step-1); margin: 0 0 0.25rem; }
.steps p { margin: 0; }

/* Domande */
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 1.05rem 2.5rem 1.05rem 0; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%; width: 12px; height: 12px;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: translateY(-75%) rotate(45deg); transition: transform 0.2s ease;
}
.faq summary:hover { color: var(--tufo-scuro); }
.faq details[open] summary { color: var(--ink); }
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { padding-bottom: 1.1rem; margin: 0; }

/* --- Richiesta (scuro) -------------------------------------------------- */
#richiesta .chapter__inner { grid-template-columns: minmax(0, 1fr); }
#richiesta .chapter__head h2 { position: static; }
#richiesta .chapter__body { grid-column: auto; }
.request { display: grid; gap: 2.5rem 4rem; }
@media (min-width: 980px) {
  .request { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .request__intro { position: sticky; top: calc(var(--topbar-h) + 32px); }
}
.request__intro h3 { margin-top: 0; }
.next { padding-left: 1.25rem; margin: 0 0 1rem; }
.next li { padding-left: 0.4rem; margin-bottom: 0.6rem; }
.next li::marker { color: var(--tufo); font-weight: 600; }

.lead-form { background: var(--notte-2); padding: clamp(20px, 4vw, 40px); border-radius: 4px; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.stepper { margin-bottom: 1.75rem; }
.stepper[hidden] { display: none; }
.stepper__label { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step--1); color: var(--on-dark-2); margin: 0 0 0.6rem; }
.stepper__label strong { color: var(--on-dark); font-weight: 500; }
.stepper__bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.stepper__bar i { height: 3px; background: rgba(203, 181, 143, 0.25); border-radius: 2px; transition: background-color 0.25s ease; }
.stepper__bar i.is-done { background: var(--tufo); }
.stepper__bar i.is-now { background: var(--lamp); }
.js-steps .group { margin-bottom: 0; }
.js-steps .group[hidden] { display: none; }
.form-nav { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.form-nav .btn { flex: 1; }
.form-nav .form-nav__back { flex: 0 0 auto; min-width: 7rem; }
.form-nav [hidden] { display: none; }
.js-steps:not(.is-last) .form-nav__submit { display: none; }
.js-steps .cf-turnstile { margin-top: 1.25rem; }
.group { border: 0; padding: 0; margin: 0 0 2rem; min-width: 0; }
.group > legend { font-family: var(--font-display); font-size: var(--step-1); padding: 0; margin-bottom: 1rem; color: var(--on-dark); }
.field { margin-bottom: 1.15rem; }
.field[hidden] { display: none; }
.field label, .choice legend { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 1rem; }
.field__opt { font-weight: 400; color: var(--on-dark-2); }
.field__hint { font-size: var(--step--1); color: var(--on-dark-2); margin: -0.2rem 0 0.4rem; }
.lead-form input[type="text"], .lead-form input[type="email"], .lead-form input[type="tel"],
.lead-form input[type="number"], .lead-form select, .lead-form textarea {
  width: 100%; min-height: 48px; padding: 0.65rem 0.8rem;
  font: inherit; font-size: 1rem; color: var(--on-dark);
  background: var(--notte); border: 1px solid rgba(203, 181, 143, 0.5); border-radius: 3px;
}
.lead-form textarea { resize: vertical; min-height: 110px; }
.lead-form select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23cbb58f' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center;
}
.lead-form select option { color: var(--notte); background: #fff; }
.lead-form input:focus-visible, .lead-form select:focus-visible, .lead-form textarea:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }
.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.field .choice__opt {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; margin: 0 0 0.5rem;
  font-weight: 400; cursor: pointer; border: 1px solid rgba(203, 181, 143, 0.35); border-radius: 3px;
  background: var(--notte); transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field .choice__opt:hover { border-color: var(--tufo); }
.field .choice__opt:has(input:checked) { border-color: var(--lamp); background: rgba(227, 164, 59, 0.1); }
.field .choice__opt:has(input:focus-visible) { outline: 2px solid var(--lamp); outline-offset: 2px; }
.choice legend { margin-bottom: 0.6rem; }
.choice legend { padding: 0; }
.choice__opt input, .check input { width: 20px; height: 20px; margin: 0; accent-color: var(--lamp); flex: none; }
.field .check { display: flex; align-items: flex-start; gap: 0.7rem; font-weight: 400; cursor: pointer; line-height: 1.45; margin: 0; }
.check a { color: var(--on-dark); }
.field__error { color: var(--error-on-dark); font-size: var(--step--1); margin: 0.35rem 0 0; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--error-on-dark); }
.field.is-invalid .choice__opt { border-color: var(--error-on-dark); }
.form-alert { border: 1px solid var(--error-on-dark); color: var(--on-dark); padding: 0.8rem 1rem; margin-bottom: 1.5rem; border-radius: 3px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin-bottom: 1rem; }

/* --- CTA fissa su mobile ----------------------------------------------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(21, 34, 58, 0.97); border-top: 1px solid var(--rule-dark);
}
.sticky-cta[hidden] { display: none; }
@media (min-width: 720px) { .sticky-cta { display: none !important; } }

/* --- Consenso cookie --------------------------------------------------- */
.consent {
  position: fixed; z-index: 60; left: 12px; right: 12px; bottom: 12px;
  max-width: 520px; padding: 1rem 1.1rem;
  background: var(--notte-2); color: var(--on-dark);
  border: 1px solid var(--rule-dark); border-radius: 4px;
  box-shadow: 0 10px 30px rgba(10, 16, 28, 0.35);
}
.consent[hidden] { display: none; }
.consent p { font-size: 0.95rem; margin-bottom: 0.75rem; }
.consent__actions { display: flex; gap: 0.6rem; justify-content: flex-end; }
.consent .btn { min-height: 42px; }

/* --- Piede -------------------------------------------------------------- */
.footer { background: var(--notte); color: var(--on-dark-2); border-top: 1px solid var(--rule-dark); padding: 40px 0 calc(96px + env(safe-area-inset-bottom)); font-size: var(--step--1); }
@media (min-width: 720px) { .footer { padding-bottom: 40px; } }
.footer__inner { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.footer p { max-width: 80ch; }
.footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1rem 0 0; }
.footer a, .footer .linklike { color: var(--on-dark); }

/* --- Pagine semplici (grazie, privacy) ---------------------------------- */
.simple { padding: clamp(48px, 10vw, 120px) var(--gutter); min-height: 70vh; }
.simple__inner { max-width: 44rem; margin: 0 auto; }
.page-thanks .simple__inner { text-align: center; }
.page-thanks .simple__inner p { margin-inline: auto; }
.simple__tick { stroke: var(--lantern, #E3A43B); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.page-thanks .simple { display: grid; align-items: center; }
.simple__arch { width: 104px; margin: 0 auto 1.75rem; display: block; fill: none; stroke: var(--tufo-scuro); stroke-width: 1.5; }
.simple h1 { font-size: var(--step-4); margin-bottom: 1.25rem; }
.simple--legal h2 { font-size: var(--step-2); margin: 2.5rem 0 0.75rem; }
.simple--legal ul { padding-left: 1.2rem; max-width: var(--measure); }
.simple--legal li { margin-bottom: 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .sticky-cta, .consent, .lead-form, .draft-banner { display: none !important; }
  .chapter--dark, .hero, .footer { background: #fff; color: #000; }
}

/* Catalogo foto */
.gallery__more { text-align: center; margin: 1.5rem 0 2rem; }
.simple__inner--wide { max-width: 72rem; }
.simple--gallery .lead { max-width: 46rem; }
.catalog { list-style: none; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1000px) { .catalog { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.catalog li { margin: 0; }
.catalog__item { display: block; width: 100%; padding: 0; border: 0; background: var(--tufo); cursor: zoom-in; border-radius: 3px; overflow: hidden; aspect-ratio: 4 / 5; }
.catalog__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.catalog__item:hover img { transform: scale(1.03); }
.lightbox { border: 0; padding: 0; background: rgba(12, 20, 34, 0.96); width: 100vw; height: 100vh; max-width: none; max-height: none; color: #fff; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(12, 20, 34, 0.96); }
.lightbox__img { max-width: min(92vw, 1100px); max-height: 86vh; object-fit: contain; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,0.1); color: #fff; border: 0; cursor: pointer; width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,0.22); }
.lightbox__count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 0.9rem; color: var(--on-dark-2); margin: 0; }

/* Recupero del prezzo */
.payback { margin: 0 0 2.5rem; max-width: 52rem; }
.payback h3 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.payback__bar { display: flex; height: 84px; border-radius: 3px; overflow: hidden; margin: 1.25rem 0 0.75rem; }
.payback__bar span { display: flex; flex-direction: column; justify-content: center; padding: 0 1rem; min-width: 0; }
.payback__bar b { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.payback__bar i { font-style: normal; font-family: var(--font-display); font-size: var(--step-1); line-height: 1.2; }
.payback__back { background: var(--notte); color: var(--on-dark); }
.payback__extra { background: var(--lamp); color: var(--notte); }
@media (max-width: 560px) { .payback__bar { height: auto; flex-direction: column; } .payback__bar span { width: 100% !important; padding: 0.8rem 1rem; } }
