/*
 * La landing. I token vengono da console/src/styles/tokens.css, con lo stesso
 * brand #0ea5e9 in entrambi i temi e gli stessi valori misurati per contrasto.
 *
 * Tre stati del tema: senza scelta segue il sistema, con la scelta
 * (localStorage `nr-tema`, scritta dall'interruttore) vince la scelta. Le
 * sezioni `.scuro` - hero e Offline - restano scure in entrambi: sono il
 * contrappunto voluto, e ridefiniscono i token per se' e per i figli.
 */

:root,
.scuro {
  color-scheme: dark;
  --ground: #070b11;
  --ground-2: #0a1017;
  --surface: #0f151e;
  --surface-2: #131b26;
  --line: #1e2a37;
  --line-strong: #2b3a49;
  --ink: #e6eef3;
  --ink-2: #a9bdc9;
  --muted: #8299a6;
  --brand: #0ea5e9;
  --brand-strong: #38bdf8;
  --brand-text: #38bdf8;
  --brand-soft: #0a2f45;
  --brand-glow: rgba(14, 165, 233, 0.24);
  --on-brand: #ffffff;
  --ok: #34d399;
  --warn: #fbbf24;
  --crit: #fb7185;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 32px 64px -24px rgba(0, 0, 0, 0.85);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --ground: #f4f7f9;
    --ground-2: #eaf0f4;
    --surface: #ffffff;
    --surface-2: #f8fafb;
    --line: #dde5ea;
    --line-strong: #c6d2da;
    --ink: #0b1a24;
    --ink-2: #3d5561;
    --muted: #566c76;
    --brand-strong: #0284c7;
  /* Il brand come TESTO sul fondo chiaro: #0284c7 arriva a 3,6:1, questo a 5,3:1. */
  --brand-text: #0369a1;
    --brand-soft: #d6eefc;
    --brand-glow: rgba(14, 165, 233, 0.18);
    --ok: #047857;
    --warn: #9f5704;
    --crit: #be123c;
    --shadow: 0 1px 2px rgba(11, 26, 36, 0.04), 0 8px 24px -12px rgba(11, 26, 36, 0.14);
    --shadow-lg: 0 2px 4px rgba(11, 26, 36, 0.05), 0 24px 48px -20px rgba(11, 26, 36, 0.24);
  }
}

:root[data-theme='light'] {
  color-scheme: light;
  --ground: #f4f7f9;
  --ground-2: #eaf0f4;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #dde5ea;
  --line-strong: #c6d2da;
  --ink: #0b1a24;
  --ink-2: #3d5561;
  --muted: #566c76;
  --brand-strong: #0284c7;
  /* Il brand come TESTO sul fondo chiaro: #0284c7 arriva a 3,6:1, questo a 5,3:1. */
  --brand-text: #0369a1;
  --brand-soft: #d6eefc;
  --brand-glow: rgba(14, 165, 233, 0.18);
  --ok: #047857;
  --warn: #9f5704;
  --crit: #be123c;
  --shadow: 0 1px 2px rgba(11, 26, 36, 0.04), 0 8px 24px -12px rgba(11, 26, 36, 0.14);
  --shadow-lg: 0 2px 4px rgba(11, 26, 36, 0.05), 0 24px 48px -20px rgba(11, 26, 36, 0.24);
}

:root {
  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --r-xl: 22px;
  --ring: 0 0 0 3px var(--brand-strong);
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Consolas, ui-monospace, monospace;
  --testata: 64px;
  --gutter: max(16px, calc((100vw - 1200px) / 2));
}

/* ------------------------------------------------------------------ base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--testata);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  background: var(--ground);
  color: var(--ink);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 750;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

p {
  margin: 0;
}

a {
  color: var(--brand-text);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

::selection {
  background: var(--brand-glow);
}

.salta {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--brand);
  color: #04131d;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-weight: 650;
}

.salta:focus {
  top: 12px;
}

section {
  padding: 112px var(--gutter);
  background: var(--ground);
  color: var(--ink);
}

.intestazione {
  max-width: 760px;
  margin-bottom: 56px;
}

.occhiello {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font: 650 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-text);
}

.spia {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
}

.scheda {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.icona-grande {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--r);
  background: var(--brand-soft);
  color: var(--brand-strong);
  stroke-width: 1.8;
}

/* -------------------------------------------------------------- bottoni */

.bottone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font: 650 0.95rem/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
}

/* Testo scuro sul brand, come i pulsanti dell'app del palmare: il bianco su
   #0ea5e9 si ferma a 2,8:1, questo supera 7:1. */
.bottone.primario {
  background: var(--brand);
  color: #04131d;
  box-shadow: 0 8px 24px -10px var(--brand);
}

.bottone.primario:hover {
  background: #38bdf8;
}

.bottone.secondario {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.bottone.secondario:hover {
  border-color: var(--brand);
}

.bottone.grande {
  min-height: 50px;
  padding: 0 24px;
  font-size: 1rem;
}

.bottone[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* ------------------------------------------------------------- testata */

.testata {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--testata);
  /* Tre zone: il marchio a sinistra, le sezioni al centro della pagina e non
     dello spazio avanzato, le azioni a destra. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.marchio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.marchio svg {
  width: 32px;
  height: 32px;
  stroke: none;
}

.marchio b {
  color: var(--brand-text);
}

.testata .marchio {
  justify-self: start;
}

.ancore {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.ancore a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 550;
  transition: color 0.15s, background-color 0.15s;
}

.ancore a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

/* La sezione in vista, segnata dallo script mentre si scorre. */
.ancore a[aria-current] {
  color: var(--brand-text);
  background: var(--brand-soft);
}

.ancore .solo-menu {
  display: none;
}

.azioni-testata {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.separatore {
  width: 1px;
  height: 20px;
  margin: 0 2px;
  background: var(--line-strong);
}

.accedi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s;
}

.accedi svg {
  color: var(--brand-text);
}

.accedi:hover {
  color: var(--brand-text);
}

.azioni-testata .bottone.primario {
  min-height: 38px;
  font-size: 0.92rem;
  box-shadow: 0 6px 18px -10px var(--brand);
}

.icona {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.icona:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.menu {
  display: none;
}

.menu .da-aperto,
.testata.aperta .menu .da-chiuso {
  display: none;
}

.testata.aperta .menu .da-aperto {
  display: block;
}

/* Il sole nel tema scuro (porta al chiaro), la luna nel chiaro. */
.se-chiaro {
  display: none;
}

:root[data-theme='light'] .se-scuro {
  display: none;
}

:root[data-theme='light'] .se-chiaro {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .se-scuro {
    display: none;
  }

  :root:not([data-theme='dark']) .se-chiaro {
    display: block;
  }
}

/* ----------------------------------------------------------------- hero */

.hero {
  min-height: calc(100svh - var(--testata));
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  column-gap: 48px;
  padding-top: 72px;
  padding-bottom: 40px;
  background:
    radial-gradient(900px 520px at 78% 42%, var(--brand-glow), transparent 62%),
    linear-gradient(180deg, transparent 70%, rgba(14, 165, 233, 0.05)),
    var(--ground);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--surface) 1px, transparent 1px),
    linear-gradient(90deg, var(--surface) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(700px 420px at 72% 45%, #000, transparent);
  -webkit-mask-image: radial-gradient(700px 420px at 72% 45%, #000, transparent);
  pointer-events: none;
}

.hero > * {
  position: relative;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 750;
  margin-bottom: 22px;
  text-wrap: balance;
}

.sottotitolo {
  font-size: 1.15rem;
  color: var(--ink-2);
  max-width: 34em;
  margin-bottom: 32px;
}

.azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.azioni svg {
  font-size: 18px;
}

.hero-scena {
  position: relative;
  aspect-ratio: 1 / 0.92;
  width: 100%;
}

.hero-console {
  position: absolute;
  right: -12%;
  top: 8%;
  width: 92%;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.hero .palmare {
  position: absolute;
  left: 2%;
  top: 2%;
  width: 43%;
}

.hero-onde {
  position: absolute;
  left: 23.5%;
  top: 6%;
  width: 0;
  height: 0;
}

.hero-onde span {
  position: absolute;
  left: 0;
  top: 0;
  border: 2px solid var(--brand);
  border-radius: 50%;
  opacity: 0;
}

.hero-contatore {
  position: absolute;
  left: 40%;
  top: 22%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font: 600 0.95rem/1 var(--mono);
  color: var(--ink-2);
}

.hero-contatore svg {
  color: var(--brand-strong);
}

.hero-contatore b {
  color: var(--ok);
  font-size: 1.15rem;
}

.fatti {
  grid-column: 1 / -1;
  list-style: none;
  margin: 56px 0 0;
  padding: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}

.fatti li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fatti svg {
  color: var(--brand-strong);
  font-size: 20px;
}

.fatti b {
  color: var(--ink);
}

/* ------------------------------------------------------------- palmare */

.palmare {
  position: relative;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.55));
}

.palmare-scocca {
  display: block;
  width: 100%;
  height: auto;
  stroke: none;
}

/* Lo schermo nella scocca: x=45 y=78 w=210 h=350 su 300x600, cioe' 480x800. */
.palmare-schermo {
  position: absolute;
  left: 15%;
  top: 13%;
  width: 70%;
  height: 58.333%;
  overflow: hidden;
  border-radius: 4px;
  background: #070b11;
}

.palmare-schermo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------ problema */

.tre {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.tre .scheda {
  padding: 28px;
}

.tre h3,
.griglia h3 {
  margin: 20px 0 8px;
}

.tre p,
.griglia p,
.settori p {
  color: var(--ink-2);
  font-size: 0.98rem;
}

/* ------------------------------------------------------- come funziona */

.come,
.per-chi {
  background: var(--ground-2);
}

.scena {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 56px;
  align-items: center;
}

.passi {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.passo {
  padding: 18px 22px;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 var(--r) var(--r) 0;
  transition: background-color 0.3s, border-color 0.3s;
}

.passo h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.passo p {
  color: var(--ink-2);
  font-size: 0.98rem;
}

.numero {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font: 700 0.9rem/1 var(--mono);
}

.passo.attivo {
  border-left-color: var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.passo.attivo .numero {
  background: var(--brand);
  color: #04131d;
}

/* Senza JS nessuna scena: tutti i passi pieni. */
html:not(.js) .passo {
  border-left-color: var(--brand);
}

.scena-visiva {
  position: relative;
  height: min(68vh, 620px);
}

.scena-console {
  position: absolute;
  right: 0;
  top: 6%;
  width: 88%;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.scena-visiva .palmare {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32%;
}

.scena-console:not([data-passo='0']),
.scena-schermo:not([data-passo='1']) {
  opacity: 0;
  visibility: hidden;
}

.barra-avanzamento {
  position: absolute;
  left: -28px;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.barra-avanzamento i {
  display: block;
  height: 100%;
  background: var(--brand);
  transform-origin: top;
  transform: scaleY(0);
}

.solo-stretto {
  display: none;
}

/* ------------------------------------------------------------- offline */

.offline {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: center;
  background:
    radial-gradient(800px 480px at 20% 30%, var(--brand-glow), transparent 60%),
    var(--ground);
}

.offline-testo > p:not(.occhiello):not(.pill) {
  color: var(--ink-2);
  font-size: 1.08rem;
  margin: 22px 0 26px;
}

.punti {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.punti li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.punti svg {
  margin-top: 5px;
  color: var(--ok);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font: 600 0.95rem/1 var(--mono);
  color: var(--ink);
}

.pill i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent);
  transition: background-color 0.3s;
}

.pill[data-stato='offline'] i {
  background: var(--warn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 20%, transparent);
}

.pill[data-stato='sincronizzato'] i {
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent);
}

.offline-visiva {
  position: relative;
  aspect-ratio: 1 / 0.8;
}

.offline-console {
  position: absolute;
  right: 0;
  top: 0;
  width: 88%;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.offline-visiva .palmare {
  position: absolute;
  left: 0;
  bottom: -4%;
  width: 34%;
}

/* ------------------------------------------------------------- funzioni */

.griglia,
.settori {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

/* Tre colonne fisse e non auto-fit: le funzioni sono nove, e a quattro per
   riga l'ultima restava sola. */
.griglia {
  grid-template-columns: repeat(3, 1fr);
}

.griglia .scheda {
  padding: 26px;
}

/* ---------------------------------------------------------------- per chi */

.settori {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.settori li {
  padding: 24px;
  border-top: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 0 0 var(--r) var(--r);
  box-shadow: var(--shadow);
}

.settori svg {
  font-size: 28px;
  color: var(--brand-strong);
  stroke-width: 1.8;
}

.settori h3 {
  margin: 16px 0 6px;
}

/* ---------------------------------------------------------------- contatti */

.contatti {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}

.contatti-testo p:not(.occhiello) {
  color: var(--ink-2);
  font-size: 1.08rem;
  margin-top: 20px;
}

#modulo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 32px;
}

#modulo .largo {
  grid-column: 1 / -1;
}

/* Blocco e non griglia: «(facoltativo)» deve restare sulla riga dell'etichetta,
   e in una griglia diventava una riga a se' che disallineava i campi vicini. */
#modulo label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

#modulo small {
  font-weight: 400;
  color: var(--muted);
}

#modulo input:not([type='checkbox']),
#modulo select,
#modulo textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: 400 1rem/1.4 var(--sans);
}

#modulo textarea {
  resize: vertical;
}

#modulo input:focus-visible,
#modulo select:focus-visible,
#modulo textarea:focus-visible {
  border-color: var(--brand);
}

#modulo .consenso {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 400;
  color: var(--ink-2);
}

#modulo .consenso input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--brand);
  flex: none;
}

.informativa {
  font-size: 0.88rem;
  color: var(--muted);
}

.trappola {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#modulo-stato {
  min-height: 1.6em;
  font-weight: 600;
}

#modulo-stato[data-esito='ok'] {
  color: var(--ok);
}

#modulo-stato[data-esito='errore'] {
  color: var(--crit);
}

#modulo-stato[data-esito='attesa'] {
  color: var(--muted);
}

.avviso {
  color: var(--warn);
  font-weight: 600;
}

/* -------------------------------------------------------------------- piede */

.piede {
  padding: 48px var(--gutter);
  display: grid;
  gap: 10px;
  justify-items: start;
  border-top: 1px solid var(--line);
  background: var(--ground-2);
  color: var(--ink-2);
  font-size: 0.92rem;
}

.piede .marchio {
  margin-bottom: 8px;
}

.piede p a {
  color: var(--ink-2);
}

.piede .nota {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------ schermi stretti */

/* Le sezioni stanno al centro solo se le azioni entrano nella loro meta' di
   barra; sotto i 1280px non ci entrano, e le sezioni vanno accanto al marchio
   invece di restare quasi al centro. */
@media (max-width: 1279px) {
  .testata {
    grid-template-columns: auto auto 1fr;
    column-gap: 32px;
  }
}

/* Sotto i 1024px la barra non ha posto per tutto: le sezioni e la console
   passano in un menu a tendina, e in barra restano tema, richiesta e menu.
   Senza script il tasto resta nascosto e la barra perde solo le ancore. */
@media (max-width: 1023px) {
  .testata {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .ancore {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--ground);
    box-shadow: var(--shadow-lg);
  }

  .testata.aperta .ancore {
    display: flex;
  }

  .ancore a {
    padding: 14px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.05rem;
  }

  .ancore a:last-child {
    border-bottom: 0;
  }

  .ancore .solo-menu {
    display: block;
    color: var(--brand-text);
  }

  .separatore,
  .accedi {
    display: none;
  }

  .menu:not([hidden]) {
    display: inline-grid;
  }
}

/* Sotto i 900px niente scena fissa: ogni passo porta la sua schermata. */
@media (max-width: 900px) {
  section {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .hero,
  .scena,
  .offline,
  .contatti {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 48px;
    row-gap: 40px;
  }

  .hero-scena {
    max-width: 560px;
  }

  .scena-visiva {
    display: none;
  }

  .solo-stretto {
    display: block;
    margin-top: 18px;
    border-radius: var(--r);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-lg);
  }

  .solo-stretto.stretto {
    max-width: 240px;
  }

  .passo {
    border-left-color: var(--brand);
  }

  .offline {
    gap: 40px;
  }

  #modulo {
    padding: 22px;
  }

  .griglia {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .azioni-testata {
    gap: 4px;
  }

  .azioni-testata .bottone.primario {
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .marchio span {
    font-size: 1rem;
  }

  #modulo,
  .griglia {
    grid-template-columns: 1fr;
  }

  .fatti {
    gap: 12px;
    flex-direction: column;
  }
}

@media (max-width: 400px) {
  .marchio span {
    display: none;
  }
}
