/* BABEL – Piattaforma per i flussi documentali
   Colori ricavati dalle schermate dell'applicazione (barra e pulsanti prugna,
   testi e superfici slate). Carattere: Titillium Web, self-hosted (SIL OFL).
   Superfici scure in melanzana ("notte") con accento rosa.
   Negli artefatti grafici ogni colore ha un significato fisso: prugna = Babel,
   blu = enti e utenti, verde acqua = NEXT srl e servizi, ambra = sistemi
   esterni e proposte, verde = esito registrato. */

@font-face {
  font-family: "Titillium Web";
  src: url("fonts/titillium-web-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Titillium Web";
  src: url("fonts/titillium-web-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Titillium Web";
  src: url("fonts/titillium-web-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Token ------------------------------------------------------------------ */
/* Prugna dell'applicazione per azioni e accenti; melanzana ("notte") per le
   superfici scure: intestazione, apertura della home, percorso, invito e piè
   di pagina. Neutri leggermente tinti di prugna. */

:root {
  color-scheme: light dark;

  --plum: #993366;          /* barra e pulsanti dell'applicazione */
  --plum-hover: #7a2952;
  --plum-deep: #5c1f3d;
  --notte: #2a0f22;         /* superfici scure */
  --notte-2: #3b1630;
  --notte-3: #1d0a17;
  --notte-line: rgb(255 255 255 / 0.14);
  --rosa: #f3bfd6;          /* accento sulle superfici scure */

  --bg: #ffffff;
  --surface: #f7f5f8;
  --surface-2: #efeaf0;
  --line: #e4dde6;
  --ink: #1f1823;
  --text: #3d3542;
  --muted: #6a6170;
  --tint: #faf5f7;          /* riga selezionata nelle tabelle dell'app */
  --tint-line: #ead6e0;

  --accent: var(--plum);    /* link, marcatori, bordi di accento */
  --header-bg: var(--notte);
  --band-bg: var(--notte);
  --button-bg: var(--plum);
  --button-hover: var(--plum-hover);
  --button-ink: #ffffff;
  --focus: var(--plum);
  --shadow: 0 1px 2px rgb(31 24 35 / 0.06), 0 12px 28px -14px rgb(31 24 35 / 0.24);

  /* Palette semantica degli artefatti: colore pieno, tinta, testo sul pieno */
  --c-babel: #993366;  --c-babel-tint: #f7ebf1;
  --c-ente: #2c5aa0;   --c-ente-tint: #e8eff9;
  --c-next: #0b7069;   --c-next-tint: #e2f3f0;
  --c-ext: #9a540b;    --c-ext-tint: #fcf0e1;
  --c-ok: #2a7349;     --c-ok-tint: #e6f4ec;
  --c-neutro: #475569; --c-neutro-tint: #f1f5f9;
  --on-colore: #ffffff;

  --font: "Titillium Web", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --radius: 6px;
  --header-h: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #140d13;
    --surface: #1b1219;
    --surface-2: #251a23;
    --line: #3a2c37;
    --ink: #f5eff4;
    --text: #d6ccd4;
    --muted: #a89aa5;
    --tint: #24161f;
    --tint-line: #4a2a3d;

    --accent: #e79bbf;
    --button-bg: var(--plum);
    --button-hover: #b04a7d;
    --focus: #f0b3cf;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 28px -14px rgb(0 0 0 / 0.6);

    --c-babel: #e08ab3;  --c-babel-tint: #2b1724;
    --c-ente: #86aef0;   --c-ente-tint: #152340;
    --c-next: #3cc7b8;   --c-next-tint: #0f2b2a;
    --c-ext: #f2ab5c;    --c-ext-tint: #2e2110;
    --c-ok: #6fd39a;     --c-ok-tint: #10291b;
    --c-neutro: #a5b4c8; --c-neutro-tint: #1e293b;
    --on-colore: #140d13;
  }
}

/* Superfici scure: i token di testo, linee e pulsanti si invertono */
.site-header,
.hero-testo,
.iter-riga,
.section-notte,
.band,
.site-footer,
.banner-consenso {
  --ink: #ffffff;
  --text: rgb(255 255 255 / 0.82);
  --muted: rgb(255 255 255 / 0.64);
  --line: var(--notte-line);
  --tint: var(--notte-2);
  --accent: var(--rosa);
  --focus: var(--rosa);
  --button-bg: var(--rosa);
  --button-hover: #ffffff;
  --button-ink: var(--notte);
  color: var(--text);
}

/* Classi di significato: impostano --c e --c-tint per il componente */
.t-babel  { --c: var(--c-babel);  --c-tint: var(--c-babel-tint); }
.t-ente   { --c: var(--c-ente);   --c-tint: var(--c-ente-tint); }
.t-next   { --c: var(--c-next);   --c-tint: var(--c-next-tint); }
.t-ext    { --c: var(--c-ext);    --c-tint: var(--c-ext-tint); }
.t-ok     { --c: var(--c-ok);     --c-tint: var(--c-ok-tint); }
.t-neutro { --c: var(--c-neutro); --c-tint: var(--c-neutro-tint); }

/* Base ------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
}

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

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.125rem, 1.4rem + 3vw, 3rem); letter-spacing: -0.01em; line-height: 1.12; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem); }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.25rem; }

p, ul, ol, dl { margin: 0 0 1rem; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

strong { color: var(--ink); font-weight: 600; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: 42rem; }
.prose-larga { max-width: none; }

.lead {
  font-size: 1.3125rem;
  line-height: 1.5;
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--bg);
  color: var(--accent);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Icone: simboli SVG a tratto nello sprite della pagina */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icona {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bollo: icona nel cerchio del suo colore di significato */
.bollo {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--c, var(--accent));
  color: var(--on-colore);
}
.bollo .icona { width: 1.375rem; height: 1.375rem; }

/* Pulsanti --------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.875rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--button-bg);
  border-radius: var(--radius);
  background: var(--button-bg);
  color: var(--button-ink);
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--button-hover); border-color: var(--button-hover); }

.button-grande {
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

.button-secondary {
  background: transparent;
  color: var(--accent);
  border-color: currentColor;
}
.button-secondary:hover { background: var(--tint); border-color: currentColor; }

/* Su fondo scuro: contorno chiaro accanto al pulsante principale */
.button-chiaro {
  background: transparent;
  border-color: rgb(255 255 255 / 0.42);
  color: #fff;
}
.button-chiaro:hover { background: rgb(255 255 255 / 0.08); border-color: #fff; }

.button-inverse {
  background: var(--rosa);
  border-color: var(--rosa);
  color: var(--notte);
}
.button-inverse:hover { background: #fff; border-color: #fff; }

/* Intestazione ----------------------------------------------------------- */
/* Una riga sola: marchio, pagine e richiesta di presentazione. Sotto i
   76rem le pagine passano in un pannello a comparsa (Popover API, senza JS);
   sotto i 40rem anche la richiesta va nel pannello. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--notte-line);
}

.header-riga {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
/* Logo ufficiale su piastrella bianca: sul fondo scuro il fumetto pieno
   si confonderebbe con la barra */
.brand-logo {
  flex: none;
  padding: 0.25rem 0.4375rem;
  border-radius: var(--radius);
  background: #fff;
}
.brand-logo img { width: auto; height: 1.75rem; }
.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.header-cta {
  min-height: 2.5rem;
  padding: 0.4375rem 1rem;
  font-size: 1rem;
}
.header-cta[aria-current="page"] { box-shadow: 0 0 0 2px var(--notte), 0 0 0 4px var(--rosa); }

.menu-apri {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.5rem;
  padding: 0.4375rem 0.875rem;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.menu-apri:hover { border-color: #fff; background: rgb(255 255 255 / 0.06); }
/* tre linee che diventano una croce quando il pannello è aperto */
.menu-segno,
.menu-segno::before,
.menu-segno::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.menu-segno { position: relative; }
.menu-segno::before,
.menu-segno::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-segno::before { top: -6px; }
.menu-segno::after { top: 6px; }
.site-header:has(.site-nav:popover-open) .menu-segno { background: transparent; }
.site-header:has(.site-nav:popover-open) .menu-segno::before { top: 0; transform: rotate(45deg); }
.site-header:has(.site-nav:popover-open) .menu-segno::after { top: 0; transform: rotate(-45deg); }

/* Pannello delle pagine */
.site-nav {
  inset: var(--header-h) 0 auto auto;
  width: min(24rem, 100%);
  height: auto;
  max-height: calc(100dvh - var(--header-h));
  margin: 0;
  padding: 0.75rem var(--gutter) 1.5rem;
  border: 0;
  border-left: 1px solid var(--notte-line);
  background: var(--notte);
  color: #fff;
  overflow: auto;
  overscroll-behavior: contain;
}
.site-nav::backdrop { background: rgb(29 10 23 / 0.55); }
.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 0.875rem 0.25rem;
  border-bottom: 1px solid var(--notte-line);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover { color: var(--rosa); }
.site-nav a[aria-current="page"] { color: var(--rosa); }
.site-nav .nav-contatti { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .site-nav:popover-open { animation: pannello 0.18s ease-out; }
  @keyframes pannello { from { opacity: 0; transform: translateX(1.5rem); } }
}

@media (max-width: 39.99rem) {
  .header-cta { display: none; }
  .site-nav .nav-contatti { display: block; margin-top: 1.25rem; }
  .site-nav .nav-contatti a {
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--rosa);
    color: var(--notte);
    text-align: center;
  }
}

/* Schermi larghi: le pagine in riga, nessun pannello */
@media (min-width: 76rem) {
  .menu-apri { display: none; }
  .site-nav {
    display: block;
    position: static;
    inset: auto;
    width: auto;
    max-height: none;
    margin: 0 0.5rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    overflow: visible;
  }
  .site-nav ul { display: flex; gap: 0.125rem; }
  .site-nav a {
    position: relative;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: var(--radius);
    font-size: 1rem;
    white-space: nowrap;
  }
  .site-nav a:hover { color: #fff; background: rgb(255 255 255 / 0.08); }
  /* la pagina corrente: un nodo sotto la voce, come una tappa dell'iter */
  .site-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.3125rem;
    width: 0.4375rem;
    height: 0.4375rem;
    margin-left: -0.21875rem;
    border-radius: 50%;
    background: var(--rosa);
  }
}

/* Percorso di navigazione (breadcrumb) ----------------------------------- */

.briciole ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--muted);
}
.briciole li + li::before {
  content: "/" / "";
  margin-inline: 0.5rem;
  opacity: 0.6;
}
.briciole [aria-current="page"] { color: var(--ink); }

/* Sezioni ---------------------------------------------------------------- */

.section { padding-block: clamp(3.5rem, 2rem + 5vw, 5.5rem); }
.section-tint { background: var(--surface); }

/* due sezioni consecutive con lo stesso fondo: i margini non si sommano */
.section:not(.section-tint, .section-notte) + .section:not(.section-tint, .section-notte),
.section-tint + .section-tint { padding-top: 0; }

.split {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 60rem) {
  .split {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 4rem;
    align-items: start;
  }
}

.list { padding-left: 1.25rem; }
.list li { margin-bottom: 0.375rem; }
.list li::marker { color: var(--accent); }

.note {
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--accent);
  background: var(--tint);
  font-style: normal;
}
.note > :last-child { margin-bottom: 0; }
.note h2,
.note h3 { font-size: 1.25rem; }
.note-titolo { margin-top: 1.5rem; }

/* Apertura della home ---------------------------------------------------- */
/* Fondo notte; la linea dell'iter di una determina si traccia sotto il
   titolo (accanto, sugli schermi larghi), la schermata sta a cavallo tra il
   fondo scuro e il bianco. */

.hero { background: var(--notte); }

.hero-testo { padding-block: clamp(3rem, 1.5rem + 6vw, 6.5rem) clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.hero h1 {
  max-width: 22ch;
  margin-bottom: 1.5rem;
  font-size: clamp(2.375rem, 1.2rem + 4.4vw, 4.25rem);
  text-wrap: balance;
  line-height: 1.03;
  letter-spacing: -0.025em;
}
/* Il nome del prodotto su una riga a sé: per motori e lettori di schermo il
   titolo resta la frase «Babel: atti, protocollo…» */
.h1-marchio { display: block; }
.h1-frase { display: block; }
.h1-frase::first-letter { text-transform: uppercase; }
.fuori-vista {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hero .lead {
  max-width: 46rem;
  color: var(--text);
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  text-wrap: pretty;
}
.hero .actions { margin-top: 2rem; }
.hero-principale { min-width: 0; }

/* Tre garanzie, ciascuna con la sua fonte: in colonna sui telefoni, poi in
   riga su tre colonne separate da un filetto, larghe quanto il sommario */
.garanzie {
  display: grid;
  gap: 0.25rem;
  max-width: 46rem;
  margin: 2.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
  line-height: 1.35;
}
.garanzie a {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding-block: 0.375rem;
  color: var(--text);
  text-decoration-color: rgb(243 191 214 / 0.4);
  text-underline-offset: 0.25em;
}
.garanzie a:hover { color: #fff; text-decoration-color: var(--rosa); }
.garanzie .icona { flex: none; width: 1.25rem; height: 1.25rem; margin-top: 0.0625rem; color: var(--rosa); }
@media (min-width: 40rem) {
  .garanzie {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .garanzie li + li { padding-left: 1.25rem; border-left: 1px solid var(--notte-line); }
  .garanzie span { text-wrap: balance; }
}

.hero-visivo {
  isolation: isolate;
  overflow: clip;
  padding-bottom: 1rem;
  background: var(--notte);
}

.iter-riga {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 2.5rem;
  margin-top: 2.75rem;
}
.iter-nome {
  flex: none;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.3;
}
.iter {
  position: relative;
  display: flex;
  flex: 1 1 30rem;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}
.iter::before {
  content: "";
  position: absolute;
  top: calc(0.375rem - 1px);
  left: 0.375rem;
  right: 0.375rem;
  height: 2px;
  background: linear-gradient(to right, rgb(243 191 214 / 0.45), var(--rosa));
  transform-origin: left center;
}
.iter li {
  position: relative;
  padding-top: 1.25rem;
  color: var(--text);
  font-size: clamp(0.75rem, 0.6rem + 0.5vw, 0.9375rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.iter li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: -0.375rem;
  border: 2px solid var(--rosa);
  border-radius: 50%;
  background: var(--notte);
}
.iter li:first-child { text-align: left; }
.iter li:first-child::before { left: 0; margin-left: 0; }
.iter li:last-child { text-align: right; color: #fff; }
.iter li:last-child::before { left: auto; right: 0; margin-left: 0; background: var(--rosa); }
.iter strong { font-weight: inherit; }
.iter span { display: none; }

/* Schermi larghi: titolo a sinistra, l'iter in verticale a destra, con una
   nota per passaggio. Ogni tratto della linea parte dal nodo precedente. */
@media (min-width: 64rem) {
  .hero-testo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
    gap: 4.5rem;
    align-items: center;
  }
  .hero-testo .iter-riga {
    display: block;
    margin: 0;
    padding: 1.75rem 1.75rem 1.875rem;
    border: 1px solid var(--notte-line);
    border-radius: 16px;
    background: rgb(255 255 255 / 0.035);
  }
  .iter-nome { margin-bottom: 1.5rem; }
  .iter { display: block; }
  .iter::before { content: none; }
  .iter li,
  .iter li:first-child,
  .iter li:last-child {
    padding: 0 0 1.375rem 2.25rem;
    font-size: 1.0625rem;
    text-align: left;
  }
  .iter li:last-child { padding-bottom: 0; }
  .iter li::before,
  .iter li:first-child::before,
  .iter li:last-child::before {
    top: 0.25rem;
    left: 0;
    right: auto;
    width: 1rem;
    height: 1rem;
    margin-left: 0;
  }
  .iter li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.25rem;
    bottom: 0.25rem;
    left: calc(0.5rem - 1px);
    width: 2px;
    background: linear-gradient(to bottom, rgb(243 191 214 / 0.45), var(--rosa));
    transform-origin: center top;
  }
  .iter span {
    display: block;
    margin-top: 0.1875rem;
    color: var(--muted);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.4;
  }
}

/* Cornice della schermata: un bordo scuro che prosegue nel bianco */
.hero .shot-link {
  position: relative;
  overflow: visible;
  padding: clamp(0.3125rem, 0.2rem + 0.4vw, 0.5rem);
  border: 1px solid var(--notte-line);
  border-radius: 16px;
  background: var(--notte-2);
  box-shadow: 0 40px 70px -40px rgb(42 15 34 / 0.7);
}
.hero .shot-link img { width: 100%; border-radius: 10px; background: #fff; }
.hero .shot-link::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 55%;
  bottom: -40rem;
  left: calc(50% - 50vw);
  width: 100vw;
  background: var(--bg);
}
.hero .shot figcaption { max-width: 52rem; margin-top: 1rem; }

/* Un solo movimento all'apertura: la linea si traccia, le tappe si
   accendono in ordine, la schermata sale */
@media (prefers-reduced-motion: no-preference) {
  .iter::before { animation: traccia 1.1s cubic-bezier(0.6, 0, 0.2, 1) 0.2s both; }
  .iter li { animation: tappa 0.45s ease-out both; }
  .iter li:nth-child(1) { animation-delay: 0.2s; }
  .iter li:nth-child(2) { animation-delay: 0.42s; }
  .iter li:nth-child(3) { animation-delay: 0.64s; }
  .iter li:nth-child(4) { animation-delay: 0.86s; }
  .iter li:nth-child(5) { animation-delay: 1.08s; }
  .hero .shot { animation: sale 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both; }
  .iter li:not(:last-child)::after { animation: scende 0.3s ease-in both; }
  .iter li:nth-child(1)::after { animation-delay: 0.32s; }
  .iter li:nth-child(2)::after { animation-delay: 0.54s; }
  .iter li:nth-child(3)::after { animation-delay: 0.76s; }
  .iter li:nth-child(4)::after { animation-delay: 0.98s; }
  @keyframes traccia { from { transform: scaleX(0); } }
  @keyframes scende { from { transform: scaleY(0); } }
  @keyframes tappa { from { opacity: 0; transform: translateY(0.375rem); } }
  @keyframes sale { from { transform: translateY(2.5rem); } }
}

/* Prove: dati di esercizio, ognuno su un tratto della linea */
.prove { padding-block: 2rem 0.5rem; }
.prove-elenco {
  display: grid;
  gap: 1.5rem 2rem;
  margin: 0;
}
@media (min-width: 36rem) {
  .prove-elenco { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .prove-elenco { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.prove-elenco > div {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
}
.prove-elenco > div::before {
  content: "";
  position: absolute;
  top: calc(-0.3125rem - 1px);
  left: 0;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--accent);
}
.prove-elenco dd {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-size: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.prove-elenco dt { color: var(--muted); font-size: 1rem; line-height: 1.4; }

/* Introduzione delle sezioni */
.intro-sezione {
  max-width: 48rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.intro-sezione > :last-child { margin-bottom: 0; }
.intro-sezione p { font-size: 1.1875rem; text-wrap: pretty; }

/* Perché Babel: il riuso in primo piano, accanto quattro vantaggi */
.vantaggi {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
}
@media (min-width: 64rem) {
  .vantaggi {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 3.5rem;
    align-items: start;
  }
}
.vantaggio-licenza {
  padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  border-radius: 18px;
  background: var(--plum);
  color: rgb(255 255 255 / 0.88);
  --accent: #fff;
  --focus: #fff;
}
.vantaggio-licenza h3 { color: #fff; font-size: 1.5rem; }
.vantaggio-licenza > :last-child { margin-bottom: 0; }
.licenza-cifra {
  margin: 0 0 1rem;
  color: var(--rosa);
  font-size: clamp(4.5rem, 3rem + 6vw, 7.5rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.vantaggi-elenco {
  display: grid;
  gap: 0 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 40rem) {
  .vantaggi-elenco { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.vantaggi-elenco li {
  padding-block: 1.5rem 1rem;
  border-top: 1px solid var(--line);
}
.vantaggi-elenco .bollo { margin-bottom: 0.875rem; }
.vantaggi-elenco h3 { font-size: 1.25rem; line-height: 1.25; }
.vantaggi-elenco p { font-size: 1.0625rem; }

/* Sezione scura */
.section-notte { background: var(--notte); }

/* Babel al lavoro: passaggi a sinistra, schermata a destra. Le schede sono
   pulsanti di opzione: con :has() si mostra solo il pannello scelto,
   altrimenti i pannelli restano tutti visibili uno sotto l'altro. */
.demo {
  display: grid;
  gap: 2rem;
}
@media (min-width: 60rem) {
  .demo {
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }
}
.demo-passi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
@media (min-width: 40rem) {
  .demo-passi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.demo-passi legend {
  margin-bottom: 0.75rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.demo-passo {
  position: relative;
  display: block;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--notte-line);
  border-radius: 10px;
  line-height: 1.25;
  cursor: pointer;
}
.demo-passo:hover { border-color: rgb(255 255 255 / 0.4); }
.demo-passo input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.demo-passo strong { display: block; color: #fff; font-size: 1.0625rem; }
.demo-passo span { display: block; margin-top: 0.125rem; color: var(--muted); font-size: 0.9375rem; }
.demo-passo:has(input:checked) { border-color: var(--rosa); background: var(--notte-2); }
.demo-passo:has(input:checked) strong { color: var(--rosa); }
.demo-passo:has(input:focus-visible) { outline: 3px solid var(--rosa); outline-offset: 2px; }

/* Schermi larghi: i passaggi diventano una linea verticale con i nodi */
@media (min-width: 60rem) {
  .demo-passi { position: sticky; top: calc(var(--header-h) + 1.5rem); grid-template-columns: 1fr; gap: 0; }
  .demo-passo {
    padding: 0.75rem 0.75rem 0.875rem 2.25rem;
    border: 0;
    border-radius: 0 10px 10px 0;
  }
  .demo-passo::before {
    content: "";
    position: absolute;
    top: 0.9375rem;
    left: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--rosa);
    border-radius: 50%;
    background: var(--notte);
    z-index: 1;
  }
  .demo-passo::after {
    content: "";
    position: absolute;
    top: 1.6875rem;
    bottom: -0.9375rem;
    left: calc(0.625rem - 1px);
    width: 2px;
    background: rgb(243 191 214 / 0.35);
  }
  .demo-passo:last-of-type::after { display: none; }
  .demo-passo:hover { background: rgb(255 255 255 / 0.04); }
  .demo-passo:has(input:checked)::before { background: var(--rosa); box-shadow: 0 0 0 4px rgb(243 191 214 / 0.2); }
  /* l'ultimo passaggio è un percorso a parte: PEC e protocollo */
  .demo-passo:last-of-type { margin-top: 1rem; }
  .demo-passo:nth-last-of-type(2)::after { display: none; }
}

.demo-pannelli { min-width: 0; }
.demo-pannello h3 { margin-bottom: 1rem; font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); }
.demo-pannello + .demo-pannello { margin-top: 3rem; }
.demo .shot-link { border-color: var(--notte-line); box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6); }

@supports selector(:has(*)) {
  .demo-pannello { display: none; }
  .demo-pannello + .demo-pannello { margin-top: 0; }
  .demo:has(.demo-passo:nth-of-type(1) input:checked) .demo-pannello:nth-child(1),
  .demo:has(.demo-passo:nth-of-type(2) input:checked) .demo-pannello:nth-child(2),
  .demo:has(.demo-passo:nth-of-type(3) input:checked) .demo-pannello:nth-child(3),
  .demo:has(.demo-passo:nth-of-type(4) input:checked) .demo-pannello:nth-child(4),
  .demo:has(.demo-passo:nth-of-type(5) input:checked) .demo-pannello:nth-child(5),
  .demo:has(.demo-passo:nth-of-type(6) input:checked) .demo-pannello:nth-child(6) { display: block; }
  @media (prefers-reduced-motion: no-preference) {
    .demo-pannello { animation: comparsa 0.35s ease-out; }
    @keyframes comparsa { from { opacity: 0; transform: translateY(0.5rem); } }
  }
}

/* Moduli e servizi condivisi */
.moduli-home {
  display: grid;
  gap: 1rem;
  margin: 0 0 2.75rem;
  padding: 0;
  list-style: none;
}
@media (min-width: 60rem) {
  .moduli-home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.moduli-home .vignetta { width: 4.75rem; }
.servizi-home-titolo { font-size: 1.25rem; }
.servizi-home {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.servizi-home li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.875rem 0.4375rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.3;
}
.servizi-home .icona { width: 1.25rem; height: 1.25rem; color: var(--c-babel); }
.moduli-piede {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 2rem 0 0;
}
.moduli-piede span { max-width: 36rem; color: var(--muted); font-size: 1rem; line-height: 1.45; }

/* Anticipo sull'intelligenza artificiale: tratteggio, come le proposte */
.ia-anticipo {
  display: grid;
  gap: 1.25rem 2rem;
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border: 2px dashed var(--c);
  border-radius: 18px;
  background: var(--c-tint);
}
@media (min-width: 40rem) {
  .ia-anticipo { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
}
.ia-anticipo .vignetta { width: 6.5rem; }
.ia-anticipo h3 { font-size: 1.375rem; }
.ia-anticipo div > :last-child { margin-bottom: 0; }

/* Adozione: due modalità, poi le fasi fino alla messa in esercizio */
.modalita {
  display: grid;
  gap: 1rem;
}
@media (min-width: 48rem) {
  .modalita { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.modalita-voce {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--c);
  border-radius: 12px;
  background: var(--bg);
}
.modalita-voce h3 { margin-bottom: 0.375rem; font-size: 1.25rem; }
.modalita-voce p { margin: 0; font-size: 1.0625rem; }
.modalita-link { margin: 1.25rem 0 0; }
.fasi-titolo { margin-top: clamp(3rem, 2.5rem + 2vw, 4rem); font-size: 1.375rem; }

.fasi {
  display: grid;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: fase;
}
.fasi li {
  position: relative;
  padding: 0 0 1.5rem 3.25rem;
  font-size: 1rem;
  line-height: 1.45;
  counter-increment: fase;
}
.fasi strong { display: block; font-size: 1.125rem; font-weight: 700; }
.fasi li::before {
  content: counter(fase);
  position: absolute;
  top: -0.125rem;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--c-next);
  border-radius: 50%;
  background: var(--surface);
  color: var(--c-next);
  font-size: 1rem;
  font-weight: 700;
}
.fasi li::after {
  content: "";
  position: absolute;
  top: 2.125rem;
  bottom: -0.125rem;
  left: calc(1.125rem - 1px);
  width: 2px;
  background: var(--c-next);
}
.fasi .fasi-traguardo { padding-bottom: 0; }
.fasi .fasi-traguardo::before {
  content: "";
  border-color: var(--c-ok);
  background: var(--c-ok);
  box-shadow: inset 0 0 0 6px var(--surface);
}
.fasi .fasi-traguardo::after { display: none; }
.fasi-traguardo strong { color: var(--c-ok); }

@media (min-width: 64rem) {
  .fasi { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem; }
  .fasi li { padding: 3.25rem 0 0; }
  .fasi li::after {
    top: calc(1.125rem - 1px);
    bottom: auto;
    left: 2.25rem;
    right: -1.5rem;
    width: auto;
    height: 2px;
  }
}

/* Enti: le quote per regione come barre su dieci */
.enti-home {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 60rem) {
  .enti-home {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 4rem;
    align-items: center;
  }
}
.quote {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  margin: 1.75rem 0 1.5rem;
  padding: 0;
  list-style: none;
}
.quote li {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-bottom: 0.875rem;
  color: var(--ink);
  font-size: 1.0625rem;
}
.quote strong {
  min-width: 1.5rem;
  color: var(--c-ente);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1;
}
.quote li::before,
.quote li::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 0.375rem;
  border-radius: 999px;
}
.quote li::before { right: 0; background: var(--c-ente-tint); }
.quote li::after { width: var(--q); background: var(--c-ente); }
.quota-8 { --q: 80%; }
.quota-1 { --q: 10%; }

.caso {
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  border-radius: 18px;
  background: var(--c-tint);
}
.caso .vignetta { width: 5rem; margin-bottom: 1rem; }
.caso h3 { font-size: 1.375rem; }
.caso > :last-child { margin-bottom: 0; }

/* Domande frequenti in home */
.faq-home {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 60rem) {
  .faq-home {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 4rem;
    align-items: start;
  }
}

/* Intestazione delle pagine interne: nel colore del tema della pagina ---- */

.page-head {
  position: relative;
  padding-block: 2rem clamp(2.75rem, 1.75rem + 3vw, 4rem);
  background: var(--c-tint);
  border-bottom: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
}
.page-head-titolo {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.page-head .bollo {
  width: 3.5rem;
  height: 3.5rem;
  margin-top: 0.375rem;
}
.page-head .bollo .icona { width: 1.75rem; height: 1.75rem; }
.page-head h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
/* Il sommario occupa tutta la larghezza accanto al bollo, come il titolo */
.page-head .lead { margin-bottom: 0; text-wrap: pretty; }
@media (max-width: 39.99rem) {
  .page-head .bollo { display: none; }
}

/* Indice delle pagine (home) e pagine correlate -------------------------- */

.indice {
  display: grid;
  gap: 0 3rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .indice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 68rem) {
  .indice-tre { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.indice li { border-bottom: 1px solid var(--line); }
.indice a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 1rem;
  align-items: start;
  height: 100%;
  padding: 1.125rem 0.75rem 1.25rem 0;
  color: var(--text);
  text-decoration: none;
}
.indice .bollo { grid-row: span 2; }
.indice strong {
  color: var(--c);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}
.indice span:last-child { font-size: 1rem; line-height: 1.5; }
.indice a:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.indice a:hover .bollo { box-shadow: 0 0 0 4px var(--c-tint); }

.correlate { padding-block: 3rem; border-top: 1px solid var(--line); }
.correlate h2 { font-size: 1.5rem; }

/* Banda di invito al contatto -------------------------------------------- */
/* A sinistra la richiesta, a destra che cosa succede dopo, sulla linea */

.band { background: var(--band-bg); }
.band .list li::marker { color: rgb(255 255 255 / 0.7); }

.invito { padding-block: clamp(3.5rem, 2.5rem + 4vw, 5.5rem); }
.invito .wrap {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 60rem) {
  .invito .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5rem;
    align-items: start;
  }
}
.invito h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.invito-testo p { max-width: 34rem; font-size: 1.1875rem; }
.invito .actions { margin: 1.75rem 0 0; }
.invito-dopo h3 { margin-bottom: 1.25rem; color: var(--muted); font-size: 1.0625rem; font-weight: 600; }
.invito-passi {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.invito-passi li {
  position: relative;
  padding: 0 0 1.5rem 3.25rem;
  font-size: 1.0625rem;
  line-height: 1.45;
  counter-increment: passo;
}
.invito-passi li:last-child { padding-bottom: 0; }
.invito-passi strong { display: block; margin-bottom: 0.125rem; font-size: 1.125rem; }
.invito-passi li::before {
  content: counter(passo);
  position: absolute;
  top: -0.125rem;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--rosa);
  border-radius: 50%;
  background: var(--notte);
  color: var(--rosa);
  font-weight: 700;
}
.invito-passi li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.125rem;
  bottom: -0.125rem;
  left: calc(1.125rem - 1px);
  width: 2px;
  background: rgb(243 191 214 / 0.4);
}

/* Schermate -------------------------------------------------------------- */

.shot { margin: 0; }

.shot-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.shot-link:focus-visible { outline-offset: 4px; }

.shot figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.shot-ia { max-width: 958px; margin-top: 2.5rem; }

/* Galleria: raggruppa le schermate che l'ingrandimento scorre in sequenza */
.galleria .shot-link img { width: 100%; }

/* Artefatti grafici ------------------------------------------------------ */
/* Riquadri e frecce in HTML: il testo resta leggibile, indicizzabile e segue
   i temi. Frecce piene = azioni; tratteggio = proposte, ritorni e
   integrazioni con sistemi esterni. */

.artefatto {
  margin: 2.5rem 0 0;
  container-type: inline-size;
}
.artefatto > figcaption {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Vignetta: illustrazione piatta di un oggetto (edificio, documento, server).
   Carta e inchiostro sono fissi; pieno, medio e chiaro derivano dal colore di
   significato del componente, così la stessa vignetta cambia tinta per tema. */
.vignetta {
  --v-carta: #ffffff;
  --v-ink: #2e2a3d;
  --v-grigio: #e3dee6;
  --v-medio: color-mix(in srgb, var(--c) 50%, var(--v-carta));
  --v-chiaro: color-mix(in srgb, var(--c) 20%, var(--v-carta));
  --v-fondo: color-mix(in srgb, var(--c) 16%, var(--bg));
  display: block;
  flex: none;
  width: 5.5rem;
  height: auto;
  overflow: visible;
}
@media (prefers-color-scheme: dark) {
  .vignetta {
    --v-carta: #f4f1f6;
    --v-ink: #1c1a29;
    --v-grigio: #c9c2cd;
  }
}
.vignetta .vf { fill: var(--v-fondo); }
.vignetta .vp { fill: var(--c); }
.vignetta .vm { fill: var(--v-medio); }
.vignetta .vc { fill: var(--v-chiaro); }
.vignetta .vk { fill: var(--v-carta); }
.vignetta .vg { fill: var(--v-grigio); }
.vignetta .vi { fill: var(--v-ink); }
.vignetta .vb { fill: var(--c-babel); }
.vignetta .vo {
  stroke: var(--v-ink);
  stroke-width: 2;
  stroke-linejoin: round;
}
.vignetta .vl,
.vignetta .vlp,
.vignetta .vlk {
  fill: none;
  stroke: var(--v-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vignetta .vlp { stroke: var(--c); stroke-width: 2.5; }
.vignetta .vlk { stroke: var(--v-carta); stroke-width: 2.5; }
.vignetta .vtr { stroke-dasharray: 4 4; }
.vignetta .vcur { fill: var(--v-ink); stroke: var(--v-carta); stroke-width: 1.5; stroke-linejoin: round; }

/* Tappa: riquadro con vignetta, nome e nota */
.tappa {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 0;
  padding: 0.625rem 1rem 0.625rem 0.625rem;
  border: 2px solid var(--c);
  border-radius: 14px;
  background: var(--c-tint);
  color: var(--ink);
  line-height: 1.3;
}
.tappa strong { display: block; font-size: 1.0625rem; font-weight: 700; }
.tappa-nota {
  display: block;
  margin-top: 0.125rem;
  color: var(--text);
  font-size: 0.9375rem;
}
.tappa-proposta { border-style: dashed; }
.tappa-forte { background: var(--c); }
.tappa-forte,
.tappa-forte strong,
.tappa-forte .tappa-nota { color: var(--on-colore); }
.tappa-forte .vignetta { --v-fondo: color-mix(in srgb, var(--on-colore) 22%, var(--c)); }

/* Passaggio: freccia etichettata. Verticale per impostazione: linea al
   centro e testo a destra; .su inverte la punta */
.passaggio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  column-gap: 0.75rem;
  margin: 0;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.35;
}
.passaggio::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  width: 2px;
  min-height: 3rem;
  margin-inline: 5px;
  background: var(--c, var(--muted));
}
.passaggio::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  width: 12px;
  height: 10px;
  background: var(--c, var(--muted));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.passaggio.su::after { align-self: start; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.passaggio > span {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  padding-block: 0.625rem;
}
.passaggio-tratteggiato::before {
  background: repeating-linear-gradient(to bottom, var(--c, var(--muted)) 0 6px, transparent 6px 11px);
}

/* Catena: tappe e passaggi in colonna, in riga quando c'è spazio */
.catena { display: grid; max-width: 32rem; }

@container (min-width: 56rem) {
  .catena {
    display: flex;
    align-items: stretch;
    max-width: none;
  }
  .catena > .tappa {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.875rem 1rem 1.125rem;
    text-align: center;
  }
  .catena > .tappa .vignetta { width: 100%; max-width: 8.5rem; }
  .catena > .passaggio {
    flex: 0 0 8.5rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    row-gap: 0.375rem;
  }
  .catena > .passaggio::before {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    height: 2px;
    min-height: 0;
    margin: 0 4px;
  }
  .catena > .passaggio::after {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    width: 10px;
    height: 12px;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
  .catena > .passaggio > span {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    padding: 0 0.5rem;
    text-align: center;
  }
}

/* Riuso: chi pubblica, chi adotta, chi fornisce i servizi ---------------- */

.riuso-catena {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto minmax(0, 1fr);
  max-width: 34rem;
}
.riuso-catena > .tappa { grid-column: 2 / 5; }
.riuso-catena > :nth-child(1) { grid-row: 1; }
.riuso-catena > :nth-child(2) > * { grid-row: 2; }
.riuso-catena > :nth-child(3) { grid-row: 3; }
.riuso-catena > :nth-child(4) > * { grid-row: 4; }
.riuso-catena > :nth-child(5) { grid-row: 5; }
.riuso-catena > :nth-child(6) > * { grid-row: 6; }
.riuso-catena > :nth-child(7) { grid-row: 7; }

/* nella colonna stretta i passaggi diventano celle della griglia */
.riuso-catena > .passaggio { display: contents; }
.riuso-catena > .passaggio::before,
.riuso-catena > .passaggio::after { content: none; }
/* .riuso-catena davanti per prevalere su .passaggio > span */
.riuso-catena .riuso-linea {
  grid-column: 3;
  position: relative;
  width: 2px;
  padding: 0;
  min-height: 3.5rem;
  margin-inline: 5px;
  background: var(--c);
}
.riuso-linea::after {
  content: "";
  position: absolute;
  left: -5px;
  bottom: 0;
  width: 12px;
  height: 10px;
  background: var(--c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.su .riuso-linea::after { top: 0; bottom: auto; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.riuso-catena .passaggio > span:not(.riuso-linea) {
  grid-column: 4;
  align-self: center;
  padding: 0.625rem 0 0.625rem 0.75rem;
}

.licenza {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--on-colore);
  color: var(--c);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
}

/* il ritorno delle evoluzioni: parentesi tratteggiata a sinistra */
.riuso-ritorno { display: contents; }
.riuso-arco {
  grid-column: 1;
  grid-row: 3 / 6;
  position: relative;
  margin: 2.25rem 0 2.25rem 0.625rem;
  border: 2px dashed var(--c-babel);
  border-right: 0;
  border-radius: 12px 0 0 12px;
}
.riuso-arco::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -2px;
  width: 10px;
  height: 12px;
  background: var(--c-babel);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.riuso-ritorno-testo {
  grid-column: 2;
  grid-row: 4;
  align-self: center;
  padding: 0.625rem 0.75rem 0.625rem 0;
  color: var(--c-babel);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: right;
}

@container (min-width: 60rem) {
  .riuso-catena {
    grid-template-columns: minmax(0, 1fr) 10rem minmax(0, 1fr) 10rem minmax(0, 1fr) 10rem minmax(0, 1fr);
    max-width: none;
  }
  .riuso-catena > .tappa {
    grid-column: auto;
    grid-row: 1;
    flex-direction: column;
    padding: 0.875rem 1rem 1.125rem;
    text-align: center;
  }
  .riuso-catena > .tappa .vignetta { width: 100%; max-width: 8.5rem; }
  .riuso-catena > :nth-child(1) { grid-column: 1; }
  .riuso-catena > :nth-child(3) { grid-column: 3; }
  .riuso-catena > :nth-child(5) { grid-column: 5; }
  .riuso-catena > :nth-child(7) { grid-column: 7; }
  .riuso-catena > .passaggio {
    display: grid;
    grid-row: 1;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    row-gap: 0.375rem;
  }
  .riuso-catena > :nth-child(2) { grid-column: 2; }
  .riuso-catena > :nth-child(4) { grid-column: 4; }
  .riuso-catena > :nth-child(6) { grid-column: 6; }
  .riuso-catena > .passaggio > * { grid-row: auto; }
  .riuso-catena .riuso-linea {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    height: 2px;
    min-height: 0;
    margin: 0 4px;
  }
  .riuso-linea::after {
    top: -5px;
    right: 0;
    bottom: auto;
    left: auto;
    width: 10px;
    height: 12px;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
  .su .riuso-linea::after {
    right: auto;
    left: 0;
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
  }
  .riuso-catena .passaggio > span:not(.riuso-linea) {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    padding: 0 0.5rem;
    text-align: center;
  }
  /* l'arco parte dal centro di Babel e torna dal centro dell'ente che adotta */
  .riuso-arco {
    grid-column: 3 / 6;
    grid-row: 2;
    height: 2.5rem;
    margin: 0 calc((100cqw - 30rem) / 8);
    border: 2px dashed var(--c-babel);
    border-top: 0;
    border-radius: 0 0 14px 14px;
  }
  .riuso-arco::after {
    top: -2px;
    right: auto;
    left: -7px;
    width: 12px;
    height: 10px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }
  .riuso-ritorno-testo {
    grid-column: 3 / 6;
    grid-row: 3;
    padding: 0.5rem 0 0;
    text-align: center;
  }
}

/* Architettura: i moduli poggiano sui servizi condivisi ------------------ */

.arch-babel {
  padding: 1rem;
  border: 2px solid var(--c-babel);
  border-radius: 16px;
  background: var(--c-babel-tint);
}
.arch-nome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.875rem;
  color: var(--c-babel);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.arch-livello {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.arch-moduli {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.arch-moduli li {
  border-radius: 10px;
  background: var(--plum);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
}
.arch-moduli .vignetta {
  --v-fondo: rgb(255 255 255 / 0.16);
  width: 4.75rem;
}

.arch-uso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
  padding-block: 0.5rem;
  color: var(--c-babel);
  font-size: 0.9375rem;
  font-weight: 600;
}
.arch-uso::before,
.arch-uso::after {
  content: "";
  width: 14px;
  height: 1.75rem;
  background: currentColor;
  clip-path: polygon(43% 0, 57% 0, 57% 64%, 100% 64%, 50% 100%, 0 64%, 43% 64%);
}

.arch-servizi {
  padding: 1rem 1rem 1.125rem;
  border-radius: 10px;
  background: var(--plum-deep);
  color: #fff;
}
.arch-servizi .arch-livello { color: #fff; }
.arch-servizi ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
  gap: 0.625rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.arch-servizi li {
  font-size: 1rem;
  line-height: 1.3;
}
.arch-servizi .bollo {
  width: 2.375rem;
  height: 2.375rem;
  background: #fff;
  color: var(--plum);
}
.arch-servizi .bollo .icona { width: 1.25rem; height: 1.25rem; }

/* le voci di moduli e servizi aprono una scheda a comparsa */
.arch-babel button {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
}
.arch-babel button > span {
  text-decoration: underline dotted 1px;
  text-underline-offset: 0.25em;
}
.arch-babel button:hover > span { text-decoration-style: solid; }
.arch-moduli button {
  gap: 0.875rem;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
}
.arch-moduli button:hover { background: var(--plum-hover); }
.arch-moduli button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.arch-servizi button { gap: 0.625rem; border-radius: 8px; }
.arch-servizi button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* collegamenti tratteggiati verso i sistemi esterni */
.arch-integra {
  position: relative;
  margin: 0;
  padding: 1rem 0 1rem 2.5rem;
  color: var(--c-ext);
  font-size: 0.9375rem;
  font-weight: 600;
}
.arch-integra::before {
  content: "";
  position: absolute;
  left: 1.0625rem;
  top: 0;
  bottom: 0;
  border-left: 2px dashed var(--c-ext);
}

.arch-esterni {
  position: relative;
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0 0 0 2.5rem;
  list-style: none;
}
.arch-esterni::before {
  content: "";
  position: absolute;
  left: 1.0625rem;
  top: 0;
  bottom: 1.5rem;
  border-left: 2px dashed var(--c-ext);
}
.arch-esterni li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 2px dashed var(--c-ext);
  border-radius: 10px;
  background: var(--c-ext-tint);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.arch-esterni li::before {
  content: "";
  position: absolute;
  left: calc(-1.4375rem - 2px);
  top: 50%;
  width: 1.4375rem;
  border-top: 2px dashed var(--c-ext);
}
.arch-esterni .icona { color: var(--c-ext); }
.arch-esterni small {
  display: block;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
}

@container (min-width: 40rem) {
  .arch-moduli { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .arch-moduli li { border-radius: 12px 12px 4px 4px; }
  .arch-moduli button {
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    padding: 0.875rem 1rem 1.125rem;
    text-align: center;
  }
  .arch-moduli .vignetta { width: 100%; max-width: 8.5rem; }
}

@container (min-width: 56rem) {
  .arch-babel { padding: 1.25rem 1.5rem 1.5rem; }
  /* il bus di integrazione corre in orizzontale sopra i sistemi esterni */
  .arch-integra { padding: 1rem 0 1rem calc(50% + 1rem); }
  .arch-integra::before { left: 50%; }
  .arch-esterni {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1.5rem 0 0;
  }
  .arch-esterni::before {
    left: calc((100% - 3rem) / 10);
    right: calc((100% - 3rem) / 10);
    top: 0;
    bottom: auto;
    border-left: 0;
    border-top: 2px dashed var(--c-ext);
  }
  .arch-esterni li {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.875rem 0.875rem 1rem;
  }
  .arch-esterni li::before {
    left: 50%;
    top: calc(-1.5rem - 2px);
    width: 0;
    height: 1.5rem;
    border-top: 0;
    border-left: 2px dashed var(--c-ext);
  }
}

/* Modalità di adozione: dove si trova Babel e chi la gestisce ------------ */

.adozione {
  display: grid;
  gap: 2.5rem;
}
@container (min-width: 48rem) {
  .adozione { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
}
.adozione-nome {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 700;
}
.zona {
  padding: 0.875rem 1rem 1rem;
  border: 2px solid var(--c);
  border-radius: 16px;
  background: var(--c-tint);
}
.zona-nome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--c);
  font-size: 1rem;
  font-weight: 700;
}
.adozione .tappa { max-width: 22rem; margin-inline: auto; }
.adozione .passaggio > span { padding-block: 0.5rem; }

/* Servizi: dall'avviamento alla manutenzione ----------------------------- */

.servizi-titolo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  color: var(--c-next);
  font-size: 1.25rem;
  font-weight: 700;
}
.servizi-titolo small {
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
}

.servizi-fasi {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: fase;
}
.servizi-fasi li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1rem;
  padding-bottom: 1.25rem;
  counter-increment: fase;
  line-height: 1.4;
}
.servizi-fasi .bollo { grid-row: span 2; position: relative; z-index: 1; }
.servizi-fasi strong { color: var(--ink); font-size: 1.0625rem; font-weight: 700; }
.servizi-fasi strong::before { content: counter(fase) ". "; color: var(--c-next); }
.servizi-fasi span:last-child { font-size: 1rem; }
/* la sequenza: una linea collega i bolli */
.servizi-fasi li::after {
  content: "";
  position: absolute;
  left: calc(1.375rem - 1px);
  top: 2.75rem;
  bottom: 0;
  width: 2px;
  background: var(--c-next);
}

.servizi-traguardo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: fit-content;
  margin: 0;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  border-radius: 999px;
  background: var(--c-ok-tint);
  border: 2px solid var(--c-ok);
  color: var(--ink);
}
.servizi-traguardo strong { font-size: 1.0625rem; }

.servizi-ciclo {
  position: relative;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 2px dashed var(--c-next);
  border-radius: 20px;
  background: var(--c-next-tint);
}
/* freccia dal traguardo al ciclo */
.servizi-ciclo::before {
  content: "";
  position: absolute;
  left: 1.625rem;
  top: calc(-1.5rem - 2px);
  width: 2px;
  height: 1.5rem;
  background: var(--c-next);
}
.servizi-ciclo ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: 0.875rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.servizi-ciclo li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--ink);
}
.servizi-ciclo li .icona { color: var(--c-next); margin-top: 0.0625rem; }

@container (min-width: 60rem) {
  .servizi-avvio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 1.5rem;
    overflow: hidden; /* taglia il collegamento del traguardo al fondo delle fasi */
  }
  .servizi-avvio .servizi-titolo { grid-column: 1 / -1; }
  .servizi-fasi {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
  .servizi-fasi li {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    row-gap: 0.625rem;
    padding: 0;
  }
  .servizi-fasi .bollo { grid-row: auto; }
  .servizi-fasi li::after {
    left: 2.75rem;
    right: -1rem;
    top: calc(1.375rem - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }
  .servizi-traguardo {
    flex-direction: column;
    align-items: flex-start;
    width: 11rem;
    padding: 0.625rem 1rem 1rem;
    border-radius: 14px;
  }
  /* dal traguardo scende la linea che prosegue nel ::before del ciclo */
  .servizi-traguardo { position: relative; }
  .servizi-traguardo::after {
    content: "";
    position: absolute;
    top: calc(100% + 2px);
    left: calc(50% - 1px);
    width: 2px;
    height: 20rem;
    background: var(--c-next);
  }
  /* 5.5rem = metà del traguardo; 3px = bordo del ciclo (2px) + metà linea */
  .servizi-ciclo::before { left: auto; right: calc(5.5rem - 3px); }
}

/* Enti: tappe della diffusione e regioni --------------------------------- */

.storia {
  display: grid;
  gap: 0;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.storia li {
  position: relative;
  padding: 0 0 1.5rem 2.25rem;
}
.storia li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.375rem;
  width: 1.125rem;
  height: 1.125rem;
  border: 4px solid var(--c-ente);
  border-radius: 50%;
  background: var(--bg);
}
.storia li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(0.5625rem - 1px);
  top: 1.5rem;
  bottom: 0.25rem;
  width: 2px;
  background: var(--c-ente);
}
.storia .vignetta { width: 7rem; margin-bottom: 0.5rem; }
.storia-anno {
  margin: 0 0 0.25rem;
  color: var(--c-ente);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}
.storia li p:last-child { margin: 0; max-width: 24rem; }
@media (min-width: 48rem) {
  .storia { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
  .storia li { padding: 2.25rem 0 0; }
  .storia li::before { top: 0; }
  .storia li:not(:last-child)::after {
    left: 1.5rem;
    right: -2rem;
    top: calc(0.5625rem - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }
}

.regioni {
  display: grid;
  gap: 1rem;
}
@media (min-width: 40rem) {
  .regioni { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .regione-grande { grid-row: span 2; }
}
.regione {
  padding: 1.125rem 1.25rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--c-ente) 35%, transparent);
  border-top: 4px solid var(--c-ente);
  border-radius: 10px;
  background: var(--c-ente-tint);
}
.regione h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.25rem;
}
.regione-conta {
  flex: none;
  color: var(--c-ente);
  font-size: 1rem;
  font-weight: 600;
}
.regione .list li::marker { color: var(--c-ente); }

/* Scheda in sintesi ------------------------------------------------------ */

.facts {
  display: grid;
  gap: 0 3rem;
  margin: 1.5rem 0 0;
}
@media (min-width: 48rem) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 68rem) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.facts > div {
  padding-block: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}
.facts dt {
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
}
.facts dd { margin: 0; }

.facts-compact { gap: 0 1.5rem; margin-bottom: 1.25rem; }
.facts-compact > div { padding-block: 0.625rem; border-color: var(--tint-line); }
@media (min-width: 48rem) {
  .facts-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 68rem) {
  .facts-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* La nuova release (Funzioni): architettura tecnologica a livelli -------- */

.stack { display: grid; }
.stack-utenti { justify-self: center; width: min(100%, 24rem); }
.stack-babel {
  padding: 1rem;
  border: 2px solid var(--c-babel);
  border-radius: 16px;
  background: var(--c-babel-tint);
}
.stack-livello {
  display: grid;
  gap: 0.875rem;
  padding: 0.875rem 1rem 1rem;
  border: 1px solid var(--tint-line);
  border-radius: 12px;
  background: var(--bg);
}
.stack-ruolo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--ink);
  line-height: 1.3;
}
.stack-ruolo .bollo { background: var(--c-babel); }
.stack-ruolo strong { display: block; font-size: 1.125rem; font-weight: 700; }
.stack-ruolo strong + span {
  display: block;
  margin-top: 0.125rem;
  color: var(--text);
  font-size: 0.9375rem;
}
.stack-tec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stack-tec li {
  padding: 0.625rem 0.875rem 0.75rem;
  border-radius: 10px;
  background: var(--plum);
  color: #fff;
  font-size: 0.9375rem;
  line-height: 1.35;
}
.stack-tec strong {
  display: block;
  color: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.stack-babel .passaggio > span { padding-block: 0.5rem; }

@container (min-width: 48rem) {
  .stack-babel { padding: 1.25rem 1.5rem 1.5rem; }
  .stack-livello {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
  }
}

.release-ux { margin-top: 3rem; }
.release-ux h3 { font-size: 1.375rem; }

/* Funzioni --------------------------------------------------------------- */

.feature + .feature { margin-top: 3.5rem; }
.feature .prose { margin-bottom: 1.5rem; }

/* Funzioni: percorso di una determina e PEC ----------------------------- */

.passi,
.righe { --spazio-passi: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.passi > * + *,
.righe > * + * { margin-top: var(--spazio-passi); }

/* Riquadro con l'iter: il documento procede da solo tra gli attori */
.guida,
.flusso {
  padding: clamp(1.5rem, 1rem + 2.5vw, 2.75rem);
  border: 1px solid var(--tint-line);
  border-radius: 18px;
  background: var(--tint);
}
.guida { margin-bottom: clamp(3rem, 2.25rem + 3vw, 5rem); }
.guida-testo { max-width: 46rem; }
.guida-testo h3 { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); }
.guida-testo p { font-size: 1.125rem; }
.guida-testo strong { color: var(--accent); }

.guida-iter {
  display: grid;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.guida-iter li {
  position: relative;
  padding: 0 0 1.5rem 2rem;
  line-height: 1.4;
}
.guida-iter li:last-child { padding-bottom: 0; }
.guida-iter strong { display: block; color: var(--ink); font-size: 1.125rem; }
.guida-iter span { display: block; color: var(--muted); font-size: 0.9375rem; }
.guida-iter li::before {
  content: "";
  position: absolute;
  top: 0.375rem;
  left: 0;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--plum);
  border-radius: 50%;
  background: var(--bg);
}
.guida-iter li:last-child::before { background: var(--plum); }
.guida-iter li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: -0.375rem;
  left: calc(0.5rem - 1px);
  width: 2px;
  background: var(--plum);
}
.guida-iter li:not(:last-child) > span::after {
  content: "Procedi" / "";
  display: block;
  width: fit-content;
  margin-top: 0.5rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--plum);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}
@media (min-width: 60rem) {
  .guida-iter { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .guida-iter li { padding: 1.75rem 1.25rem 0 0; }
  .guida-iter li::before { top: 0; }
  .guida-iter li:not(:last-child)::after {
    top: calc(0.5rem - 1px);
    bottom: auto;
    left: 0.5rem;
    right: -0.5rem;
    width: auto;
    height: 2px;
  }
  .guida-iter li:not(:last-child) > span::after {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    z-index: 1;
    margin: 0;
    transform: translateY(-50%);
  }
}

.coppia {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}
@media (min-width: 48rem) {
  .coppia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Un passo: testo e schermata affiancati */
.passo {
  display: grid;
  gap: 1.25rem 3rem;
  align-items: start;
}
@media (min-width: 60rem) {
  .passo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.passo-testo h3 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); }
.passo-testo p { font-size: 1.0625rem; }
.passo-testo > :last-child { margin-bottom: 0; }

/* Passi numerati del percorso, uniti da una linea */
.passi {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.passi .passo {
  position: relative;
  padding-left: 3.5rem;
  counter-increment: passo;
}
.passi .passo::before {
  content: counter(passo);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--plum);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-size: 1.0625rem;
  font-weight: 700;
}
.passi .passo:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 2.5rem;
  bottom: calc(-1 * var(--spazio-passi));
  left: calc(1.25rem - 1px);
  width: 2px;
  background: var(--tint-line);
}

.shot-pannello { max-width: 20rem; }

/* PEC → protocollo: due schermate in sequenza */
.flusso .passo-testo { margin-bottom: 1.5rem; }
.flusso-passi {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: flusso;
}
.flusso-passi li { position: relative; counter-increment: flusso; }
.flusso-passi figcaption { position: relative; padding-left: 2.75rem; }
.flusso-passi figcaption::before {
  content: counter(flusso);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--plum);
  color: #fff;
  font-weight: 700;
}
@media (min-width: 48rem) {
  .flusso-passi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem; }
  .flusso-passi li + li::before {
    content: "";
    position: absolute;
    top: 0;
    left: -2.375rem;
    width: 1.25rem;
    height: 1.75rem;
    margin-top: calc(20.8% - 0.875rem);
    background: var(--plum);
    clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%);
  }
}

/* Riquadro che indica il punto da guardare nella schermata */
.flusso-passi .shot-link { position: relative; }
.segno {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: var(--h);
  border: 3px solid #b45f06;
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgb(255 255 255 / 0.6);
  pointer-events: none;
}
.segno > span {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 50%;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: #b45f06;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transform: translateX(-50%);
}
.segno-crea { --x: 44.6%; --y: 57.2%; --w: 8.2%; --h: 8.6%; }
.segno-numero { --x: 16.8%; --y: 28%; --w: 47.6%; --h: 9%; }

/* Tabella di confronto --------------------------------------------------- */

.table-wrap {
  margin-top: 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 1.0625rem;
}
caption {
  padding: 0.875rem 1.25rem;
  text-align: left;
  color: var(--muted);
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--line);
}
th, td {
  padding: 0.875rem 1.25rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child > * { border-bottom: 0; }
thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}
thead td { background: var(--surface-2); border-bottom: 2px solid var(--accent); }
tbody th {
  width: 26%;
  color: var(--ink);
  font-weight: 600;
}

/* Su schermi stretti ogni riga diventa un blocco: le due modalità restano visibili */
@media (max-width: 39.99rem) {
  table { min-width: 0; }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  tbody tr {
    display: block;
    padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid var(--line);
  }
  tbody tr:last-child { border-bottom: 0; }
  tbody th,
  tbody td {
    display: block;
    width: auto;
    padding: 0.375rem 1.25rem;
    border-bottom: 0;
  }
  tbody td::before {
    content: attr(data-label);
    display: block;
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
  }
}

/* Domande frequenti ------------------------------------------------------ */

.faq {
  border-top: 1px solid var(--line);
}
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 1rem 2.5rem 1rem 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.1875rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.375rem;
  top: 1.375rem;
  width: 0.625rem;
  height: 0.625rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}
.faq details[open] summary::after { top: 1.625rem; transform: rotate(-135deg); }
.faq details p { padding-bottom: 0.5rem; }

/* Modulo di contatto ----------------------------------------------------- */

.modulo { max-width: 40rem; }
.modulo fieldset {
  margin: 0 0 1.75rem;
  padding: 0;
  border: 0;
}
.modulo legend {
  margin-bottom: 0.75rem;
  padding: 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
}
.campo { margin-bottom: 1rem; }
.campo label,
.campo-titolo {
  display: block;
  margin-bottom: 0.3125rem;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
}
.facoltativo { color: var(--muted); font-weight: 400; }
.campo input,
.campo textarea {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}
.campo textarea { min-height: 9rem; resize: vertical; }
.campo input:focus-visible,
.campo textarea:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.campo [aria-invalid="true"] { border: 2px solid #b42318; }
.campi-due { display: grid; gap: 0 1.25rem; }
@media (min-width: 40rem) {
  .campi-due { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.campo-errore {
  margin: 0.375rem 0 0;
  color: #b42318;
  font-size: 0.9375rem;
  font-weight: 600;
}
.campo-errore:empty { display: none; }
@media (prefers-color-scheme: dark) {
  .campo [aria-invalid="true"] { border-color: #f97066; }
  .campo-errore { color: #f97066; }
}

.scelte {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* .campo davanti per prevalere su .campo label e .campo input */
.campo .scelta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}
.campo .scelta input,
.consenso input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--plum);
}
.consenso {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  line-height: 1.45;
  cursor: pointer;
}
.consenso input { margin-top: 0.1875rem; }
/* l'errore dell'informativa sta sotto la casella, non sopra il bottone */
.consenso + .campo-errore { margin: -1.125rem 0 1.25rem; }

/* campo trappola per i programmi automatici: fuori dallo schermo */
.trappola {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.modulo-esito {
  margin: 1rem 0 0;
  font-weight: 600;
}
.modulo-esito:empty { display: none; }
.modulo-esito.errore {
  padding: 0.875rem 1rem;
  border-left: 4px solid #b42318;
  background: color-mix(in srgb, #b42318 8%, var(--bg));
  color: var(--ink);
}
.modulo-esito.inviato {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--c-ok);
  background: var(--c-ok-tint);
  color: var(--ink);
  font-weight: 400;
}
.modulo-esito.inviato p { margin: 0; }
.modulo-esito.inviato p + p { margin-top: 0.375rem; }
.modulo-esito.inviato strong { font-size: 1.125rem; }
.modulo [type="submit"][disabled] { opacity: 0.7; cursor: progress; }

.dopo-invio {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: dopo;
}
.dopo-invio li {
  position: relative;
  padding: 0 0 1rem 2.5rem;
  counter-increment: dopo;
}
.dopo-invio li::before {
  content: counter(dopo);
  position: absolute;
  left: 0;
  top: 0.0625rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}

/* Informativa ------------------------------------------------------------ */

.informativa h2 { margin-top: 2.5rem; font-size: 1.5rem; }
.informativa h2:first-child { margin-top: 0; }

/* Piè di pagina ---------------------------------------------------------- */

.site-footer {
  padding-block: 3.5rem;
  border-top: 1px solid var(--notte-line);
  background: var(--notte-3);
  font-size: 0.9375rem;
}
.footer-inner {
  display: grid;
  gap: 2rem;
}
@media (min-width: 60rem) {
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; }
}
.footer-title { color: var(--muted); font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.footer-nome { color: #fff; font-size: 1.0625rem; font-weight: 700; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--rosa); }
.site-footer ul {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer li { margin-bottom: 0.5rem; break-inside: avoid; }

/* Schede a comparsa dello schema (Funzioni) ------------------------------ */

.scheda {
  width: min(46rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--plum);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 24px 60px -12px rgb(15 23 42 / 0.5);
  overflow: auto;
  overscroll-behavior: contain;
}
.scheda::backdrop { background: rgb(15 23 42 / 0.6); }
.scheda-testa {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.scheda-testa h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.25;
}
.scheda-corpo { padding: 1rem 1.25rem 1.25rem; }
.scheda-corpo p {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}
.scheda .shot { margin-top: 1.25rem; }

/* Ingrandimento schermate ------------------------------------------------ */

.lightbox {
  width: min(96vw, 120rem);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.lightbox::backdrop { background: rgb(15 23 42 / 0.82); }
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 0.75rem 0.625rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.lightbox-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.lightbox-close,
.scheda-chiudi {
  margin-left: auto;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.lightbox-close:hover,
.scheda-chiudi:hover { border-color: var(--accent); }
.lightbox-conta { color: var(--ink); font-weight: 600; white-space: nowrap; }
.lightbox-conta::after { content: "·"; margin: 0 0.5rem; color: var(--muted); }
.lightbox-scena { position: relative; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0 0 0.25rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}
.lightbox-nav[hidden] { display: none; }
.lightbox-nav:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-prec { left: 0.75rem; }
.lightbox-succ { right: 0.75rem; }
.lightbox-img {
  max-height: calc(94vh - 4rem);
  width: auto;
  margin-inline: auto;
  background: #fff;
}

/* Consenso ai cookie di statistica ---------------------------------------- */
/* Fascia fissa in basso; Accetta e Rifiuta hanno lo stesso peso */

.banner-consenso {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--notte-line);
  background: var(--notte-3);
  box-shadow: 0 -12px 32px rgb(0 0 0 / 0.28);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.banner-consenso[hidden] { display: none; }
.consenso-inner {
  display: grid;
  gap: 0.875rem 3rem;
  max-width: 80rem;
  margin-inline: auto;
}
@media (min-width: 60rem) {
  .consenso-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
.consenso-titolo { margin: 0 0 0.25rem; color: #fff; font-size: 1.0625rem; font-weight: 700; }
.banner-consenso p { margin: 0; max-width: 62rem; }
.consenso-azioni { display: flex; gap: 0.75rem; }
.consenso-azioni .button { flex: 1 1 0; justify-content: center; min-width: 8rem; }
@media (min-width: 60rem) {
  .consenso-azioni .button { flex: none; }
}

.footer-consenso {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.footer-consenso:hover { color: var(--rosa); }

@media print {
  .site-header, .skip-link, .lightbox, .invito, .correlate, .banner-consenso { display: none; }
  .hero, .hero-visivo, .section-notte, .site-footer { background: none; }
  .hero-testo, .iter-riga, .section-notte, .site-footer { --ink: #000; --text: #000; --muted: #333; }
  .hero .shot-link::after { display: none; }
  .demo-pannello { display: block; }
  .band { background: none; color: inherit; }
  .band h2, .band h3, .band strong, .band .lead { color: inherit; }
}
