:root {
  --ink: #14211b;
  --ink-soft: #34443b;
  --paper: #f3f5f1;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-raised: #fbfcfa;
  --on-dark: #ffffff;
  --primary-on: #ffffff;
  --dark-section: #14211b;
  --deep-green: #0b4a34;
  --green: #176b49;
  --green-dark: #0b4a34;
  --green-pale: #dfeee6;
  --amber: #cf7d18;
  --amber-pale: #fff1d9;
  --notice-text: #5c3a12;
  --blue: #285c7d;
  --line: #cdd7d0;
  --muted: #68766e;
  --danger: #9f3a2d;
  --field-border: #b9c7bf;
  --footer-bg: #0d1813;
  --shadow: 0 18px 45px rgba(20, 33, 27, 0.12);
}

html[data-theme="dark"] {
  --ink: #eef5f0;
  --ink-soft: #c2d0c7;
  --paper: #0b1310;
  --surface: #121d17;
  --surface-raised: #17241d;
  --primary-on: #07130d;
  --dark-section: #08110d;
  --deep-green: #083b2a;
  --green: #7bd5a8;
  --green-dark: #58b98a;
  --green-pale: #163426;
  --amber: #f1b45e;
  --amber-pale: #2d2417;
  --notice-text: #f3d6aa;
  --blue: #8bc4e1;
  --line: #34473d;
  --muted: #a9bbb0;
  --danger: #f09a8d;
  --field-border: #4a6155;
  --footer-bg: #050b08;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
  font-family: "Source Sans 3", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  transition: background-color .2s ease, color .2s ease;
}
html[data-theme="dark"] body { color-scheme: dark; }
body.menu-open { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: "Sora", sans-serif;
  letter-spacing: 0;
}
h1 { margin-bottom: 20px; font-size: 58px; line-height: 1.04; }
h2 { margin-bottom: 18px; font-size: 38px; line-height: 1.15; }
h3 { margin-bottom: 10px; font-size: 20px; line-height: 1.3; }
.lead { max-width: 760px; color: var(--ink-soft); font-size: 21px; }
.muted { color: var(--muted); }
.mono { font-family: "IBM Plex Mono", monospace; }
.section { padding: 92px 0; }
.section-white { background: var(--surface); }
.section-dark { background: var(--dark-section); color: var(--on-dark); }
.section-dark .eyebrow { color: #77d5a6; }
.section-dark .lead, .section-dark .muted { color: #becbc4; }
.section-head { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 48px; }
.section-head > * { max-width: 760px; }

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}
.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 4px;
  color: #9ce2bc;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
}
/* Marchio dello studio al posto del riquadro "PD": stesso logo del sito,
   ricolorato nel verde della pagina e con il tratto ispessito
   (assets/logo-studio-verde.png, generato da quello originale). */
/* flex: none e indispensabile — .brand e un inline-flex e senza questo il
   logo viene compresso dal contenitore: reso 40x8 px invece di 40x80,
   cioe una striscia verticale. Misurato in produzione il 20/08/2026. */
.brand-logo { height: 52px; width: auto; display: block; flex: 0 0 auto; object-fit: contain; }
@media (max-width: 720px) { .brand-logo { height: 40px; } }

/* Elenco delle richieste nell'area riservata: una scheda per richiesta, con lo
   stato e i file consegnati da riscaricare quante volte serve. */
.richieste-list { display: grid; gap: 14px; margin-top: 8px; }
.richiesta-card {
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  padding: 16px 18px; background: rgba(255,255,255,.03);
}
.richiesta-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; justify-content: space-between; }
.richiesta-tipo { font-family: "Sora", sans-serif; font-size: 16px; }
.richiesta-data { color: rgba(255,255,255,.6); font-size: 13px; }
.richiesta-stato {
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor;
}
.stato-ricevuta { color: #9ce2bc; }
.stato-in-lavorazione { color: #f1b45e; }
.stato-evasa { color: #7bd5a8; }
.stato-rifiutata { color: #e88f8f; }
.richiesta-meta { margin: 8px 0 0; color: rgba(255,255,255,.7); font-size: 13px; }
.richiesta-file { margin-top: 12px; display: grid; gap: 6px; }
.richiesta-file a { color: #9ce2bc; text-decoration: none; font-size: 14px; }
.richiesta-file a:hover { text-decoration: underline; }
.richiesta-vuota { color: rgba(255,255,255,.55); font-size: 13px; margin-top: 10px; }

/* --- Pagina operativa da loggati (20/08/2026) -------------------------------
   Chi e dentro lavora: le sezioni di presentazione (hero, vetrina servizi,
   come funziona, prezzi, pagamenti, fascia finale) spariscono e restano solo
   le sezioni operative. La spiegazione dei motori vive nella guida compatta
   dentro l'area privata. */
body.logged-in .hero,
body.logged-in .proof-strip,
body.logged-in .service-hub,
body.logged-in #come-funziona,
body.logged-in #output,
body.logged-in #prezzi,
body.logged-in #pagamento,
body.logged-in #policy-uso,
body.logged-in .cta-band,
body.logged-in #navPrivateButton,
body.logged-in .nav-links a:not(#navPrivateLink) { display: none; }

/* L'intestazione e `position: absolute` e fluttua SOPRA il contenuto: sulla
   pagina pubblica va bene perche l'hero ha spazio in cima, ma da loggati l'hero
   non c'e e la prima sezione ci finiva sotto — le scritte si sovrapponevano alla
   riga di separazione. Da loggati diventa `sticky`: prende spazio nel flusso
   (niente sovrapposizioni per costruzione) e resta visibile mentre si lavora. */
body.logged-in .site-header {
  position: sticky;
  top: 0;
  background: var(--dark-section);
  backdrop-filter: saturate(140%) blur(6px);
}
body.logged-in .private-head-section { padding-top: 56px; }

/* Il riquadro «Connesso come» dentro l'area duplicava chip ed Esci ora
   nell'intestazione: su una pagina di lavoro e solo rumore. Gli elementi
   restano nel DOM perche il JS li riempie. */


/* Stato di accesso nell'intestazione: chip col codice + Esci sempre in vista. */
.nav-account { display: flex; align-items: center; gap: 10px; }
.nav-account-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(123,213,168,.45); color: #9ce2bc;
  font-family: "JetBrains Mono", monospace; font-size: 12.5px; letter-spacing: .03em;
  white-space: nowrap;
}
.nav-account-chip::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: #7bd5a8; box-shadow: 0 0 6px rgba(123,213,168,.8);
}
@media (max-width: 720px) { .nav-account-chip { font-size: 11px; padding: 5px 9px; } }

/* Guida operativa: quattro righe, non un depliant. */
.engine-guide-section { padding-top: 8px; padding-bottom: 0; }
.engine-guide {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.engine-guide article {
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 12px 14px; background: rgba(255,255,255,.03);
  display: grid; gap: 4px;
}
.engine-guide strong { font-family: "Sora", sans-serif; font-size: 13.5px; color: #9ce2bc; }
.engine-guide span { font-size: 12.5px; line-height: 1.45; color: rgba(255,255,255,.72); }
.engine-guide-note { margin: 10px 0 0; font-size: 12.5px; color: rgba(255,255,255,.55); }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font-family: "Sora", sans-serif; font-size: 17px; }
.brand-copy small { margin-top: 4px; color: rgba(255,255,255,.72); font-size: 11px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: rgba(255,255,255,.86); font-size: 15px; text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--white); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.language-link { font-family: "IBM Plex Mono", monospace; font-size: 13px; text-decoration: none; }
.nav-links .language-link { display: none; }
.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 4px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 22px;
}
.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 4px;
  background: rgba(20,33,27,.24);
  color: var(--on-dark);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.theme-toggle:hover, .theme-toggle:focus-visible { background: rgba(20,33,27,.58); }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  max-width: 100%;
  line-height: 1.25;
  text-align: center;
}
.button-primary { background: var(--green); color: var(--primary-on); }
.button-primary:hover { background: var(--green-dark); }
.button-light { background: var(--white); color: #14211b; }
.button-light:hover { background: var(--green-pale); }
.button-ghost { border-color: rgba(255,255,255,.56); color: var(--white); background: rgba(20,33,27,.22); }
.button-ghost:hover { background: rgba(20,33,27,.5); }
.button-outline { border-color: var(--line); background: transparent; color: var(--ink); }
.button-outline:hover { border-color: var(--green); color: var(--green); }

.hero {
  position: relative;
  min-height: 86svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #1c2822;
  color: var(--white);
}
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-shade { position: absolute; inset: 0; background: rgba(10, 18, 14, 0.62); }
.hero-content { position: relative; z-index: 2; padding: 136px 0 92px; }
.hero-copy { max-width: 690px; }
.hero .eyebrow { color: #9ce2bc; }
.hero .lead { color: rgba(255,255,255,.82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.welcome-line { margin: 18px 0 0; color: rgba(255,255,255,.82); font-size: 14px; }
.welcome-line strong { color: #f5bd73; }
.pilot-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 4px;
  background: rgba(20,33,27,.42);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
.pilot-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0ac4f; }

.proof-strip { background: var(--deep-green); color: var(--on-dark); }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof-item { padding: 24px 22px; border-left: 1px solid rgba(255,255,255,.14); }
.proof-item:last-child { border-right: 1px solid rgba(255,255,255,.14); }
.proof-item strong { display: block; font-family: "Sora", sans-serif; font-size: 18px; }
.proof-item span { display: block; margin-top: 5px; color: #bcd7c8; font-size: 14px; }

.workflow-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.workflow-step { padding: 28px 24px 12px 0; border-right: 1px solid var(--line); }
.workflow-step + .workflow-step { padding-left: 24px; }
.workflow-step:last-child { border-right: 0; }
.step-number { color: var(--green); font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 700; }
.workflow-step h3 { margin-top: 34px; }

.outputs { display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px; align-items: start; }
.contract-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid #3c4d44; }
.contract-list li { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid #3c4d44; }
.contract-code { color: #8edbb1; font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.state {
  min-height: 150px;
  padding: 20px;
  border: 1px solid #43544b;
  border-radius: 6px;
  background: #1b2a22;
}
.state strong { font-family: "IBM Plex Mono", monospace; }
.state-ready strong { color: #80d9aa; }
.state-review strong { color: #f1b660; }
.state-blocked strong { color: #ef9085; }
.state p { margin: 28px 0 0; color: #b9c7bf; font-size: 14px; }

.pricing-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: 64px; align-items: start; }
.price-notes { margin: 34px 0 0; padding: 0; list-style: none; }
.price-notes li { padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.calculator {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field label, .field-label { color: var(--muted); font-size: 14px; font-weight: 650; }
.field select, .field input, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--ink);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(23,107,73,.16); border-color: var(--green); }

/* Regime alfa (21 ago 2026). Il colore e' l'ambra gia' in uso per gli avvisi
   (.notice, .inline-notice, .pilot-note): nessuna palette nuova. Colorare la
   singola <option> non funziona ovunque, quindi lo stato si vede sul MENU
   (bordo e fondo ambra) e su un badge accanto, entrambi accesi dal JS. */
.workflow-choice { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.workflow-choice select { flex: 1 1 260px; }
.workflow-choice.is-alpha select { border-color: var(--amber); background: var(--amber-pale); color: var(--notice-text); }
.alpha-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--amber);
  border-radius: 4px;
  background: var(--amber-pale);
  color: var(--notice-text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.alpha-badge::before { content: "▲"; font-size: 10px; }
.alpha-notice strong { font-family: "Sora", sans-serif; }
.alpha-notice p { margin: 6px 0 0; font-size: 14px; }
.price-result { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--ink); }
.price-line { display: flex; justify-content: space-between; gap: 22px; padding: 6px 0; }
.price-line strong { font-family: "IBM Plex Mono", monospace; }
.price-total { align-items: end; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.price-total strong { color: var(--green-dark); font-family: "Sora", sans-serif; font-size: 34px; }
.discount-note { margin: 16px 0 0; padding: 12px 14px; background: var(--green-pale); color: var(--green-dark); font-size: 14px; }
.calculator small { display: block; margin-top: 16px; color: var(--muted); }
.rate-sheet { border-top: 2px solid var(--ink); }
.rate-head, .rate-row { display: grid; grid-template-columns: minmax(170px, 1fr) repeat(3, 72px); gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rate-head { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; text-transform: uppercase; }
.rate-head span:not(:first-child), .rate-row span { text-align: right; }
.rate-row strong { font-family: "Space Grotesk", sans-serif; }
.rate-row span { font-family: "JetBrains Mono", monospace; font-size: 14px; }
.rate-sheet > p { margin: 20px 0; color: var(--muted); font-size: 14px; }
.pdf-dropzone {
  min-height: 178px;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 26px;
  border: 2px dashed var(--field-border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--ink) !important;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.pdf-dropzone:hover, .pdf-dropzone:focus-within, .pdf-dropzone.is-dragging { border-color: var(--green); background: var(--green-pale); }
.pdf-dropzone.is-loading { cursor: wait; opacity: .75; }
.pdf-dropzone.has-file { border-style: solid; border-color: var(--green); }
.pdf-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pdf-dropzone strong { font-size: 19px; }
.pdf-dropzone span:last-of-type { color: var(--muted); font-size: 14px; }
/* Il pulsante "scatta ora" sta FUORI dal riquadro: dentro, la label lo
   trasformerebbe in un secondo modo di aprire il selettore di file. */
.pdf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.pdf-actions .button { padding: 9px 16px; font-size: 14px; }
.pdf-actions-note { color: var(--muted); font-size: 13px; }
.drop-icon { width: 38px; height: 38px; display: grid; place-items: center; margin: 0 auto 3px; border: 1px solid var(--green); border-radius: 50%; color: var(--green); font-size: 22px; }
.pdf-breakdown { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.pdf-file-row, .format-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.pdf-file-row { padding-bottom: 14px; }
.pdf-file-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.format-rows { border-top: 1px solid var(--line); }
.format-row { grid-template-columns: minmax(82px, .7fr) 1.3fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.format-row span:nth-child(2) { color: var(--muted); }
.format-row strong { font-family: "JetBrains Mono", monospace; }

.calibration-panel { margin-top: 28px; padding-top: 24px; border-top: 2px solid var(--ink); }
.calibration-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 18px; }
.calibration-head h3 { margin: 4px 0 0; font-size: 21px; }
.calibration-state { padding: 7px 10px; border: 1px solid var(--field-border); border-radius: 4px; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 12px; white-space: nowrap; }
.calibration-state.is-proposal { border-color: var(--amber); background: var(--amber-pale); color: var(--notice-text); }
.calibration-state.is-confirmed { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); }
.calibration-state.is-error { border-color: #b54b49; background: rgba(181,75,73,.08); color: #9b3533; }
.calibration-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(230px, .55fr); gap: 22px; align-items: start; }
.calibration-viewport { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--field-border); background: #e9ece9; user-select: none; }
.calibration-viewport.is-loading { min-height: 280px; cursor: wait; opacity: .65; }
.calibration-viewport canvas { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.calibration-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.calibration-line line { stroke: #d48320; stroke-width: 3; vector-effect: non-scaling-stroke; }
.calibration-point { position: absolute; z-index: 2; width: 38px; height: 38px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; color: #fff; font-family: "IBM Plex Mono", monospace; font-weight: 800; box-shadow: 0 1px 8px rgba(0,0,0,.35); cursor: grab; touch-action: none; }
.calibration-point:active { cursor: grabbing; }
.calibration-point-a { background: var(--green); }
.calibration-point-b { background: #d48320; }
.calibration-controls { min-width: 0; }
.calibration-measure { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.calibration-measure input { border-radius: 4px 0 0 4px; }
.calibration-measure span { min-height: 48px; display: grid; place-items: center; padding: 0 14px; border: 1px solid var(--field-border); border-left: 0; background: var(--surface-raised); color: var(--muted); }
.calibration-presets, .calibration-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.calibration-presets button { min-height: 38px; padding: 6px 10px; border: 1px solid var(--field-border); border-radius: 4px; background: var(--surface-raised); color: var(--ink); cursor: pointer; }
.calibration-actions .button { flex: 1 1 120px; padding: 10px 12px; }
.calibration-controls .form-status { min-height: 48px; margin: 14px 0 0; font-size: 14px; }
.calibration-controls small { margin-top: 14px; }

.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 76px; align-items: center; }
.registration-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: 64px; align-items: start; }
.auth-stack { min-width: 0; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); }
.auth-switch button { min-height: 42px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.auth-switch button.is-active { background: var(--ink); color: var(--paper); }
.auth-form { margin: 0; }
.pilot-note { margin-top: 28px; padding: 18px; border-left: 4px solid var(--amber); background: var(--amber-pale); color: var(--notice-text); }
.pilot-note p { margin: 5px 0 0; }
.inline-action { display: inline-block; margin-top: 10px; color: var(--green-dark); font-weight: 700; }
.ledger { border-top: 1px solid #43544b; }
.ledger-row { display: grid; grid-template-columns: 42px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid #43544b; }
.ledger-index { color: #8edbb1; font-family: "IBM Plex Mono", monospace; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.pay-method { padding: 8px 11px; border: 1px solid #50635a; border-radius: 4px; color: #d8e3dc; font-size: 14px; }
.pay-method-btc { border-color: #a66b22; color: #f2b35f; }
.welcome-credit { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 22px 0; padding: 14px; border: 1px solid #a66b22; border-radius: 5px; background: rgba(166,107,34,.12); color: #e5ece7; }
.welcome-credit strong { color: #f2b35f; font-family: "JetBrains Mono", monospace; font-size: 27px; }
.welcome-credit span { font-size: 14px; }

.request-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: 64px; align-items: start; }
.request-form {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.request-form small { color: var(--muted); }
.request-form .button { width: 100%; margin-top: 22px; }
.request-form .button:disabled { cursor: wait; opacity: .7; }
.file-picker { padding-block: 8px !important; }
.file-error, .form-error { color: var(--danger) !important; }
.checkbox-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; color: var(--ink-soft); font-size: 14px; }
.checkbox-row input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; accent-color: var(--green); }
.checkbox-row a { color: var(--green-dark); font-weight: 700; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 25px; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.form-success { margin-top: 16px; padding: 16px; border-left: 4px solid var(--green); background: var(--green-pale); color: var(--ink); }
.form-success p { margin: 4px 0 0; }
.selected-pdf { padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-raised); }
.selected-pdf strong { overflow-wrap: anywhere; }
.selected-pdf a { width: fit-content; color: var(--green-dark); font-size: 14px; font-weight: 700; }
.field input[readonly] { color: var(--ink-soft); background: color-mix(in srgb, var(--surface-raised) 80%, var(--line)); }

.private-head-section { background: var(--dark-section); color: var(--on-dark); }
.private-head-section .eyebrow { color: #77d5a6; }
.private-head-section .lead { margin-bottom: 0; color: #becbc4; }
.private-header { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
body.logged-in .account-session { display: none; }   /* doppione di chip+Esci in intestazione */
.account-session { min-width: 250px; display: grid; gap: 4px; padding-left: 26px; border-left: 1px solid #43544b; }
.account-session span { color: #aebcb4; font-size: 13px; }
.account-session strong { font-family: "Space Grotesk", sans-serif; }
.account-session code { margin-bottom: 10px; color: #8edbb1; font-family: "JetBrains Mono", monospace; }
.account-session .button-outline { border-color: #60736a; color: var(--on-dark); }
.private-welcome { display: flex; gap: 10px; margin-top: 28px; padding: 14px 18px; border-left: 4px solid #f1b45e; background: #203027; color: #e5ece7; }
.private-welcome strong { color: #f4bd73; }

.market-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.market-card { padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.market-card .mono { color: var(--blue); font-size: 12px; }
.market-card p { margin-bottom: 0; color: var(--muted); }

.notice {
  padding: 28px;
  border-left: 5px solid var(--amber);
  background: var(--amber-pale);
  color: var(--notice-text);
}
.notice h2 { font-size: 25px; }
.notice p:last-child { margin-bottom: 0; }
.policy-list { margin: 22px 0 0; padding: 0; list-style: none; }
.policy-list li { position: relative; padding: 10px 0 10px 28px; border-top: 1px solid color-mix(in srgb, var(--amber) 32%, transparent); }
.policy-list li::before { content: "✓"; position: absolute; left: 0; color: var(--amber); font-weight: 700; }

.cta-band { padding: 80px 0; background: var(--green-pale); }
.cta-row { display: flex; justify-content: space-between; gap: 48px; align-items: center; }
.cta-row h2 { max-width: 720px; margin-bottom: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pilot-status { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); font-weight: 600; }

.footer { padding: 44px 0; background: var(--footer-bg); color: #aebcb4; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 44px; }
.footer strong { color: var(--white); font-family: "Sora", sans-serif; }
.footer a { color: #c7d3cc; text-decoration: none; }
.footer a:hover { color: var(--white); }
.footer-links { display: grid; gap: 8px; }
.footer-bottom { margin-top: 38px; padding-top: 22px; border-top: 1px solid #2b3b32; font-size: 13px; }

.legal-page .site-header { position: sticky; top: 0; background: #101d17; }
.legal-main { padding: 70px 0 90px; }
.legal-head { max-width: 820px; margin-bottom: 48px; }
.legal-head h1 { font-size: 46px; }
.legal-meta { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 13px; }
.legal-prose { max-width: 860px; }
.legal-prose section { padding: 28px 0; border-top: 1px solid var(--line); }
.legal-prose h2 { font-size: 25px; }
.legal-prose h3 { margin-top: 24px; font-size: 18px; }
.legal-prose li { margin-bottom: 8px; }
.legal-prose a { color: var(--green-dark); font-weight: 700; }
.legal-callout { padding: 18px; border-left: 4px solid var(--amber); background: var(--amber-pale); color: var(--notice-text); }

/* La sezione italiana riprende tipografia, densita e palette del sito Studio. */
.studio-service {
  --green: #177a4e;
  --green-dark: #0f603c;
  --deep-green: #0b3f2c;
  font-family: "Archivo", sans-serif;
}
html[data-theme="dark"] .studio-service {
  --green: #3ecf8e;
  --green-dark: #6fe0ab;
  --deep-green: #0b3f2c;
  --primary-on: #07130d;
}
.studio-service .shell { width: min(1060px, calc(100% - 48px)); }
.studio-service h1, .studio-service h2, .studio-service h3,
.studio-service .brand-copy strong, .studio-service .proof-item strong,
.studio-service .price-total strong, .studio-service .footer strong { font-family: "Space Grotesk", sans-serif; }
.studio-service .eyebrow, .studio-service .mono, .studio-service .brand-mark,
.studio-service .step-number, .studio-service .contract-code,
.studio-service .price-line strong, .studio-service .ledger-index { font-family: "JetBrains Mono", monospace; }
.studio-service .section { padding: 64px 0; }
.studio-service .hero { min-height: min(76svh, 720px); }
.studio-service .hero-content { padding: 126px 0 72px; }
.studio-service .hero-copy { max-width: 650px; }
.studio-service h1 { font-size: 50px; }
.studio-service h2 { font-size: 32px; }
.studio-service .section-head { margin-bottom: 36px; }
.studio-service .workflow-step h3 { margin-top: 24px; }
.studio-service .calculator { box-shadow: none; }
.studio-service .cta-band { padding: 56px 0; }
.studio-service .footer { padding: 36px 0; }

/* Hub unico: catasto, APE e CADVERTO. */
.service-hub { background: var(--paper); }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.service-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(18, 39, 29, .06);
}
.service-card-featured { border-color: color-mix(in srgb, var(--green) 65%, var(--line)); }
.service-card-wide { grid-column: 1 / -1; min-height: 330px; }
.service-card-dark { background: var(--dark-section); color: var(--on-dark); }
.service-card-dark p, .service-card-dark .service-price span { color: #b9c9c0; }
.service-index { color: var(--green); font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.service-card-dark .service-index { color: #88dbb3; }
.service-icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 24px 0 20px; border: 1px solid var(--green); border-radius: 50%; color: var(--green); font-family: "JetBrains Mono", monospace; font-weight: 700; }
.service-card-dark .service-icon { border-color: #88dbb3; color: #88dbb3; }
.service-card h3 { font-size: 24px; }
.service-card p { color: var(--muted); }
.service-price { display: grid; margin: auto 0 20px; }
.service-price strong { color: var(--green-dark); font-family: "Space Grotesk", sans-serif; font-size: 29px; line-height: 1.1; }
.service-card-dark .service-price strong { color: #9ce2bc; }
.service-price span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.service-card .button { width: 100%; }
.service-actions { display: grid; gap: 9px; }
.service-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; padding: 0; list-style: none; }
.service-tags li { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: 13px; }
.public-option { display: grid; grid-template-columns: auto 1fr auto; gap: 18px 28px; align-items: center; margin-top: 22px; padding: 22px 24px; border-left: 4px solid var(--amber); background: var(--amber-pale); color: var(--notice-text); }
.public-option strong { font-family: "Space Grotesk", sans-serif; }
.public-option p { margin: 0; font-size: 14px; }
.public-option a { color: inherit; font-size: 14px; font-weight: 700; }

.service-dialog {
  width: min(900px, calc(100% - 32px));
  max-height: min(92svh, 940px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
}
.service-dialog::backdrop { background: rgba(5, 14, 10, .76); backdrop-filter: blur(7px); }
.dialog-shell { padding: 0 34px 34px; }
.dialog-head { position: sticky; top: 0; z-index: 4; display: flex; justify-content: space-between; align-items: start; gap: 24px; margin: 0 -34px; padding: 28px 34px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.dialog-head h2 { margin-bottom: 0; font-size: 30px; }
.dialog-head .eyebrow { margin-bottom: 5px; }
.dialog-close { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--ink); cursor: pointer; font-size: 28px; line-height: 1; }
.wizard-progress { height: 4px; margin: 0 -34px 24px; background: var(--line); }
.wizard-progress span { display: block; width: 25%; height: 100%; background: var(--green); transition: width .25s ease; }
.wizard-step-label { margin: 0 0 24px; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; text-transform: uppercase; }
.online-service-form { min-height: 480px; }
.wizard-step > h3 { margin-bottom: 9px; font-size: 25px; }
.wizard-step > .muted { margin-bottom: 26px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-actions [data-wizard-next], .wizard-actions [data-wizard-submit] { margin-left: auto; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { position: relative; display: grid; gap: 5px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.choice-card input { position: absolute; top: 18px; right: 18px; accent-color: var(--green); }
.choice-card strong { padding-right: 28px; }
.choice-card span { color: var(--muted); font-size: 14px; }
.field-space-top { margin-top: 22px; }
.conditional-panel { margin-top: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised); }
.recovery-panel > h3 { font-size: 20px; }
.inline-notice { display: grid; gap: 4px; margin-top: 22px; padding: 16px 18px; border-left: 4px solid var(--amber); background: var(--amber-pale); color: var(--notice-text); }
.quote-preview { display: grid; gap: 6px; padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--green-pale); }
.quote-preview strong { color: var(--green-dark); font-family: "Space Grotesk", sans-serif; font-size: 34px; line-height: 1.1; }
.quote-preview small { color: var(--ink-soft); }
.bitcoin-discount { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 600; }
.bitcoin-discount[hidden] { display: none; }
.bitcoin-discount output { color: var(--green); font: 700 18px/1.2 "Space Grotesk", sans-serif; }
.bitcoin-symbol { display: inline-grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #f7931a; color: #fff; font: 700 20px/1 "Space Grotesk", sans-serif; }
.bitcoin-success { color: var(--green-dark); font-weight: 700; }
.email-success { margin-top: .75rem; font-size: .92rem; line-height: 1.5; opacity: .85; }
.service-success { padding: 22px; border-left-width: 4px; }
.service-success h3 { margin-bottom: 7px; }
.service-success .download-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.service-success .button { width: auto; margin: 0; }
.online-service-form.is-submitting { opacity: .72; pointer-events: none; }
.online-service-form .field :invalid.user-invalid { border-color: var(--danger); outline-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.sound-pulse { animation: sound-pulse .24s ease; }
@keyframes sound-pulse { 50% { transform: scale(.92); } }

@media (max-width: 1080px) {
  h1 { font-size: 46px; }
  h2 { font-size: 33px; }
  .nav-links {
    position: fixed;
    inset: 76px 0 auto;
    display: none;
    padding: 22px 24px 28px;
    background: #101d17;
    border-bottom: 1px solid #395047;
  }
  .nav-links.open { display: grid; gap: 18px; }
  .nav-links .language-link { display: block; }
  .menu-button { display: grid; place-items: center; }
  .nav-actions .button { display: none; }
  .nav-actions > .language-link { display: none; }
  .proof-grid, .workflow-grid { grid-template-columns: repeat(2, 1fr); }
  .proof-item:nth-child(3) { border-left: 1px solid rgba(255,255,255,.14); }
  .outputs, .pricing-layout, .account-grid, .registration-layout, .request-layout, .private-header { grid-template-columns: 1fr; gap: 46px; }
  .calibration-layout { grid-template-columns: 1fr; }
  .account-session { padding: 18px 0 0; border-left: 0; border-top: 1px solid #43544b; }
  .market-grid { grid-template-columns: 1fr 1fr; }
  .public-option { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .shell { width: min(100% - 32px, 1180px); }
  .section { padding: 68px 0; }
  .section-head { display: block; margin-bottom: 34px; }
  h1 { font-size: 38px; }
  h2 { font-size: 29px; }
  .lead { font-size: 18px; }
  .brand-copy small { display: none; }
  .nav { gap: 12px; }
  .brand-copy strong { font-size: 15px; }
  .hero { min-height: 88svh; }
  .hero-media { object-position: 56% center; }
  .hero-shade { background: rgba(10, 18, 14, 0.72); }
  .hero-content { padding: 118px 0 70px; }
  .hero-actions, .hero-actions .button { width: 100%; }
  .proof-grid, .workflow-grid, .state-grid, .market-grid, .field-grid, .footer-grid { grid-template-columns: 1fr; }
  .proof-item, .proof-item:nth-child(3), .proof-item:last-child { border: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .workflow-step, .workflow-step + .workflow-step { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-step h3 { margin-top: 18px; }
  .contract-list li { grid-template-columns: 1fr; gap: 8px; }
  .calculator { padding: 22px 18px; }
  .price-total strong { font-size: 29px; }
  .price-line { align-items: start; }
  .price-line strong { flex: 0 0 auto; }
  .format-row { grid-template-columns: 1fr auto; }
  .format-row span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .calibration-head { display: grid; }
  .calibration-state { justify-self: start; }
  .calibration-viewport.is-loading { min-height: 180px; }
  .rate-head, .rate-row { grid-template-columns: minmax(130px, 1fr) repeat(3, 58px); gap: 8px; font-size: 14px; }
  .private-welcome { display: grid; }
  .cta-row { display: block; }
  .cta-actions { margin-top: 28px; }
  .cta-actions .button { width: 100%; }
  .pilot-status { width: 100%; justify-content: center; text-align: center; }
  .studio-service .shell { width: min(100% - 32px, 1060px); }
  .studio-service .section { padding: 52px 0; }
  .studio-service .hero { min-height: 82svh; }
  .studio-service .hero-content { padding: 112px 0 62px; }
  .studio-service h1 { font-size: 38px; }
  .studio-service h2 { font-size: 28px; }
  .service-grid, .choice-grid { grid-template-columns: 1fr; }
  .service-card, .service-card-wide { min-height: 0; padding: 24px; }
  .service-card-wide { grid-column: auto; }
  .service-price { margin-top: 18px; }
  .service-dialog { width: 100%; max-width: none; max-height: 100svh; height: 100svh; margin: 0; border: 0; border-radius: 0; }
  .dialog-shell { padding: 0 18px 28px; }
  .dialog-head { margin: 0 -18px; padding: 20px 18px 14px; }
  .dialog-head h2 { font-size: 24px; }
  .wizard-progress { margin-inline: -18px; }
  .wizard-actions { position: sticky; bottom: 0; z-index: 3; margin-inline: -18px; padding: 14px 18px; background: var(--surface); }
  .wizard-actions .button { flex: 1; padding-inline: 10px; }
  .conditional-panel { padding: 17px; }
  .legal-main { padding: 46px 0 64px; }
  .legal-head h1 { font-size: 34px; }
}

@media (max-width: 420px) {
  .shell { width: min(100% - 24px, 1180px); }
  h1 { font-size: 34px; }
  h2 { font-size: 27px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .menu-button, .theme-toggle { width: 40px; height: 40px; flex-basis: 40px; }
  .proof-item { padding-inline: 8px; }
  .price-line { gap: 12px; font-size: 15px; }
}

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


/* Verdetto del contratto di acquisizione (docs/contratto-acquisizione-alfa.md).
   Il "da rifare" deve distinguersi a colpo d'occhio dall'accettato, e
   l'immagine di evidenza deve stare nel riquadro senza sfondare la colonna. */
.acquisizione-esito {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 63, 46, 0.18);
  background: rgba(15, 63, 46, 0.05);
  display: grid;
  gap: 0.5rem;
}
.acquisizione-esito.is-da-rifare {
  border-color: rgba(176, 88, 14, 0.45);
  background: rgba(230, 150, 60, 0.12);
}
.acquisizione-evidenza {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
