/* Layout: testata fissa, apertura scura a griglia da tavola tecnica con "banco" (file in ingresso + documenti in uscita), poi fasce alternate. Ogni reparto ha il suo colore (--r) che torna su schede, pagine servizi ed esempi. */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EDF1F5;
  --ink: #0E1823;
  --muted: #55636F;
  --line: #D5DCE4;
  --brand: #C8440F;
  --brand-ink: #FFFFFF;
  --brand-text: #B8400D;
  --brand-soft: #FBEADF;
  --uff: #1C5FB8;  --uff-soft: #E3EEFB;
  --off: #B4500F;  --off-soft: #FBEADF;
  --doc: #0F7A6C;  --doc-soft: #DDF3EF;
  --mis: #6B46C1;  --mis-soft: #EDE7FB;
  --ok: #1E7A46;
  --warn: #B45309;
  --shadow: rgba(14, 24, 35, 0.16);
  /* Fasce scure: uguali nei due temi */
  --dark: #0B1520;
  --dark-2: #122030;
  --dark-line: #22344A;
  --dark-ink: #EEF3F8;
  --dark-muted: #A3B3C4;
  --dark-hi: #FF8A4C;
  --card: #FFFFFF;
  --card-ink: #0E1823;
  --card-muted: #55636F;
  --r: var(--brand-text);
  --r-soft: var(--brand-soft);
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D141B; --surface: #141D27; --surface-2: #1A2531; --ink: #E8EDF2; --muted: #9BA8B5; --line: #283544;
    --brand: #FF8A4C; --brand-ink: #1D0F05; --brand-text: #FF9A5C; --brand-soft: #3A2F29;
    --uff: #8DB9F4; --uff-soft: #213148; --off: #FF9A5C; --off-soft: #3A2F29; --doc: #5FD0BE; --doc-soft: #1C353A; --mis: #B8A4F2; --mis-soft: #2A2444;
    --ok: #6FCF97; --warn: #F5B454; --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D141B; --surface: #141D27; --surface-2: #1A2531; --ink: #E8EDF2; --muted: #9BA8B5; --line: #283544;
  --brand: #FF8A4C; --brand-ink: #1D0F05; --brand-text: #FF9A5C; --brand-soft: #3A2F29;
  --uff: #8DB9F4; --uff-soft: #213148; --off: #FF9A5C; --off-soft: #3A2F29; --doc: #5FD0BE; --doc-soft: #1C353A; --mis: #B8A4F2; --mis-soft: #2A2444;
  --ok: #6FCF97; --warn: #F5B454; --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
.r-uff { --r: var(--uff); --r-soft: var(--uff-soft); }
.r-off { --r: var(--off); --r-soft: var(--off-soft); }
.r-doc { --r: var(--doc); --r-soft: var(--doc-soft); }
.r-mis { --r: var(--mis); --r-soft: var(--mis-soft); }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(3rem, 7.4vw, 5.75rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2.1rem, 3.8vw, 3rem); }
h3 { font-size: 1.55rem; line-height: 1.12; }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--brand-text); text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; border-radius: 3px; }

.wrap {
  max-width: 74rem;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.tag { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: 1.1875rem; line-height: 1.5; max-width: 38rem; }
.muted { color: var(--muted); }

/* Icone */
.ic { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tile { width: 3rem; height: 3rem; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--r-soft); color: var(--r); }
.tile .ic { width: 1.5rem; height: 1.5rem; }
.tile.big { width: 3.75rem; height: 3.75rem; border-radius: 12px; }
.tile.big .ic { width: 1.9rem; height: 1.9rem; }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.2;
  padding: 0.9rem 1.4rem; border-radius: 8px; border: 1.5px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.on-dark.ghost { border-color: var(--dark-line); color: var(--dark-ink); }
.btn.on-dark.ghost:hover { border-color: var(--dark-ink); }
.btn.small { padding: 0.6rem 1rem; font-size: 0.9375rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.freccia { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; text-decoration: none; color: var(--r); }
.freccia .ic { width: 1.1rem; height: 1.1rem; transition: transform 0.15s ease; }
.freccia:hover .ic { transform: translateX(3px); }

/* Testata */
.head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; padding-block: 0.8rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; letter-spacing: 0.01em; color: var(--ink); text-decoration: none; line-height: 1; }
.brand svg { width: 1.9rem; height: 1.9rem; flex: none; }
.brand-mark { fill: var(--brand); }
.nav { display: flex; align-items: center; gap: 0.35rem 1.6rem; flex-wrap: wrap; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.9375rem; padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"]:not(.btn) { border-bottom-color: var(--brand); }
.menu-btn { display: none; font: 600 0.9375rem var(--font-body); color: var(--ink); background: transparent; border: 1.5px solid var(--line); border-radius: 8px; padding: 0.5rem 0.9rem; cursor: pointer; }

/* Fasce */
.band { padding-block: 5.5rem; }
.band.alt { background: var(--surface); border-block: 1px solid var(--line); }
.band-head { display: flex; flex-direction: column; gap: 0.8rem; max-width: 44rem; margin-bottom: 3rem; }
.band-head.center { margin-inline: auto; text-align: center; align-items: center; }
.band-head p:not(.tag) { color: var(--muted); font-size: 1.0625rem; }
.band-head .tag { color: var(--brand-text); }

/* Fasce scure a griglia */
.dark { position: relative; background: var(--dark); color: var(--dark-ink); overflow: hidden; }
.dark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--dark-line) 1px, transparent 1px), linear-gradient(90deg, var(--dark-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 78% 35%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 90% at 78% 35%, #000 0%, transparent 72%);
  opacity: 0.75;
}
.dark::after {
  content: ""; position: absolute; width: 46rem; height: 46rem; right: -14rem; top: -18rem; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 138, 76, 0.2), transparent);
}
.dark > .wrap { position: relative; z-index: 1; }
.dark .tag { color: var(--dark-muted); }

/* Apertura */
.hero { padding-block: 4.5rem 6rem; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 3.5rem; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.4rem 0.8rem; border: 1px solid var(--dark-line); border-radius: 999px; background: var(--dark-2); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dark-muted); }
.pill::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--dark-hi); }
.hero h1 em { font-style: normal; color: var(--dark-hi); }
.hero .lead { color: var(--dark-muted); }
.hero .lead strong { color: var(--dark-ink); font-weight: 500; }
.formati { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.9rem; padding-top: 0.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips span { font-family: var(--font-mono); font-size: 0.8125rem; padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.dark .chips span { border-color: var(--dark-line); background: var(--dark-2); color: var(--dark-ink); }

.bench { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.bench-step { display: flex; align-items: center; gap: 0.7rem; font-weight: 600; font-size: 1.0625rem; color: var(--dark-ink); }
.bench-n { width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--dark-hi); color: #1D0F05; font-family: var(--font-display); font-size: 1.15rem; line-height: 1; }
.bench-arrow { display: flex; align-items: center; gap: 0.75rem; padding: 0.35rem 0 0.35rem 0.2rem; color: var(--dark-muted); font-size: 0.9375rem; }
.bench-arrow .ic { width: 1.4rem; height: 1.4rem; color: var(--dark-hi); transform: rotate(90deg); }
.win { background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: 12px; overflow: hidden; box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.8); }
.outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.out { display: flex; flex-direction: column; gap: 0.3rem; background: var(--dark-2); color: var(--dark-ink); border: 1px solid var(--dark-line); border-radius: 12px; padding: 0.95rem; box-shadow: 0 24px 40px -26px rgba(0, 0, 0, 0.8); min-width: 0; }
.out .tile { margin-bottom: 0.35rem; }
.win-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--dark-line); font-family: var(--font-mono); font-size: 0.75rem; color: var(--dark-muted); }
.win-bar i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--dark-line); }
.win-bar span { margin-left: 0.5rem; }
.win svg { display: block; width: 100%; height: auto; }
.out .tile { width: 2.5rem; height: 2.5rem; border-radius: 8px; }
.out .tile .ic { width: 1.25rem; height: 1.25rem; }
.out.o-uff .tile { background: #1B3050; color: #8DB9F4; }
.out.o-off .tile { background: #3A2A1E; color: #FF9A5C; }
.out.o-doc .tile { background: #17373A; color: #5FD0BE; }
.out strong { display: block; font-size: 0.9375rem; line-height: 1.25; }
.out small { display: block; font-size: 0.8125rem; line-height: 1.35; color: var(--dark-muted); }

/* Disegno tecnico (colori dal contesto) */
.dw { --dw-ink: var(--ink); --dw-muted: var(--muted); --dw-fill: var(--surface-2); --dw-acc: var(--brand-text); --dw-paper: var(--surface); }
.win .dw { --dw-ink: #DCE6F0; --dw-muted: #7F93A8; --dw-fill: #18293B; --dw-acc: #FF8A4C; --dw-paper: #122030; }
.dw-part { fill: var(--dw-fill); stroke: var(--dw-ink); stroke-width: 1.6; }
.dw-edge { fill: none; stroke: var(--dw-ink); stroke-width: 1.2; }
.dw-center { fill: none; stroke: var(--dw-muted); stroke-width: 1; stroke-dasharray: 14 4 2 4; }
.dw-dim { fill: none; stroke: var(--dw-muted); stroke-width: 1; }
.dw-fill { fill: var(--dw-muted); }
.dw-text { fill: var(--dw-ink); font-family: var(--font-mono); font-size: 12px; }
.dw-balloon { fill: var(--dw-paper); stroke: var(--dw-acc); stroke-width: 1.5; }
.dw-bnum { fill: var(--dw-acc); font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.dw-lead { fill: none; stroke: var(--dw-acc); stroke-width: 1.2; }
.dw-dot { fill: var(--dw-acc); }

/* Striscia dei fatti */
.fatti { background: var(--surface); border-bottom: 1px solid var(--line); }
.fatti ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fatti li { display: flex; align-items: center; gap: 0.85rem; padding: 1.4rem 1.25rem; border-left: 1px solid var(--line); min-width: 0; }
.fatti li:first-child { border-left: 0; padding-left: 0; }
.fatti .ic { width: 1.6rem; height: 1.6rem; color: var(--brand-text); }
.fatti strong { display: block; line-height: 1.25; }
.fatti span { display: block; font-size: 0.875rem; color: var(--muted); }

/* Schema file -> documenti */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 3.5rem minmax(0, 1.05fr) 3.5rem minmax(0, 1fr); align-items: center; gap: 0.75rem; }
.flow-col { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.flow-list { display: grid; gap: 0.55rem; }
.flow-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.95rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 500; }
.flow-list .ic { color: var(--muted); }
.flow-col.fuori .flow-list li { border-color: transparent; background: var(--brand-soft); }
.flow-col.fuori .flow-list .ic { color: var(--brand-text); }
.flow-arrow { display: grid; place-items: center; color: var(--brand-text); }
.flow-arrow .ic { width: 2rem; height: 2rem; }
.flow-mid { background: var(--dark); color: var(--dark-ink); border-radius: 16px; padding: 2rem 1.75rem; display: flex; flex-direction: column; gap: 1.25rem; box-shadow: 0 30px 50px -30px var(--shadow); min-width: 0; }
.flow-mid .brand { color: var(--dark-ink); font-size: 2rem; }
.flow-mid .brand-mark { fill: var(--dark-hi); }
.flow-mid ul { display: grid; gap: 0.9rem; }
.flow-mid li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem; align-items: start; }
.flow-mid .ic { color: var(--dark-hi); width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; }
.flow-mid strong { display: block; }
.flow-mid span { color: var(--dark-muted); font-size: 0.9375rem; }

/* Reparti */
.reparti { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.reparto { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-width: 0; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.reparto:hover { transform: translateY(-4px); border-color: var(--r); box-shadow: 0 26px 44px -26px var(--shadow); }
.reparto-top { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.6rem 1.6rem 1.4rem; background: var(--r-soft); }
.reparto-top .tile { background: var(--surface); }
.reparto-top .tag { color: var(--r); }
.reparto-top p { color: var(--ink); opacity: 0.82; }
.reparto ul { display: grid; gap: 0; padding: 0.6rem 1.6rem; flex: 1; align-content: start; }
.reparto li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 0.75rem; align-items: center; padding-block: 0.6rem; border-top: 1px solid var(--line); }
.reparto li:first-child { border-top: 0; }
.reparto li .ic { color: var(--r); }
.reparto-foot { padding: 1.1rem 1.6rem 1.5rem; }

/* Oggi / Con Metalogica */
.confronto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
.confronto > div { border-radius: 16px; padding: 1.75rem; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.confronto > div.dopo { border: 2px solid var(--brand); box-shadow: 0 26px 44px -30px var(--shadow); }
.confronto h3 { margin-bottom: 1rem; }
.confronto li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.8rem; padding-block: 0.85rem; border-top: 1px solid var(--line); }
.confronto li strong { display: block; font-size: 0.8125rem; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.confronto .prima .ic { color: var(--muted); }
.confronto .dopo .ic { color: var(--ok); }
.confronto .prima li span { color: var(--muted); }

/* Per chi */
.chi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.chi > div { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.75rem; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); min-width: 0; }
.chi p { color: var(--muted); }
.chi ul { display: grid; gap: 0.4rem; font-size: 0.9375rem; padding-top: 0.5rem; margin-top: auto; border-top: 1px solid var(--line); }
.chi li { display: flex; align-items: center; gap: 0.5rem; }
.chi li .ic { width: 1rem; height: 1rem; color: var(--brand-text); }

/* Passi */
.passi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; counter-reset: passo; }
.passi.quattro { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
.passi li { counter-increment: passo; position: relative; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.passi li::before { content: counter(passo); width: 3.25rem; height: 3.25rem; border-radius: 50%; display: grid; place-items: center; margin-bottom: 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; color: var(--brand-ink); background: var(--brand); position: relative; z-index: 1; }
.passi li:not(:last-child)::after { content: ""; position: absolute; top: 1.6rem; left: 3.25rem; right: -2.5rem; height: 2px; background: var(--line); }
.passi.quattro li:not(:last-child)::after { right: -2rem; }
.passi strong { font-size: 1.125rem; }
.passi span { color: var(--muted); }
.dopo-passi { margin-top: 2.5rem; }

/* Impegni */
.impegni { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.impegni.due-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.impegni li { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.band.alt .impegni li { background: var(--bg); }
.impegni strong { font-size: 1.0625rem; line-height: 1.3; }
.impegni span { color: var(--muted); font-size: 0.9375rem; }

/* Invito finale */
.cta { padding-block: 4.5rem; }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-in > div { display: flex; flex-direction: column; gap: 0.8rem; max-width: 40rem; min-width: 0; }
.cta p { color: var(--dark-muted); font-size: 1.0625rem; }

/* Piede */
.foot { background: var(--dark); color: var(--dark-muted); border-top: 1px solid var(--dark-line); padding-block: 3.5rem 2rem; font-size: 0.9375rem; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
.foot-in > div { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.foot .brand { color: var(--dark-ink); }
.foot .brand-mark { fill: var(--dark-hi); }
.foot .tag { color: var(--dark-muted); }
.foot ul { display: grid; gap: 0.4rem; }
.foot a { color: var(--dark-ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot code { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--dark-ink); user-select: all; overflow-wrap: anywhere; }
.foot-fine { margin-top: 2.75rem; padding-top: 1.25rem; border-top: 1px solid var(--dark-line); display: flex; justify-content: space-between; gap: 0.5rem 2rem; flex-wrap: wrap; font-size: 0.8125rem; }

/* Pagine interne */
.page-hero { padding-block: 4rem 3.5rem; }
.page-hero .wrap { display: flex; flex-direction: column; gap: 1.2rem; }
.page-hero h1 { font-size: clamp(2.75rem, 5.6vw, 4.5rem); max-width: 18ch; }
.page-hero .lead { color: var(--dark-muted); }
.page-hero .crumb { display: inline-flex; align-items: center; gap: 0.9rem; }
.page-hero .tile { background: var(--dark-2); border: 1px solid var(--dark-line); color: var(--dark-hi); }
.indice { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 0.5rem; }
.indice a { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.875rem; font-weight: 500; text-decoration: none; color: var(--dark-ink); padding: 0.45rem 0.8rem; border: 1px solid var(--dark-line); border-radius: 999px; background: var(--dark-2); }
.indice a:hover { border-color: var(--dark-hi); }
.indice .ic { width: 1rem; height: 1rem; color: var(--dark-hi); }

.serv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 4.5rem; align-items: center; padding-block: 4rem; border-top: 1px solid var(--line); scroll-margin-top: 5rem; }
.serv:first-child { border-top: 0; padding-top: 0; }
.serv:last-child { padding-bottom: 0; }
.serv:nth-child(even) .serv-text { order: 2; }
.serv-text { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.serv-n { display: flex; align-items: center; gap: 0.9rem; }
.serv-n .tag { color: var(--r); font-size: 0.8125rem; }
.serv h2 { font-size: clamp(2rem, 3.2vw, 2.6rem); }
.problema { color: var(--muted); font-size: 1.0625rem; }
.io { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.io > div { display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); gap: 1rem; padding: 0.95rem 1.1rem; }
.io > div + div { border-top: 1px solid var(--line); background: var(--r-soft); }
.io dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 0.2rem; }
.io > div + div dt { color: var(--r); }
.serv-mock { background: var(--r-soft); border-radius: 20px; padding: 2.25rem; min-width: 0; display: grid; }

/* Documenti di esempio */
.doc { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 22px 40px -24px var(--shadow); padding: 1.1rem 1.2rem 1.25rem; font-size: 0.8125rem; min-width: 0; }
.doc-h { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding-bottom: 0.65rem; margin-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.doc-h strong { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1.1; }
.doc-h .tag { font-size: 0.6875rem; white-space: nowrap; }
.doc-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.3rem 1rem; font-family: var(--font-mono); }
.doc-kv dt { color: var(--muted); }
.doc-kv dd { text-align: right; font-variant-numeric: tabular-nums; }
.doc-kv .tot { font-weight: 600; color: var(--r); font-size: 0.9375rem; }
.doc-scroll { overflow-x: auto; }
.doc-t { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.doc-t th { text-align: left; font-weight: 400; color: var(--muted); padding: 0 0.6rem 0.35rem 0; white-space: nowrap; }
.doc-t td { padding: 0.32rem 0.6rem 0.32rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.doc-t th:last-child, .doc-t td:last-child { padding-right: 0; }
.doc-t .num { text-align: right; }
.doc-t .ok { color: var(--ok); font-weight: 600; }
.doc-t .best { color: var(--r); font-weight: 600; }
.doc-note { margin-top: 0.7rem; font-family: var(--font-mono); color: var(--muted); }
.doc-list { display: grid; gap: 0.55rem; }
.doc-list li { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); gap: 0.6rem; align-items: start; }
.doc-list .ic { width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; }
.doc-list .warn { color: var(--warn); }
.doc-list .ok { color: var(--ok); }
.doc-list strong { display: block; }
.doc-list span { color: var(--muted); }
.doc-idx { font-family: var(--font-mono); display: grid; gap: 0.25rem; }
.doc-idx li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted var(--line); padding-bottom: 0.2rem; }
.doc-idx li span:last-child { color: var(--muted); }
.doc-code { margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.6; background: var(--dark); color: #DCE6F0; border-radius: 8px; padding: 0.9rem 1rem; overflow-x: auto; white-space: pre; }
.doc-code i { font-style: normal; color: #7F93A8; }
.doc-code b { font-weight: 500; color: #FF8A4C; }
.doc svg.dw { display: block; width: 100%; height: auto; margin-bottom: 0.8rem; }
.chat { display: grid; gap: 0.7rem; font-size: 0.875rem; }
.chat p { max-width: 88%; padding: 0.7rem 0.9rem; border-radius: 12px; }
.chat .q { justify-self: end; background: var(--surface-2); border-bottom-right-radius: 3px; }
.chat .a { background: var(--r-soft); border-bottom-left-radius: 3px; }
.chat .a small { display: block; margin-top: 0.4rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--r); }
.passaggio { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.passaggio div { border: 1px dashed var(--line); border-radius: 8px; padding: 0.7rem; text-align: center; font-family: var(--font-mono); overflow-wrap: anywhere; min-width: 0; }
.passaggio div + .ic + div { border-style: solid; border-color: var(--r); color: var(--r); }
.passaggio .ic { color: var(--r); width: 1.5rem; height: 1.5rem; }

.altri { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.altri a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.1rem; align-items: center; padding: 1.5rem; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); background: var(--bg); min-width: 0; transition: border-color 0.2s ease, transform 0.2s ease; }
.altri a:hover { border-color: var(--r); transform: translateY(-2px); }
.altri strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.15; }
.altri span span { display: block; color: var(--muted); font-size: 0.9375rem; }

/* Metodo */
.due { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.due > div { padding: 1.9rem; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.due-h { display: flex; align-items: center; gap: 0.9rem; }
.elenco { display: grid; gap: 0.65rem; }
.elenco li { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); gap: 0.65rem; align-items: start; }
.elenco .ic { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; color: var(--r); }
.faq { max-width: 50rem; border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 1.2rem 2.5rem 1.2rem 0; font-weight: 600; font-size: 1.0625rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.95rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); font-family: var(--font-mono); font-size: 1.1rem; font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 2.5rem 1.35rem 0; color: var(--muted); max-width: 44rem; }

/* Contatti */
.contatti { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.contatti > div { display: flex; flex-direction: column; gap: 1.6rem; min-width: 0; }
.contatti h2 { font-size: 2rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 0.5rem; }
legend { padding: 0; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--r); }
legend .ic { width: 1.1rem; height: 1.1rem; }
.pick { display: grid; grid-template-columns: 1.15rem 1.3rem minmax(0, 1fr); gap: 0.75rem; align-items: center; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.pick:hover { border-color: var(--r); }
.pick:has(input:checked) { border-color: var(--r); background: var(--r-soft); }
.pick input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--r); cursor: pointer; }
.pick .ic { color: var(--r); }
.invio { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 5.5rem); padding: 1.75rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 26px 44px -30px var(--shadow); }
textarea { width: 100%; min-height: 15rem; resize: vertical; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.5; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem; margin-top: 0.4rem; }
.mail { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.9rem 1rem; border-radius: 10px; background: var(--brand-soft); }
.mail code { font-family: var(--font-mono); font-size: 1.0625rem; font-weight: 600; user-select: all; overflow-wrap: anywhere; }
.stato { font-size: 0.875rem; color: var(--muted); min-height: 1.3em; }

@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding-top: 0.5rem; }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding-block: 0.55rem; font-size: 1rem; }
  .nav .btn { margin-top: 0.5rem; }
  .band { padding-block: 3.75rem; }
  .band-head { margin-bottom: 2.25rem; }
  .hero { padding-block: 3rem 4rem; }
  .hero-in, .contatti, .serv, .confronto { grid-template-columns: minmax(0, 1fr); }
  .hero-in { gap: 3rem; }
  .serv { padding-block: 3rem; gap: 1.75rem; }
  .serv:nth-child(even) .serv-text { order: 0; }
  .reparti, .chi, .passi, .passi.quattro, .altri, .due, .impegni.due-col { grid-template-columns: minmax(0, 1fr); }
  .impegni { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .passi, .passi.quattro { gap: 2rem; }
  .passi li::after { display: none; }
  .fatti ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fatti li { border-left: 0; padding-inline: 0 1rem; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-arrow .ic { transform: rotate(90deg); }
  .foot-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invio { position: static; }
  .serv-mock { padding: 1.25rem; border-radius: 16px; }
}
@media (max-width: 560px) {
  .impegni, .fatti ul, .foot-in { grid-template-columns: minmax(0, 1fr); }
  .fatti li { padding-block: 0.9rem; border-top: 1px solid var(--line); }
  .fatti li:first-child { border-top: 0; }
  .io > div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .altri a { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .reparto, .altri a, .freccia .ic { transition: none; }
}

/* Il nodo centrale dello schema resta leggibile anche su fondo scuro */
.flow-mid { border: 1px solid color-mix(in srgb, var(--dark-hi) 45%, transparent); }

/* Nomi dei file su una riga sola anche su telefono */
@media (max-width: 560px) {
  .passaggio { gap: 0.5rem; }
  .passaggio div { font-size: 0.75rem; padding: 0.6rem 0.35rem; }
  .passaggio .ic { width: 1.2rem; height: 1.2rem; }
}

/* Apertura su telefono: i tre documenti in colonna, icona a sinistra */
@media (max-width: 560px) {
  .outs { grid-template-columns: minmax(0, 1fr); }
  .out { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.8rem; row-gap: 0; align-items: center; }
  .out .tile { grid-row: span 2; margin-bottom: 0; }
}

/* Prezzi */
.prezzo { align-self: flex-start; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem; padding: 0.4rem 0.85rem; border-radius: 999px; background: var(--r-soft); font-size: 0.9375rem; }
.prezzo strong { color: var(--r); font-size: 1.0625rem; }
.prezzi-home { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.prezzi-home a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1.3rem 1.4rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--ink); min-width: 0; transition: border-color 0.2s ease, transform 0.2s ease; }
.band.alt .prezzi-home a { background: var(--bg); }
.prezzi-home a:hover { border-color: var(--r); transform: translateY(-2px); }
.prezzi-home .nome { display: block; font-weight: 500; line-height: 1.3; }
.prezzi-home .cifra { display: block; font-family: var(--font-display); font-weight: 600; font-size: 2rem; line-height: 1.1; color: var(--r); }
.prezzi-home .cifra small { font-family: var(--font-body); font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.prezzi-note { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; }
.prezzi-note ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; color: var(--muted); font-size: 0.9375rem; }
.prezzi-note li { display: flex; align-items: center; gap: 0.45rem; }
.prezzi-note li .ic { width: 1rem; height: 1rem; color: var(--ok); }
.listino { margin-bottom: 3.5rem; }
.listino:last-child { margin-bottom: 0; }
.listino-h { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.listino-h h2 { font-size: 2rem; }
.listino-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.listino-t { width: 100%; border-collapse: collapse; }
.listino-t th { text-align: left; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.8rem 1.25rem; background: var(--r-soft); color: var(--r); }
.listino-t td { padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); vertical-align: middle; }
.listino-t td:first-child { font-weight: 500; }
.listino-t td:first-child a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.7rem; }
.listino-t td:first-child a:hover { text-decoration: underline; }
.listino-t td .ic { color: var(--r); }
.listino-t td:nth-child(2) { color: var(--muted); }
.listino-t .num { text-align: right; white-space: nowrap; }
.listino-t td.num strong { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1; color: var(--r); }
.listino-t td.num small { display: none; color: var(--muted); font-size: 0.8125rem; white-space: normal; }
@media (max-width: 1100px) {
  .nav { column-gap: 1.1rem; }
}
@media (max-width: 960px) {
  .prezzi-home { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .listino-t th:nth-child(2), .listino-t td:nth-child(2) { display: none; }
  .listino-t td.num small { display: block; }
  .listino-t th, .listino-t td { padding-inline: 0.9rem; }
}

/* Modulo di richiesta */
.modulo .invio { position: static; }
.campi { display: grid; gap: 1rem; }
.campi-due { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.campo { display: grid; gap: 0.35rem; min-width: 0; }
.campo label { font-weight: 500; font-size: 0.9375rem; }
.campo input[type="text"], .campo input[type="email"], .campo input[type="tel"], .campo textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.85rem; }
.campo input:focus-visible, .campo textarea:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.modulo textarea { min-height: 6.5rem; margin-top: 0; font-family: var(--font-body); font-size: 1rem; }
.campo input[type="file"] { font: inherit; font-size: 0.9375rem; color: var(--ink); padding: 0.6rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); width: 100%; min-width: 0; }
.campo input[type="file"]::file-selector-button { font: 600 0.875rem var(--font-body); margin-right: 0.8rem; padding: 0.45rem 0.8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.campo small { font-size: 0.8125rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consenso { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); gap: 0.7rem; align-items: start; font-size: 0.9375rem; cursor: pointer; }
.consenso input { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; accent-color: var(--brand); }
.avviso { padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.9375rem; border: 1px solid var(--line); }
.avviso.errore { border-color: var(--warn); background: var(--brand-soft); }
.avviso.nota { border-color: var(--uff); background: var(--uff-soft); }
.modulo .mail { background: transparent; padding: 1.1rem 0 0; border-top: 1px solid var(--line); border-radius: 0; }
.modulo .mail code { font-size: 1rem; }

/* Pagine di solo testo */
.testo { max-width: 46rem; display: grid; gap: 1rem; }
.testo h2 { font-size: 1.9rem; margin-top: 1.5rem; }
.testo h2:first-child { margin-top: 0; }
mark { background: var(--brand-soft); color: var(--brand-text); padding: 0 0.3rem; border-radius: 4px; font-weight: 600; }
@media (max-width: 560px) {
  .campi-due { grid-template-columns: minmax(0, 1fr); }
}

/* Automazione su misura: blocco a tutta larghezza sotto i tre reparti */
.misura { margin-top: 1.5rem; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.misura-top { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.75rem; background: var(--r-soft); min-width: 0; }
.misura-top .tile { background: var(--surface); }
.misura-top .tag { color: var(--r); }
.misura-top p { opacity: 0.85; }
.misura-top .freccia { margin-top: auto; padding-top: 0.5rem; }
.misura-voci { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
.misura-voci a { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.75rem; border-left: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; transition: background 0.2s ease; }
.misura-voci a:hover { background: var(--r-soft); }
.misura-voci strong { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; line-height: 1.15; }
.misura-voci span.desc { color: var(--muted); font-size: 0.9375rem; }
.misura-voci .prezzo { margin-top: auto; }
.altri { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
@media (max-width: 960px) {
  .misura, .misura-voci { grid-template-columns: minmax(0, 1fr); }
  .misura-voci a { border-left: 0; border-top: 1px solid var(--line); }
}
