/* MCD Design — foglio di stile
   Sito aziendale: base neutra in due temi, un accento blu e un secondo accento arancio per i dettagli.
   Regola di progetto: mai nero puro, mai bianco puro.
   Scuro:  fondo #0E0E10 · riquadri #1B1B1E · testo #F2F2F4
   Chiaro: fondo #F3F3F5 · riquadri #FBFBFC · testo #121214
   Accento: Blu elettrico #2F5BFF (testo sopra: #F6F7FF) · Dettagli: Arancio vivo #FF5A1F
   Carattere: Geist (variabile)

   Scala tipografica (rapporto circa 1,25):
   .875 note · .9375 elenchi · 1.0625 testo · 1.25 titolo piccolo · 1.5-1.75 titolo riquadro · 2-3 titolo in evidenza · 2-3.75 titolo sezione */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@property --bg      { syntax: "<color>"; inherits: true; initial-value: #0E0E10; }
@property --surface { syntax: "<color>"; inherits: true; initial-value: #1B1B1E; }
@property --fg      { syntax: "<color>"; inherits: true; initial-value: #F2F2F4; }
@property --muted   { syntax: "<color>"; inherits: true; initial-value: #A1A1A6; }
@property --line    { syntax: "<color>"; inherits: true; initial-value: rgba(242, 242, 244, .14); }

:root {
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pad: clamp(20px, 4.2vw, 72px);
  --gap: clamp(88px, 11vw, 168px);
  --wide: 1240px;
  --card: clamp(24px, 2.7vw, 40px);      /* margine interno dei riquadri */
  --radius: 28px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --bad: #E5484D;
  --shade: 14, 14, 16;                     /* base delle ombre: mai nero puro */
  /* grana fine da stendere sulle sfumature: toglie le righe e l'aspetto "troppo liscio" */
  --grana: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");

  /* tema scuro (predefinito) */
  --bg: #0E0E10;
  --surface: #1B1B1E;
  --fg: #F2F2F4;
  --muted: #A1A1A6;
  --line: rgba(242, 242, 244, .14);
  --link: #7C97FF;

  --accent: #2F5BFF;
  --on-accent: #F6F7FF;
  --accent-2: #FF5A1F;

  color-scheme: dark;
  transition: --bg .6s var(--ease), --surface .6s var(--ease), --fg .6s var(--ease), --muted .6s var(--ease), --line .6s var(--ease);
}
:root[data-theme="light"] {
  --bg: #F3F3F5;
  --surface: #FBFBFC;
  --fg: #121214;
  --muted: #67676C;
  --line: rgba(18, 18, 20, .14);
  --link: #2F5BFF;
  color-scheme: light;
}
:root.is-swapping { transition: none; }
/* cambio tema: il vecchio resta fermo sotto; il nuovo si vede solo dentro la sagoma che segue la macchia (tinta.js) */
:root.is-inking::view-transition-old(root),
:root.is-inking::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.is-inking::view-transition-new(root) { clip-path: var(--tinta-clip, inset(100%)); }
:root.is-inking::view-transition-group(tinta) { animation: none; }
:root.is-inking::view-transition-old(tinta) { display: none; }
:root.is-inking::view-transition-new(tinta) { animation: none; mix-blend-mode: normal; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
canvas, img { display: block; }
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

::selection { background: var(--accent-2); color: #121214; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--pad); top: -80px; z-index: 100;
  padding: .7em 1.1em; background: var(--accent); color: var(--on-accent);
  border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 14px; }

/* ---------- Titoli e testi di sezione ---------- */
.h2 {
  font-weight: 620;
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  line-height: 1.06;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.h2--big { font-size: clamp(3rem, 8.4vw, 6.5rem); letter-spacing: -.045em; }
.sub { max-width: 42ch; margin-inline: auto; color: var(--muted); font-size: clamp(1.0625rem, 1.45vw, 1.25rem); line-height: 1.45; text-wrap: balance; }
.head { display: grid; gap: 16px; justify-items: center; text-align: center; margin-bottom: clamp(36px, 4.6vw, 64px); }

.block { padding: 0 var(--pad) var(--gap); max-width: calc(var(--wide) + var(--pad) * 2); margin-inline: auto; }
.block--band { max-width: none; padding-block: var(--gap); margin-bottom: var(--gap); background: var(--surface); }
.block--band > * { max-width: var(--wide); margin-inline: auto; }

/* ---------- Pulsanti e link d'azione ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.5em;
  border: 0; border-radius: 999px;
  background: var(--surface); color: var(--fg);
  font: 500 1.0625rem/1 var(--sans);
  text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
/* Pulsante pieno "illuminato": quattro ombre, una per ruolo. Luce e ombra non sono mai bianco o nero puri. */
.btn--fill {
  background: var(--accent); color: var(--on-accent);
  box-shadow:
    inset 0 1px 0 rgba(246, 247, 255, .34),                              /* luce sul bordo alto */
    inset 0 -2px 0 rgba(var(--shade), .2),                                /* ombra sul bordo basso */
    0 1px 2px rgba(var(--shade), .38),                                    /* contatto con la superficie */
    0 8px 22px -6px color-mix(in srgb, var(--accent) 62%, transparent);  /* alone del colore */
  transition: background-color .25s ease, box-shadow .25s ease, transform .2s var(--ease);
}
.btn--fill:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--on-accent));
  box-shadow:
    inset 0 1px 0 rgba(246, 247, 255, .42),
    inset 0 -2px 0 rgba(var(--shade), .2),
    0 1px 2px rgba(var(--shade), .38),
    0 10px 28px -6px color-mix(in srgb, var(--accent) 78%, transparent);
}
.btn--fill:active {
  transform: scale(.98);
  box-shadow: inset 0 2px 3px rgba(var(--shade), .3), 0 1px 2px rgba(var(--shade), .3);   /* premuto: la luce si spegne */
}
.btn--fill[disabled] { box-shadow: none; }
.btn--small { min-height: 36px; padding: 0 1.05em; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: default; }

.more {
  display: inline-flex; align-items: center; gap: .32em;
  color: var(--link); font-weight: 500; font-size: 1.0625rem; text-decoration: none;
}
.more::after {
  content: ""; width: .44em; height: .44em; margin-top: .08em;
  border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .3s var(--ease);
}
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.more:hover::after, a:hover > .more::after { transform: translateX(3px) rotate(45deg); }

/* ---------- Testata ---------- */
/* Testata: in cima alla pagina è una barra a tutta larghezza; appena si scorre diventa
   una barra staccata dal bordo, con gli angoli dei riquadri e l'effetto vetro. Resta sempre visibile. */
.top {
  --vetro: 242, 242, 244;                 /* colore dei riflessi: mai bianco puro */
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: 60px; padding: 0 var(--pad);
  border-radius: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  transition: top .55s var(--ease), left .55s var(--ease), right .55s var(--ease), height .55s var(--ease),
              padding .55s var(--ease), border-radius .55s var(--ease), background-color .4s var(--ease),
              border-color .4s var(--ease), box-shadow .55s var(--ease);
}
/* In cima la testata è trasparente su tutte le pagine, come in home.
   La classe .is-over resta sulle pagine interne solo per dire agli script che lì non c'è l'animazione d'ingresso. */
/* dopo lo scorrimento: barra a vetro staccata dal bordo */
.top.is-pill {
  top: 14px; left: max(14px, calc(50% - 560px)); right: max(14px, calc(50% - 560px));
  height: 58px; padding: 0 11px 0 20px;
  border-radius: 18px;
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.08);
  backdrop-filter: blur(22px) saturate(190%) brightness(1.08);
  /* nessun filo sul contorno: come i riquadri, la barra si stacca solo per superficie e ombra */
  box-shadow:
    inset 0 14px 20px -16px rgba(var(--vetro), .22),       /* riflesso interno in alto, sfumato */
    inset 0 -10px 16px -14px rgba(var(--shade), .5);       /* ombra interna in basso: dà spessore */
  /* Tema scuro: niente ombra esterna larga. Su fondi scuri un'ombra morbida ha pochi toni a disposizione
     e si vede a gradini, come un alone ad anelli. Vale per tutti gli elementi sospesi: ombra corta o nessuna. */
}
/* riflesso obliquo sulla superficie, sotto ai contenuti: compare con il vetro */
.top::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(112deg, rgba(var(--vetro), .16) 0%, rgba(var(--vetro), 0) 30%, rgba(var(--vetro), 0) 70%, rgba(var(--vetro), .08) 100%);
  opacity: 0; transition: opacity .55s var(--ease);
}
.top.is-pill::before { opacity: 1; }
:root[data-theme="light"] .top { --vetro: 251, 251, 252; }
:root[data-theme="light"] .top.is-pill {
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  box-shadow:
    inset 0 14px 20px -16px rgba(var(--vetro), .8),
    inset 0 -10px 16px -14px rgba(var(--shade), .1),
    0 12px 40px rgba(var(--shade), .14);
}

/* Vetro "liquido": oltre a sfocare, piega quello che passa dietro la barra (filtro SVG in inc/footer.php).
   Solo i browser Chromium lo disegnano: gli altri non mostrerebbero nulla, quindi lo accende main.js
   con la classe .has-liquid e altrove resta il vetro sfocato qui sopra. Meno sfocatura e superficie
   più trasparente, altrimenti la piega non si vede. */
:root.has-liquid .top.is-pill {
  background: color-mix(in srgb, var(--surface) 48%, transparent);
  -webkit-backdrop-filter: url(#vetro-liquido) blur(4px) saturate(190%) brightness(1.08);
  backdrop-filter: url(#vetro-liquido) blur(4px) saturate(190%) brightness(1.08);
}
:root.has-liquid[data-theme="light"] .top.is-pill { background: color-mix(in srgb, var(--surface) 56%, transparent); }

.brand { display: grid; justify-self: start; text-decoration: none; line-height: 1.1; }
.brand__name { display: block; line-height: 0; }
.brand__logo { display: block; width: auto; height: 24px; }

.menu { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.menu a { font-size: .9rem; text-decoration: none; color: var(--muted); transition: color .25s; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--fg); }

.top__end { display: flex; align-items: center; gap: 10px; justify-self: end; }

.theme {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; cursor: pointer;
  transition: border-color .3s var(--ease);
}
.theme:hover { border-color: var(--fg); }
.theme__icon {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--fg);
  background: linear-gradient(90deg, var(--fg) 50%, transparent 50%);
  transition: transform .9s var(--ease);
}
:root[data-theme="light"] .theme__icon { transform: rotate(180deg); }

/* menu per schermi piccoli: funziona senza JavaScript */
.burger { display: none; position: relative; }
.burger summary {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; list-style: none;
}
.burger summary::-webkit-details-marker { display: none; }
.burger summary span, .burger summary span::after {
  display: block; width: 14px; height: 1.5px; background: var(--fg);
  transition: transform .3s var(--ease);
}
.burger summary span { transform: translateY(-3px); }
.burger summary span::after { content: ""; transform: translateY(6px); }
.burger[open] summary span { transform: rotate(45deg); }
.burger[open] summary span::after { transform: rotate(-90deg); }
.burger__panel {
  position: absolute; right: 0; top: 46px;
  display: grid; min-width: 210px; padding: 8px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(var(--shade), .5);
}
:root[data-theme="light"] .burger__panel { box-shadow: 0 18px 50px rgba(var(--shade), .2); }
.burger__panel a { padding: .7em .9em; border-radius: 12px; text-decoration: none; }
.burger__panel a:hover, .burger__panel a[aria-current="page"] { background: color-mix(in srgb, var(--fg) 8%, transparent); }

@media (max-width: 860px) {
  .top { grid-template-columns: 1fr auto; }
  .top.is-pill { top: 8px; left: 8px; right: 8px; height: 52px; padding: 0 8px 0 16px; border-radius: 16px; }
  .menu { display: none; }
  .burger { display: block; }
}
@media (max-width: 480px) {
  .top .btn--small { display: none; }
}

/* ---------- Hero della home ---------- */
.hero {
  position: relative;
  display: grid; justify-items: center; grid-template-rows: auto minmax(0, 1fr);
  /* titolo, testo e animazione stanno in una schermata: svh è l'altezza visibile con le barre del browser aperte */
  min-height: 100vh; min-height: 100svh;
  padding: clamp(84px, 13vh, 132px) var(--pad) clamp(16px, 3vw, 40px);
  overflow: hidden;
  text-align: center;
  background: var(--bg);
}
.hero__field, .hero__brain { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__brain { pointer-events: none; will-change: transform, opacity; }
.hero__copy { position: relative; display: grid; justify-items: center; gap: 20px; }

.hero__title {
  font-weight: 640;
  font-variation-settings: "wght" 640;
  font-size: clamp(2.25rem, 9.4vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.hero__title .line { display: block; overflow: hidden; padding: .04em 0 .14em; margin-bottom: -.14em; }
.hero__title .line__in { display: block; }
.hero__title .w { display: inline-block; white-space: nowrap; }
.hero__title .c { display: inline-block; transform-origin: 0 100%; }
.hero__sub {
  max-width: 44ch;
  font-size: clamp(1.0625rem, 1.5vw, 1.3rem); line-height: 1.45;
  color: var(--muted);
  text-wrap: balance;
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 6px; }
/* spazio in cui il canvas disegna il cervello */
.hero__stage { position: relative; align-self: stretch; width: min(100%, 760px); min-height: 200px; max-height: 560px; margin-top: clamp(8px, 2vh, 24px); pointer-events: none; }

/* telefono: testi più raccolti, così il cervello ha spazio e tutto resta in una schermata */
@media (max-width: 480px) {
  .hero { padding-top: 76px; }
  .hero__copy { gap: 14px; }
  .hero__sub { font-size: .9375rem; line-height: 1.4; }
  .hero__actions { gap: 10px 18px; margin-top: 4px; }
  .hero__actions .btn { min-height: 46px; padding: 0 1.25em; font-size: 1rem; }
  .hero__actions .more { font-size: 1rem; }
  .hero__stage { margin-top: 4px; }
}
/* schermi bassi, per esempio il telefono in orizzontale: l'animazione si riduce invece di allungare la pagina */
@media (max-height: 700px) { .hero { padding-top: 76px; } .hero__stage { min-height: 160px; } }
@media (max-height: 520px) { .hero__stage { min-height: 130px; } }

html.js:not(.is-ready) .hero__copy,
html.js:not(.is-ready) .top:not(.is-over) { visibility: hidden; }

@media (min-width: 720px) {
  .hero__title { font-size: clamp(3rem, 4.9vw, 5.2rem); }
  .hero__title .line { white-space: nowrap; }
}

/* ---------- Hero delle pagine interne ---------- */
.page-hero {
  position: relative;
  display: grid; justify-items: center; gap: 22px;
  padding: clamp(120px, 17vh, 176px) var(--pad) clamp(72px, 9vw, 128px);
  text-align: center;
  background:
    radial-gradient(52% 70% at 50% 0%, color-mix(in srgb, var(--accent) 34%, transparent) 0%, transparent 72%),
    radial-gradient(22% 30% at 34% 8%, color-mix(in srgb, var(--accent-2) 26%, transparent) 0%, transparent 70%);
}
/* grana sopra la sfumatura, sotto i testi */
.page-hero::before, .cta::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background-image: var(--grana); background-size: 220px 220px;
  opacity: .26; mix-blend-mode: overlay;   /* quanto basta a rompere le righe della sfumatura: non si deve notare */
}
:root[data-theme="light"] .page-hero::before, :root[data-theme="light"] .cta::before { opacity: .16; }
.page-hero > *, .cta > * { position: relative; z-index: 1; }
.crumbs { display: flex; align-items: center; gap: .6em; font-size: .875rem; color: var(--muted); }
.crumbs { flex-wrap: wrap; justify-content: center; row-gap: 2px; }
.crumbs > * { white-space: nowrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.page-hero__title { max-width: 16em; font-weight: 640; font-size: clamp(2.5rem, 5.6vw, 5rem); line-height: 1.03; letter-spacing: -.045em; text-wrap: balance; }
.page-hero__lead { max-width: 58ch; font-size: clamp(1.0625rem, 1.5vw, 1.3rem); line-height: 1.5; color: var(--muted); text-wrap: pretty; }

/* ---------- Riquadri ----------
   Gerarchia interna: titolo, 12px, testo, 20px, elenco, poi il link ancorato in basso. */
.tiles { display: grid; gap: clamp(12px, 1.5vw, 20px); }
.tile {
  display: flex; flex-direction: column;
  padding: var(--card);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}
.tile__name { font-weight: 620; font-size: clamp(1.5rem, 2.1vw, 1.875rem); line-height: 1.12; letter-spacing: -.032em; text-wrap: balance; }
.tile__text { max-width: 44ch; margin-top: 12px; color: var(--muted); }
.tile__items { display: grid; gap: 8px; margin-top: 20px; font-size: .9375rem; line-height: 1.4; }
.tile__items li { position: relative; padding-left: 1.15em; }
.tile__items li::before { content: ""; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.tile .more { margin-top: auto; padding-top: 28px; }
/* prezzo di una fascia: stessa misura dei numeri dei passaggi */
.tile__price { margin-top: 10px; font-weight: 640; font-size: 2.5rem; line-height: 1; letter-spacing: -.05em; }
.tile__price + .tile__text { margin-top: 14px; }

@media (min-width: 760px) {
  .tiles { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tile { grid-column: span 5; }
  .tile--wide { grid-column: span 7; }
  .tile:nth-child(5), .tile:nth-child(6) { grid-column: span 6; }
  .tile.tile--full { grid-column: 1 / -1; }   /* riquadro rimasto solo sull'ultima riga: la occupa tutta */
}
/* nei riquadri larghi l'elenco sta in una colonna a fianco, così lo spazio non resta vuoto */
@media (min-width: 1040px) {
  .tile--wide { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); grid-template-rows: auto auto 1fr; column-gap: clamp(24px, 3vw, 48px); }
  .tile--wide .tile__name, .tile--wide .tile__text, .tile--wide .more { grid-column: 1; }
  .tile--wide .tile__items { grid-column: 2; grid-row: 1 / span 3; align-content: start; margin-top: 6px; padding-left: clamp(20px, 2.4vw, 36px); border-left: 1px solid var(--line); }
  .tile--wide .more { align-self: end; }
}

/* riquadri a due colonne nelle pagine servizio */
@media (min-width: 760px) {
  .tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles--2 .tile, .tiles--2 .tile:nth-child(n) { grid-column: auto; }
  .tiles--2 .tile.tile--full { grid-column: 1 / -1; }   /* numero dispari di riquadri: l'ultimo occupa la riga */
}
.tiles--2 .tile__name { font-size: clamp(1.375rem, 1.9vw, 1.625rem); }

/* riquadri-link verso gli altri servizi */
.related { display: grid; gap: clamp(12px, 1.5vw, 20px); }
.tile--link { transition: transform .4s var(--ease), background-color .4s var(--ease); }
.tile--link:hover { transform: translateY(-4px); }
.tile--link .tile__name { font-size: 1.375rem; }
.tile--link .tile__text { font-size: 1rem; }
/* tre per riga; se sono meno di tre restano al centro, simmetrici */
@media (min-width: 760px) {
  .related { --rgap: clamp(12px, 1.5vw, 20px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--rgap); }
  .related .tile { flex: 0 0 calc((100% - 2 * var(--rgap)) / 3); min-width: 0; }
}

/* ---------- Elenco di punti (nelle fasce) ---------- */
.checks { display: grid; gap: clamp(12px, 1.5vw, 20px); }
.check-item { position: relative; padding: clamp(22px, 2.3vw, 32px); padding-left: calc(clamp(22px, 2.3vw, 32px) + 22px); border-radius: 22px; background: var(--bg); }
.check-item::before { content: ""; position: absolute; left: clamp(22px, 2.3vw, 32px); top: calc(clamp(22px, 2.3vw, 32px) + .62em); width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.check-item__name { font-weight: 600; font-size: 1.1875rem; line-height: 1.25; letter-spacing: -.02em; }
.check-item__text { margin-top: 8px; color: var(--muted); font-size: 1rem; }
@media (min-width: 680px) { .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); } .checks:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Dichiarazione ---------- */
.statement { padding: 0 var(--pad) var(--gap); }
.statement__text {
  max-width: 20em; margin-inline: auto;
  font-weight: 600; font-size: clamp(1.7rem, 3.9vw, 3.25rem); line-height: 1.14; letter-spacing: -.035em;
  text-align: center; text-wrap: balance;
}
.statement__text .w { display: inline-block; }

/* ---------- Progetto in evidenza ---------- */
.feature {
  display: grid; gap: clamp(28px, 4vw, 56px); align-items: center;
  padding: var(--card);
  border-radius: var(--radius);
  background: var(--surface);
}
.feature__copy { display: grid; justify-items: start; }
.feature__kind { display: flex; align-items: center; gap: .6em; font-size: .875rem; font-weight: 500; color: var(--muted); }
.feature__kind::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: var(--accent-2); }
.feature__name { margin-top: 12px; font-weight: 620; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.05; letter-spacing: -.04em; }
.feature__text { max-width: 42ch; margin-top: 16px; color: var(--muted); }
.feature__note { max-width: 42ch; margin-top: 14px; font-size: .9375rem; font-weight: 500; color: var(--fg); }
.feature .more { margin-top: 28px; }
/* nessuna ombra: il riquadro del disegno è incassato nel riquadro, non sollevato */
.feature__visual { border-radius: 18px; overflow: hidden; container-type: inline-size; }
@media (min-width: 900px) { .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding-left: calc(var(--card) + 12px); } }

/* Disegni animati dei progetti (SVG in inc/progetti.php, tempi mossi da main.js).
   Qui c'è lo stato fermo e completo: è quello che si vede senza script o con il movimento ridotto. */
.scene {
  aspect-ratio: 3 / 2;
  /* fondo a puntini fini, come un foglio tecnico: dà dettaglio anche a schermo grande */
  background:
    radial-gradient(circle, color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1.6px) 0 0 / 22px 22px,
    var(--bg);
}
.scene svg { display: block; width: 100%; height: 100%; }
/* I disegni sono vettoriali: non sgranano mai. Su schermi grandi però le forme, ingrandite, sembravano grossolane.
   Quindi i tratti restano sottili a qualsiasi grandezza e, quando il riquadro è largo, il disegno occupa meno spazio. */
.s-root { transform-box: view-box; transform-origin: 50% 50%; }
.scene .s-icon, .scene .s-track, .scene .s-prog, .scene .s-ring, .scene .s-recinto { vector-effect: non-scaling-stroke; }
@container (min-width: 600px) { .s-root { transform: scale(.84); } }
@container (min-width: 740px) { .s-root { transform: scale(.74); } }
.scene [data-a] { transform-box: fill-box; transform-origin: 50% 50%; }
.scene [data-a="draw"] { transform-origin: 0 50%; }
.scene [data-a="grow"] { transform-origin: 50% 0; }
.scene [data-a="run"], .scene [data-a="blink"], .scene [data-a="pulse"] { opacity: 0; }
.scene [data-a="wave"] { transform: scaleY(.5); }
.s-card { fill: var(--surface); }
.s-ink { fill: color-mix(in srgb, var(--fg) 24%, transparent); }
.s-ink--forte { fill: color-mix(in srgb, var(--fg) 62%, transparent); }
.s-track { stroke: var(--line); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.s-prog { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.s-node, .s-dot, .s-onda rect { fill: var(--accent); }
.s-node--2 { fill: var(--accent-2); }
.s-fill { fill: var(--fg); }
.s-icon { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.s-icon--blu { stroke: var(--link); stroke-width: 2.5; }
.s-icon--su { stroke: var(--on-accent); }
.s-ring { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.s-ring--2 { stroke: var(--accent-2); }
.s-luce { fill: color-mix(in srgb, var(--accent-2) 26%, transparent); }
.s-recinto { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 9; stroke-linecap: round; }
.s-text { fill: var(--muted); font: 500 16px var(--sans); }
.s-text--forte { fill: var(--fg); }
.s-text--su { fill: var(--on-accent); font-weight: 650; font-size: 14px; letter-spacing: .04em; }
.feature + .feature { margin-top: clamp(16px, 2vw, 24px); }
/* Lo stesso disegno fuori dalle schede dei progetti: nelle pagine dell'area AI */
.scene-box { max-width: 860px; margin-inline: auto; border-radius: 18px; overflow: hidden; container-type: inline-size; }
.prose .scene-box { margin-block: 28px; }
.head + .scene-box { margin-bottom: clamp(20px, 3vw, 36px); }
/* Da sola in pagina la scena è larga: riquadro più basso e disegno a grandezza piena, così non resta vuoto sopra e sotto.
   Sul telefono resta 3:2, altrimenti le scritte diventerebbero troppo piccole. */
@container (min-width: 600px) { .scene-box .scene { aspect-ratio: 2 / 1; } .scene-box .s-root { transform: none; } }

/* ---------- Metodo ---------- */
.steps { display: grid; gap: clamp(12px, 1.5vw, 20px); }
.step { display: flex; flex-direction: column; padding: clamp(24px, 2.4vw, 34px); border-radius: 24px; background: var(--bg); }
.step__n { font-weight: 640; font-size: 2.5rem; line-height: 1; letter-spacing: -.05em; color: var(--accent-2); }
.step__name { margin-top: 28px; font-weight: 620; font-size: 1.375rem; line-height: 1.15; letter-spacing: -.03em; }
.step__text { margin-top: 10px; color: var(--muted); font-size: 1rem; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Confronto (tabella) ---------- */
.compare { padding: clamp(8px, 1.4vw, 16px) var(--card); border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.compare table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; }
.compare th, .compare td { padding: 20px 20px 20px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { font-weight: 620; font-size: 1.375rem; letter-spacing: -.03em; }
.compare tbody th { width: 22%; font-weight: 500; font-size: .9375rem; color: var(--muted); }
.compare td { width: 39%; }
.compare--3 td { width: 26%; }
/* elenco a due colonne: voce e valore */
.compare--list table { min-width: 0; }
.compare--list tbody th { width: 58%; font-size: 1.0625rem; color: var(--fg); }
.compare--list td { width: 42%; }
.after-link { margin-top: 24px; text-align: center; }
.compare--3 table { min-width: 720px; }

/* ---------- Testo lungo delle guide ---------- */
.prose { max-width: 68ch; margin-inline: auto; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: clamp(40px, 4.8vw, 64px) 0 0; font-size: clamp(1.5rem, 2.4vw, 1.875rem); line-height: 1.15; font-weight: 620; letter-spacing: -.03em; }
.prose p, .prose ul, .prose ol { margin: 16px 0 0; font-size: 1.0625rem; line-height: 1.65; color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.2em; display: grid; gap: 10px; }
.prose ul { list-style: disc; }
.prose li::marker { color: var(--accent-2); font-weight: 600; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--link); text-underline-offset: 4px; }
.checks--sotto { margin-top: clamp(12px, 1.5vw, 20px); }
.prose__note--sola { max-width: 860px; margin-inline: auto; }
.prose__note { margin-top: 24px; padding: 18px 22px; border-radius: 18px; background: var(--surface); font-size: .9375rem; }

/* ---------- Domande frequenti ---------- */
.faq__list { max-width: 860px; margin-inline: auto; border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); interpolate-size: allow-keywords; }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 1.25em 0;
  cursor: pointer; list-style: none;
  font-weight: 560; font-size: clamp(1.125rem, 1.7vw, 1.375rem); line-height: 1.25; letter-spacing: -.02em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background:
    linear-gradient(var(--accent-2), var(--accent-2)) 50% 50% / 100% 2px no-repeat,
    linear-gradient(var(--accent-2), var(--accent-2)) 50% 50% / 2px 100% no-repeat;
  transition: transform .4s var(--ease);
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa::details-content { block-size: 0; overflow: hidden; transition: block-size .45s var(--ease), content-visibility .45s allow-discrete; }
.qa[open]::details-content { block-size: auto; }
.qa__a { padding: 0 0 1.5em; max-width: 64ch; color: var(--muted); }

/* ---------- Richiesta guidata (contatti) ---------- */
.wizard {
  max-width: 780px; margin-inline: auto;
  padding: var(--card);
  border-radius: var(--radius);
  background: var(--surface);
}
.wizard__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 28px; }
.wizard__back {
  display: inline-flex; align-items: center; gap: .45em; padding: 0;
  border: 0; background: none; color: var(--link); font-size: .9375rem; font-weight: 500; cursor: pointer;
}
.wizard__back::before { content: ""; width: .44em; height: .44em; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.wizard__back[hidden] { display: none; }
.wizard__next { margin-top: 20px; }
.wizard__next:has([hidden]) { display: none; }
.wizard__next [hidden] { display: none; }
.wizard.is-sent .wizard__next { display: none; }
.wizard__count { margin-left: auto; font-size: .875rem; color: var(--muted); }
.wizard__bar { height: 3px; margin: 14px 0 clamp(24px, 3vw, 36px); border-radius: 3px; background: var(--line); overflow: hidden; }
.wizard__bar span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease); }

.wstep { min-inline-size: 0; margin: 0 0 32px; padding: 0; border: 0; }
.wstep__q { display: block; width: 100%; margin-bottom: 22px; padding: 0; font-weight: 620; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.12; letter-spacing: -.035em; }
.wstep__q:focus { outline: none; }
/* senza JavaScript restano visibili le domande comuni; quelle di dettaglio dipendono dalla prima scelta */
html:not(.js) .wstep[data-for] { display: none; }
html.js .wstep { display: none; margin-bottom: 0; }
html.js .wstep.is-on { display: block; animation: wstep-in .5s var(--ease) both; }
@keyframes wstep-in { from { opacity: 0; transform: translateX(var(--from, 28px)); } to { opacity: 1; transform: none; } }

.wopts { display: grid; gap: 12px; }
@media (min-width: 620px) { .wopts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wopt { position: relative; display: block; cursor: pointer; }
.wopt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.wopt span {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 14px 20px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--bg);
  font-weight: 500; line-height: 1.3;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease);
}
.wopt span::after {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--muted);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.wopt:hover span { border-color: var(--fg); }
.wopt input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.wopt input:checked + span::after { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3.5px var(--bg); }
.wopt input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 3px; }
.wopt input:active + span { transform: scale(.985); }

.wizard__summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.wizard__summary li { padding: .4em .85em; border: 1px solid var(--line); border-radius: 999px; font-size: .875rem; color: var(--muted); }
.wizard__summary:empty { display: none; }
.wstep--last { display: grid; gap: 20px; }
html.js .wstep--last.is-on { display: grid; }
.wstep--last .wstep__q { margin-bottom: 18px; }
.wizard__via { display: inline-grid; grid-auto-flow: column; gap: 4px; justify-self: start; padding: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.wvia { position: relative; cursor: pointer; }
.wvia input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.wvia span { display: block; padding: .5em 1.15em; border-radius: 999px; font-size: .9375rem; font-weight: 500; color: var(--muted); transition: background-color .25s var(--ease), color .25s var(--ease); }
.wvia input:checked + span { background: var(--accent); color: var(--on-accent); }
.wvia input:focus-visible + span { outline: 2px solid var(--fg); outline-offset: 2px; }
.wizard__note summary { display: inline-block; color: var(--link); font-size: .9375rem; font-weight: 500; cursor: pointer; list-style: none; }
.wizard__note summary::-webkit-details-marker { display: none; }
.wizard__note[open] summary { margin-bottom: 12px; }
.wizard__done { display: grid; gap: 10px; justify-items: center; padding: clamp(24px, 4vw, 48px) 0; text-align: center; }
.wizard__done[hidden] { display: none; }
.wizard__done-title { font-weight: 620; font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.035em; }
.wizard__done-title:focus { outline: none; }
.wizard__done p { max-width: 38ch; color: var(--muted); }
.wizard.is-sent .wizard__top, .wizard.is-sent .wizard__bar, .wizard.is-sent .wizard__steps { display: none; }

.field { display: grid; gap: 6px; }
.field label { font-size: .875rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  min-height: 52px; padding: .8em .95em;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg); color: var(--fg);
  font: 400 1.0625rem/1.4 var(--sans);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent); }
.field.is-bad input, .field.is-bad textarea { border-color: var(--bad); }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.check.is-bad { color: var(--bad); }
.check a { text-underline-offset: 4px; }
.form__end { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.form__status { font-size: .9375rem; }
.form__status.is-bad { color: var(--bad); }

/* ---------- Fascia finale delle pagine interne ---------- */
.cta {
  position: relative;
  display: grid; justify-items: center; gap: 18px;
  margin: 0 var(--pad) var(--gap);
  padding: clamp(48px, 7vw, 104px) var(--card);
  border-radius: var(--radius);
  text-align: center;
  background:
    radial-gradient(60% 120% at 50% 110%, color-mix(in srgb, var(--accent) 46%, transparent) 0%, transparent 70%),
    var(--surface);
}
.cta__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-top: 10px; }
@media (min-width: 1384px) { .cta { max-width: var(--wide); margin-inline: auto; } }

/* ---------- Piè di pagina ---------- */
.foot { padding: clamp(40px, 5vw, 64px) var(--pad) 28px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.foot__cols { display: grid; gap: 32px 40px; max-width: var(--wide); margin-inline: auto; }
.foot__col ul { display: grid; gap: 8px; }
.foot__col a { text-decoration: none; }
.foot__col a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.foot__title { margin-bottom: 12px; font-size: .875rem; font-weight: 600; color: var(--fg); }
.foot__col--brand { display: grid; gap: 14px; align-content: start; max-width: 34ch; }
.foot__by { display: block; }
.foot__logo { height: 46px; width: auto; }
.foot__logo--light { display: none; }
:root[data-theme="light"] .foot__logo--dark { display: none; }
:root[data-theme="light"] .foot__logo--light { display: block; }
.foot__legal { max-width: var(--wide); margin: clamp(32px, 4vw, 48px) auto 0; padding-top: 18px; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .foot__cols { grid-template-columns: 1.6fr 1.2fr 1fr 1fr; } }

/* ---------- Pagina note legali ---------- */
.legal { max-width: 760px; margin-inline: auto; padding: 150px var(--pad) var(--gap); }
.legal__list { margin: clamp(32px, 5vw, 64px) 0 0; border-top: 1px solid var(--line); }
.legal__list div { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.legal__list dt { font-size: .9rem; color: var(--muted); }
.legal__list dd { margin: 0; font-size: 1.125rem; }
.legal__list a { text-underline-offset: 4px; }
.legal__note { margin-top: 28px; color: var(--muted); max-width: 52ch; }
.legal__intro { margin-top: clamp(20px, 2.4vw, 28px); font-size: 1.25rem; line-height: 1.45; color: var(--muted); max-width: 58ch; }
.legal__text { margin-top: clamp(32px, 5vw, 64px); border-top: 1px solid var(--line); max-width: 66ch; }
.legal__text h2 { margin: clamp(36px, 4.4vw, 56px) 0 0; font-size: 1.5rem; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.legal__text p, .legal__text ul { margin: 14px 0 0; font-size: 1.0625rem; line-height: 1.6; color: var(--muted); }
.legal__text ul { list-style: disc; padding-left: 1.15em; display: grid; gap: 8px; }
.legal__text li::marker { color: var(--accent-2); }
.legal__text strong { color: var(--fg); font-weight: 600; }
.legal__text a:not(.btn) { color: var(--link); text-underline-offset: 4px; }
.legal__text .btn { margin-top: 12px; }
@media (min-width: 640px) { .legal__list div { grid-template-columns: 200px 1fr; align-items: baseline; } }

/* ---------- Assistente AI: pulsante fisso in basso a destra e pannello della chat ---------- */
.aiw { position: fixed; right: max(12px, calc(var(--pad) - 16px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45; }
.aiw[hidden] { display: none; }
.aiw__open {
  position: relative; display: grid; place-items: center; width: 64px; height: 64px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--fg); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .35s var(--ease), opacity .25s ease;
}
.aiw__open:hover { transform: scale(1.06); }
.aiw__open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* etichetta accanto alla sfera: resta finché l'assistente non è stato aperto una volta */
.aiw__label {
  position: absolute; right: calc(100% + 4px); top: 50%; transform: translateY(-50%);
  padding: .55em 1em; border-radius: 999px; background: var(--surface); color: var(--fg);
  font: 500 .9375rem/1.2 var(--sans); white-space: nowrap;
  box-shadow: 0 3px 10px rgba(var(--shade), .5);
  transition: opacity .3s ease, visibility .3s;
}
.aiw.is-seen .aiw__label, .aiw.is-open .aiw__label { opacity: 0; visibility: hidden; }
@media (max-width: 759px) { .aiw__label { display: none; } }

/* la sfera: disegnata dallo script; senza WebGL resta questa, ferma */
.orb { position: relative; display: block; flex: none; width: 72px; height: 72px; pointer-events: none; }
.orb--s { width: 48px; height: 48px; }
.orb::before { content: ""; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #B9C6FF 0%, #2F5BFF 42%, #101A66 84%); }
.orb.is-live::before { content: none; }
.orb canvas { display: block; width: 100%; height: 100%; }

.aiw__panel {
  position: absolute; right: 0; bottom: calc(100% + 10px);
  display: flex; flex-direction: column;
  width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100vh - 180px)); height: min(620px, calc(100dvh - 180px));
  padding: 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 93%, var(--fg));   /* un filo più chiaro dei riquadri: si stacca senza bordo */
  box-shadow: 0 6px 18px rgba(var(--shade), .55);
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.96); transform-origin: 100% 100%;
  transition: opacity .28s ease, transform .28s var(--ease), visibility 0s linear .28s;
}
:root[data-theme="light"] .aiw__panel { background: var(--surface); box-shadow: 0 24px 70px rgba(var(--shade), .2); }
:root[data-theme="light"] .aiw__label, :root[data-theme="light"] .totop { box-shadow: 0 8px 28px rgba(var(--shade), .2); }
.aiw.is-open .aiw__panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.aiw__panel:focus { outline: none; }
.aiw__close {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: auto; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.aiw__close:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.aiw__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chat__top { display: flex; align-items: center; gap: 10px; padding: 0 0 10px 2px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.chat__name { margin: 0; font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.chat__state { margin: 2px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.3; }
.chat__log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 14px; overflow-y: auto; overscroll-behavior: contain; }
.chat__log:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.chat__msg { max-width: 86%; margin: 0; padding: .7em 1em; border-radius: 18px; font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.chat__msg--bot { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 6px; }
.chat__msg--user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.chat__msg--note { align-self: center; max-width: 100%; padding: .6em 1em; border: 1px solid var(--line); color: var(--muted); font-size: .9375rem; text-align: center; }
.chat__msg a { color: var(--link); text-underline-offset: 3px; }
.chat__form { display: flex; gap: 8px; margin-top: 6px; }
.chat__form[hidden] { display: none; }
.chat__form .btn { flex: none; }
.chat__input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 1.1em;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font: 400 1.0625rem/1.4 var(--sans);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.chat__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent); }
.chat__input:disabled { opacity: .6; }
.chat__reset {
  min-height: 48px; margin-top: 6px; padding: 0 1.2em; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--fg); font: 500 1rem/1.2 var(--sans); cursor: pointer; transition: border-color .2s ease;
}
.chat__reset[hidden] { display: none; }
.chat__reset:hover { border-color: var(--fg); }
.chat__reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat__note { margin: 12px 2px 0; color: var(--muted); font-size: .8125rem; line-height: 1.4; text-wrap: balance; }
.chat__note a { color: var(--link); text-underline-offset: 3px; }

/* telefono: il pannello occupa tutto lo schermo, sopra la testata, e segue la tastiera */
@media (max-width: 640px) {
  .aiw__panel {
    position: fixed; left: 8px; right: 8px; bottom: auto; width: auto;
    top: calc(var(--vvt, 0px) + 8px); height: calc(var(--vvh, 100vh) - 16px); height: calc(var(--vvh, 100dvh) - 16px);
    padding: 12px 14px; transform-origin: 100% 100%;
  }
  .aiw.is-open { z-index: 60; }                       /* sopra la testata: lo schermo è tutto della chat */
  .aiw .chat__top { padding-bottom: 8px; margin-bottom: 8px; }
  .aiw .orb--s { width: 40px; height: 40px; }
  .aiw .chat__note { margin-top: 8px; text-align: center; }
  .aiw.is-kb .chat__note { display: none; }           /* tastiera aperta: resta spazio per i messaggi */
  .aiw.is-open .aiw__open { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) { .aiw__panel, .aiw__open, .aiw__label { transition: none; } }

[data-chat-section] .btn { margin-top: 12px; }

/* il pulsante "torna in cima" sale sopra la sfera e lascia il posto al pannello aperto */
.has-ai .totop { right: max(20px, calc(var(--pad) - 8px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.has-ai-open .totop { opacity: 0; pointer-events: none; }

/* ---------- Luce di fondo e riquadri a vetro ----------
   Vale con la classe .is-glass su <html>, che head.php mette a tutti (tranne con "riduci trasparenza" o ?vetro=0;
   senza JavaScript resta il sito pieno). La luce dell'hero resta fissa dietro a tutta
   la pagina, animata anche scendendo, e i riquadri diventano vetro: superficie semitrasparente più sfocatura dello sfondo.
   Sui browser Chromium da computer (.has-liquid) il vetro piega anche quello che ha dietro. */
.sfondo { display: none; }
:root.is-glass { background: var(--bg); }
:root.is-glass body { background: transparent; }
:root.is-glass .sfondo { display: block; position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
:root.is-glass .hero { background: transparent; }
:root.is-glass .hero__field { display: none; }
:root.is-glass .block--band { background: transparent; }
:root.is-glass .page-hero { background: none; }
:root.is-glass .page-hero::before { display: none; }
:root.is-glass { --vetro-su: 246, 247, 255; }                 /* luce sul bordo alto dei riquadri: mai bianco puro */
:root.is-glass[data-theme="light"] { --vetro-su: 251, 251, 252; }
/* Il riquadro deve stare SOPRA la luce, non alla sua altezza. Come per il pulsante pieno, lo spessore lo danno
   le ombre: luce sul bordo alto, filo di contorno, ombra sul bordo basso, contatto, ombra corta sotto.
   La tinta più coperta e la sfocatura forte spengono la luce che passa dietro: così si legge come sfondo. */
:root.is-glass .tile, :root.is-glass .feature, :root.is-glass .wizard, :root.is-glass .compare,
:root.is-glass .prose__note, :root.is-glass .check-item, :root.is-glass .step, :root.is-glass .cta {
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(var(--vetro-su), .17),
    inset 0 0 0 1px rgba(var(--vetro-su), .05),
    inset 0 -1px 0 rgba(var(--shade), .4),
    0 1px 2px rgba(var(--shade), .5),
    0 16px 22px -16px rgba(var(--shade), .8);
}
:root.is-glass .tile, :root.is-glass .feature, :root.is-glass .wizard, :root.is-glass .compare,
:root.is-glass .prose__note, :root.is-glass .check-item, :root.is-glass .step {
  background:
    linear-gradient(180deg, rgba(var(--vetro-su), .06), rgba(var(--vetro-su), 0) 38%),
    color-mix(in srgb, var(--surface) 66%, transparent);
}
:root.is-glass .cta {
  background:
    radial-gradient(60% 120% at 50% 110%, color-mix(in srgb, var(--accent) 46%, transparent) 0%, transparent 70%),
    color-mix(in srgb, var(--surface) 66%, transparent);
}
:root.is-glass[data-theme="light"] .tile, :root.is-glass[data-theme="light"] .feature, :root.is-glass[data-theme="light"] .wizard,
:root.is-glass[data-theme="light"] .compare, :root.is-glass[data-theme="light"] .prose__note,
:root.is-glass[data-theme="light"] .check-item, :root.is-glass[data-theme="light"] .step {
  background:
    linear-gradient(180deg, rgba(var(--vetro-su), .5), rgba(var(--vetro-su), 0) 38%),
    color-mix(in srgb, var(--surface) 72%, transparent);
}
:root.is-glass[data-theme="light"] .tile, :root.is-glass[data-theme="light"] .feature, :root.is-glass[data-theme="light"] .wizard,
:root.is-glass[data-theme="light"] .compare, :root.is-glass[data-theme="light"] .prose__note,
:root.is-glass[data-theme="light"] .check-item, :root.is-glass[data-theme="light"] .step, :root.is-glass[data-theme="light"] .cta {
  box-shadow:
    inset 0 1px 0 rgba(var(--vetro-su), .9),
    inset 0 0 0 1px rgba(var(--shade), .05),
    0 1px 2px rgba(var(--shade), .08),
    0 18px 40px -20px rgba(var(--shade), .22);
}
/* dispositivi lenti: il vetro resta come tinta, senza sfocatura (è la parte che pesa di più) */
:root.is-glass.is-lite .tile, :root.is-glass.is-lite .feature, :root.is-glass.is-lite .wizard, :root.is-glass.is-lite .compare,
:root.is-glass.is-lite .prose__note, :root.is-glass.is-lite .check-item, :root.is-glass.is-lite .step, :root.is-glass.is-lite .cta {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
:root.is-glass.is-lite .tile, :root.is-glass.is-lite .feature, :root.is-glass.is-lite .wizard, :root.is-glass.is-lite .compare,
:root.is-glass.is-lite .prose__note, :root.is-glass.is-lite .check-item, :root.is-glass.is-lite .step {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}
/* dentro il vetro, i fondi pieni diventano velati */
:root.is-glass .wopt span, :root.is-glass .field input, :root.is-glass .field textarea { background: color-mix(in srgb, var(--bg) 55%, transparent); }
:root.is-glass .scene { background: radial-gradient(circle, color-mix(in srgb, var(--fg) 9%, transparent) 1px, transparent 1.6px) 0 0 / 22px 22px, color-mix(in srgb, var(--bg) 55%, transparent); }
/* vetro che piega lo sfondo, dove il browser lo sa disegnare */
:root.is-glass.has-liquid .tile, :root.is-glass.has-liquid .feature, :root.is-glass.has-liquid .wizard,
:root.is-glass.has-liquid .compare, :root.is-glass.has-liquid .check-item, :root.is-glass.has-liquid .step, :root.is-glass.has-liquid .cta {
  -webkit-backdrop-filter: url(#vetro-liquido) blur(16px) saturate(150%);
  backdrop-filter: url(#vetro-liquido) blur(16px) saturate(150%);
}

/* ---------- Pioggia di colore (cambio tema) ---------- */
/* ---------- Torna in cima ---------- */
.totop {
  position: fixed; right: max(16px, calc(var(--pad) - 8px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid color-mix(in srgb, var(--fg) 24%, transparent); border-radius: 50%; background: var(--surface); color: var(--fg); cursor: pointer;
  box-shadow: 0 3px 10px rgba(var(--shade), .5);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, border-color .2s ease;
}
.totop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { border-color: var(--fg); }
@media (prefers-reduced-motion: reduce) { .totop { transition: none; } }

/* inchiostro del cambio tema: sta sopra tutto e ha un livello suo nella transizione di pagina */
.tinta { position: fixed; inset: 0; z-index: 300; width: 100%; height: 100%; pointer-events: none; display: none; view-transition-name: tinta; }
.tinta.is-on { display: block; }

.rain { position: fixed; inset: 0; z-index: 200; width: 100%; height: 100%; pointer-events: none; display: none; }
.rain.is-on { display: block; }

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