/* MainPanel, parte pubblica (restyling 2026-12). Stili.
   Sorgente: Repository/redesign (prototipo), generato da tools/prod-assets.mjs. */

/* ===== site.css ===== */
/* MainPanel, parte pubblica: prototipo.
   Idea: il pannello come un'apparecchiatura da studio. Nero vero, metallo grafite, luci ambra che segnano solo cose vere
   (stato, avanzamento, velocita'). Un solo momento animato: l'ordine di esempio nella prima schermata. */

@font-face {
  font-family: "Google Sans Flex";
  src: url("../fonts/google-sans-flex-wdth.woff2") format("woff2");
  font-weight: 100 1000;
  font-stretch: 25% 151%;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Colori del marchio */
  --black: #000;
  --amber: #feb500;
  --gold: #fea921;
  --orange: #ff7802;

  /* Metallo e testo, caldi come l'ambra */
  --panel: #14120e;
  --panel-raised: #1c1914;
  --edge: #302a21;
  --edge-soft: #231f19;
  --led-off: #2c251a;
  --text: #f5f0e6;
  --text-2: #bfb7aa;
  --text-3: #8e877b;
  --focus: #ffd36e;
  --danger: #ff8a7a;
  --ok: #c9e7a0;

  --font: "Google Sans Flex", "Product Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  /* Movimento (curve di Emil Kowalski) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --container: 1320px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 72px;
  --section-y: clamp(80px, 9vw, 128px);
}

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

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--black);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: 0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--amber); color: var(--black); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 8px;
  background: var(--amber); color: var(--black); font-weight: 650; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Tipografia ---------- */

.display, h1, h2 {
  margin: 0;
  color: var(--text);
  font-stretch: 122%;
  font-weight: 690;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1, .h1 { font-size: clamp(2.5rem, 1.25rem + 4.1vw, 5rem); line-height: 0.98; }
h2, .h2 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.4rem); line-height: 1.02; }
h3, .h3 {
  margin: 0; color: var(--text); font-size: 1.3125rem; line-height: 1.25;
  font-stretch: 108%; font-weight: 640; letter-spacing: -0.008em; text-wrap: balance;
}
.lead { font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); line-height: 1.6; color: var(--text-2); max-width: 36em; }
.small { font-size: 0.9375rem; line-height: 1.55; }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.text-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 0.22em; text-decoration-thickness: 1.5px; }
@media (hover: hover) and (pointer: fine) {
  .text-link { transition: color 160ms ease; }
  .text-link:hover { color: var(--amber); }
}

/* ---------- Struttura ---------- */

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section + .section { padding-top: 0; }
.section-head { display: grid; gap: 20px; max-width: 46rem; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p { max-width: 38em; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 12px; border: 1px solid transparent;
  font-size: 1rem; font-stretch: 108%; font-weight: 650; letter-spacing: 0.005em; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--amber); color: var(--black); }
.btn-ghost { background: transparent; border-color: var(--edge); color: var(--text); }
.btn-sm { min-height: 40px; padding: 0 18px; border-radius: 10px; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
.btn[data-loading] .spinner { display: inline-block; }
.btn:not([data-loading]) .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #ffc22e; }
  .btn-ghost:hover { border-color: #4a4133; background: var(--panel); }
}

/* ---------- Intestazione ---------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease;
}
.site-header[data-scrolled] { background: rgba(0, 0, 0, 0.94); border-bottom-color: var(--edge-soft); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; flex: none; border-radius: 6px; }
.brand img { width: 148px; height: auto; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  padding: 10px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none;
  font-size: 0.96875rem; font-weight: 500; transition: color 160ms ease;
}
.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 8px; text-decoration-thickness: 2px; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text); } }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .link-login { padding: 10px 14px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 560; }
@media (hover: hover) and (pointer: fine) { .header-actions .link-login:hover { color: var(--amber); } }

.menu-toggle {
  display: none; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer;
}
.menu-toggle .bars { position: relative; display: block; width: 22px; height: 12px; margin: auto; }
.menu-toggle .bars::before, .menu-toggle .bars::after {
  content: ""; position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform 200ms var(--ease-out);
}
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { bottom: 0; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 49;
  padding: 12px var(--gutter) 28px; background: var(--black); border-bottom: 1px solid var(--edge-soft);
  opacity: 0; transform: translateY(-8px); visibility: hidden;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
}
.mobile-menu[data-open] { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.mobile-menu nav { display: grid; }
.mobile-menu nav a {
  display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--edge-soft);
  color: var(--text); text-decoration: none; font-size: 1.25rem; font-stretch: 112%; font-weight: 600;
}
.mobile-menu .menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

@media (max-width: 899px) {
  .nav, .header-actions .link-login, .header-actions .btn { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .header-actions { margin-left: auto; }
  .brand img { width: 132px; }
}

/* ---------- Prima schermata ---------- */

.hero { padding-top: calc(var(--header-h) + clamp(40px, 6vw, 88px)); padding-bottom: clamp(56px, 7vw, 104px); }
.hero-title { max-width: 16ch; margin-bottom: clamp(32px, 4vw, 56px); font-size: clamp(2.6rem, 1.1rem + 4.7vw, 5.6rem); }
@media (max-width: 639px) { .hero-title { font-stretch: 112%; } }
.hero-grid { display: grid; gap: clamp(40px, 5vw, 72px); align-items: start; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); } }
.hero-copy { display: grid; gap: 28px; justify-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero-proof { color: var(--text-3); font-size: 0.9375rem; max-width: 34em; }
.hero-proof strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* L'ordine di esempio: il pezzo forte della pagina */
.console {
  position: relative; display: grid; gap: 22px; padding: clamp(20px, 2.4vw, 28px);
  background: var(--panel); border: 1px solid var(--edge); border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.console-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.console-id { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; font-stretch: 108%; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px; border-radius: 8px; background: var(--panel-raised); border: 1px solid var(--edge-soft); font-size: 0.875rem; font-weight: 600; color: var(--text-2); }
.status .lamp { width: 9px; height: 9px; border-radius: 2px; background: var(--led-off); box-shadow: inset 0 0 0 1px #4a3f2c; transition: background-color 200ms ease; }
.status[data-state="progress"] { color: var(--text); }
.status[data-state="progress"] .lamp { background: var(--amber); box-shadow: none; }
.status[data-state="done"] { color: var(--black); background: var(--amber); border-color: var(--amber); }
.status[data-state="done"] .lamp { background: var(--black); box-shadow: none; }
.console-fields { display: grid; gap: 10px; }
.console-fields > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; align-items: baseline; }
.console-fields dt { color: var(--text-3); font-size: 0.875rem; }
.console-fields dd { color: var(--text); font-size: 0.96875rem; overflow-wrap: anywhere; }
.console-fields .link-value { color: var(--text-2); }

.meter { display: grid; grid-template-columns: repeat(32, 1fr); gap: 3px; height: 34px; }
.meter:empty { border-radius: 3px; background: linear-gradient(90deg, var(--amber), var(--orange)); }
.console[data-armed] .meter:empty { background: var(--led-off); }
.strip-meter:empty, .stair-meter:empty {
  border-radius: 3px;
  background: linear-gradient(to top, var(--amber) calc(var(--level) * 100% / var(--of, 12)), var(--led-off) 0);
}
.meter i {
  border-radius: 2px; background: var(--led-off);
  transition: background-color 90ms linear;
}
.meter i.on { background: color-mix(in oklab, var(--orange) calc(var(--i) * 3.1%), var(--amber)); }
.console-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.console-counts div { display: grid; gap: 2px; }
.console-counts dt { color: var(--text-3); font-size: 0.8125rem; }
.console-counts dd { color: var(--text); font-size: 1.25rem; font-weight: 620; font-variant-numeric: tabular-nums; font-stretch: 112%; }
.console-caption { margin-top: 14px; color: var(--text-3); font-size: 0.875rem; }

/* ---------- Le otto sorgenti, come un mixer ---------- */

.mixer { padding: clamp(16px, 2.2vw, 28px); background: var(--panel); border: 1px solid var(--edge); border-radius: 22px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.strips { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.strip {
  display: grid; grid-template-rows: 1fr auto; gap: 14px; min-height: 236px; padding: 16px 12px 14px;
  border: 1px solid var(--edge-soft); border-radius: 14px; background: var(--panel-raised);
  text-align: left; cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 160ms ease, background-color 160ms ease;
}
.strip:active { transform: scale(0.97); }
.strip[aria-selected="true"] { border-color: var(--amber); }
@media (hover: hover) and (pointer: fine) { .strip:hover { background: #221e18; } }
.strip-meter { display: grid; grid-template-rows: repeat(12, 1fr); gap: 4px; }
.strip-meter i { border-radius: 2px; background: var(--led-off); }
.strip-meter i.on { background: color-mix(in oklab, var(--orange) calc(var(--i) * 7%), var(--amber)); }
.strip-name { display: flex; align-items: flex-end; min-height: 2.5em; color: var(--text-2); font-size: 0.875rem; line-height: 1.25; font-weight: 600; }
.strip[aria-selected="true"] .strip-name { color: var(--text); }
.mixer-detail { margin-top: clamp(20px, 2.4vw, 28px); padding: clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) 0; }
.source { display: grid; gap: 28px; }
.source[hidden] { display: none; }
@media (min-width: 900px) { .source { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; } }
.source-copy { display: grid; gap: 12px; align-content: start; }
.source-copy p { max-width: 34em; }
.source-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; align-content: start; }
.source-specs dt { color: var(--text-3); font-size: 0.875rem; }
.source-specs dd { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.mixer-note { margin-top: 18px; color: var(--text-3); font-size: 0.875rem; }
@media (max-width: 899px) {
  .strips {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: calc(-1 * clamp(16px, 2.2vw, 28px)); padding-inline: clamp(16px, 2.2vw, 28px); scroll-padding-inline: clamp(16px, 2.2vw, 28px);
  }
  .strips::-webkit-scrollbar { display: none; }
  .strip { flex: 0 0 96px; min-height: 196px; scroll-snap-align: start; }
}

/* ---------- Come funziona ---------- */

.steps { display: grid; gap: 36px; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; } }
.step { position: relative; display: grid; gap: 12px; align-content: start; padding-left: 60px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -4px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--amber); border-radius: 10px; color: var(--amber); font-weight: 650; font-variant-numeric: tabular-nums;
}
@media (min-width: 900px) {
  .step { padding-left: 0; padding-top: 64px; }
  .step::before { top: 0; }
  .step::after { content: ""; position: absolute; top: 20px; left: 52px; right: -16px; height: 1px; background: var(--edge); }
  .step:last-child::after { display: none; }
}

/* ---------- API ---------- */

.api-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .api-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 72px; } }
.api-copy { display: grid; gap: 24px; }
.api-actions { display: grid; gap: 14px; margin-top: 4px; }
.api-actions div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 16px; align-items: baseline; }
.api-actions dt code { color: var(--amber); font-family: var(--mono); font-size: 0.9375rem; }
.api-actions dd { color: var(--text-2); }
.code {
  margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.code-part + .code-part { border-top: 1px solid var(--edge-soft); }
.code-label { display: block; padding: 14px 20px 0; color: var(--text-3); font-size: 0.8125rem; }
.code pre {
  margin: 0; padding: 10px 20px 18px; overflow-x: auto; color: var(--text);
  font-family: var(--mono); font-size: 0.875rem; line-height: 1.75; tab-size: 2;
}
.code .k { color: var(--gold); }
.code .s { color: var(--text); }
.code .p { color: var(--text-3); }

/* ---------- Specifiche ---------- */

.specs-grid { display: grid; gap: 56px; align-items: start; }
@media (min-width: 1024px) { .specs-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: 80px; } }
.specs { display: grid; }
@media (min-width: 700px) { .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; } }
.specs > div { display: grid; gap: 4px; align-content: start; padding: 18px 0; border-top: 1px solid var(--edge-soft); }
.specs dt { color: var(--text-3); font-size: 0.9375rem; }
.specs dd { color: var(--text); font-weight: 560; }
.privacy { display: grid; gap: 16px; align-content: start; padding: 28px; border-radius: 18px; background: var(--panel); border: 1px solid var(--edge); }

/* ---------- Bonus sui depositi ---------- */

.bonus-grid { display: grid; gap: 48px; align-items: end; }
@media (min-width: 1024px) { .bonus-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 72px; } }
.stairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.stair { display: grid; gap: 14px; }
.stair-meter { display: grid; gap: 4px; min-height: 86px; }
.stair-meter i { height: 14px; border-radius: 2px; background: var(--led-off); }
.stair-meter i.on { background: color-mix(in oklab, var(--orange) calc(var(--i) * 18%), var(--amber)); }
.stair-value { color: var(--text); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); font-weight: 680; font-stretch: 118%; line-height: 1; font-variant-numeric: tabular-nums; }
.stair-from { color: var(--text-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

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

.faq-list { border-bottom: 1px solid var(--edge-soft); }
.faq-item { border-top: 1px solid var(--edge-soft); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 64px; padding: 16px 0;
  color: var(--text); font-size: 1.125rem; font-weight: 600; font-stretch: 104%; cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .sign { position: relative; flex: none; width: 14px; height: 14px; }
.faq-item summary .sign::before, .faq-item summary .sign::after {
  content: ""; position: absolute; inset: 6px 0 auto 0; height: 2px; border-radius: 2px; background: var(--amber);
  transition: transform 200ms var(--ease-out);
}
.faq-item summary .sign::after { transform: rotate(90deg); }
.faq-item[open] summary .sign::after { transform: rotate(0deg); }
.faq-answer { overflow: hidden; }
.faq-answer > div { display: grid; gap: 12px; padding: 0 0 22px; max-width: 46em; }
.faq-more { margin-top: 28px; }

/* ---------- Chiusura ---------- */

.closing { display: grid; gap: 28px; justify-items: start; padding-block: clamp(56px, 7vw, 96px); border-top: 1px solid var(--edge-soft); }
.closing p { max-width: 34em; }

/* ---------- Piede ---------- */

.site-footer { padding: clamp(56px, 7vw, 88px) 0 40px; border-top: 1px solid var(--edge-soft); color: var(--text-3); font-size: 0.9375rem; }
.footer-grid { display: grid; gap: 48px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.6fr)); gap: 40px; } }
.footer-brand { display: grid; gap: 18px; align-content: start; max-width: 26rem; }
.footer-brand img { width: 150px; }
.footer-col h2 { font-size: 0.9375rem; font-stretch: 104%; font-weight: 640; letter-spacing: 0; color: var(--text); margin-bottom: 14px; }
.footer-col ul { display: grid; gap: 4px; }
.footer-col a { display: inline-flex; min-height: 32px; align-items: center; color: var(--text-3); text-decoration: none; transition: color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .footer-col a:hover { color: var(--text); } }
.newsletter { display: grid; gap: 10px; margin-top: 8px; }
.newsletter label { color: var(--text); font-weight: 600; }
.newsletter-row { display: flex; gap: 8px; }
.newsletter-row input { flex: 1; min-width: 0; }
.newsletter .form-message { min-height: 1.5em; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--edge-soft); font-size: 0.875rem; }

/* ---------- Moduli ---------- */

.field { display: grid; gap: 8px; }
.field label { color: var(--text); font-size: 0.9375rem; font-weight: 560; }
.input, .select {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--edge); color: var(--text); font-size: 1rem;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.input::placeholder { color: #6d675d; }
.input:focus-visible, .select:focus-visible { outline: none; border-color: var(--amber); background: var(--panel-raised); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-hint { color: var(--text-3); font-size: 0.875rem; }
.field-error { color: var(--danger); font-size: 0.875rem; }
.form-message { font-size: 0.9375rem; }
.form-message[data-kind="error"] { color: var(--danger); }
.form-message[data-kind="ok"] { color: var(--ok); }

/* ---------- Movimento ridotto ---------- */

/* Meno movimento, non zero: restano le dissolvenze e i cambi di colore, spariscono gli spostamenti.
   L'ordine di esempio e le FAQ se ne occupano in site.js. */
@media (prefers-reduced-motion: reduce) {
  .btn:active, .strip:active { transform: none; }
  .mobile-menu { transform: none; }
  .menu-toggle .bars::before, .menu-toggle .bars::after,
  .faq-item summary .sign::before, .faq-item summary .sign::after { transition: none; }
}

/* ---------- Accesso, richiesta di account, password ---------- */

.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.auth-top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-top .small { color: var(--text-3); }
.auth-main { display: grid; justify-items: center; align-content: center; padding: clamp(24px, 5vw, 56px) 0 clamp(48px, 7vw, 88px); }
.auth-card { width: min(100%, 440px); display: grid; gap: 28px; }
.auth-card.wide { width: min(100%, 760px); }
.auth-head { display: grid; gap: 12px; }
.auth-head h1 { font-size: clamp(2.1rem, 1.6rem + 1.9vw, 3rem); line-height: 1.02; }
.auth-form { display: grid; gap: 18px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-alt { color: var(--text-3); }
.auth-foot { padding: 24px 0 32px; color: var(--text-3); font-size: 0.875rem; }
.auth-foot .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.auth-foot a { color: var(--text-3); }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 84px; }
.reveal {
  position: absolute; top: 6px; right: 6px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) { .reveal:hover { color: var(--text); background: var(--panel-raised); } }

.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 6px; border: 1px solid var(--edge); background: var(--panel); display: grid; place-items: center; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease; }
.check input::after { content: ""; width: 11px; height: 6px; border-left: 2px solid var(--black); border-bottom: 2px solid var(--black); transform: translateY(-1px) rotate(-45deg) scale(0.6); opacity: 0; transition: transform 160ms var(--ease-out), opacity 120ms ease; }
.check input:checked { background: var(--amber); border-color: var(--amber); }
.check input:checked::after { opacity: 1; transform: translateY(-1px) rotate(-45deg) scale(1); }
.check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--edge); cursor: pointer; }
.switch input { appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: var(--led-off); border: 1px solid var(--edge); cursor: pointer; transition: background-color 160ms ease; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform 200ms var(--ease-out), background-color 160ms ease; }
.switch input:checked { background: var(--amber); border-color: var(--amber); }
.switch input:checked::after { transform: translateX(18px); background: var(--black); }

.form-section { display: grid; gap: 16px; padding-top: 28px; border-top: 1px solid var(--edge-soft); }
.form-section:first-of-type { padding-top: 0; border-top: 0; }
.form-section > h2 { font-size: 1.125rem; font-stretch: 108%; font-weight: 640; letter-spacing: -0.005em; line-height: 1.3; }
.form-section > p { color: var(--text-3); font-size: 0.9375rem; margin-top: -8px; }
.grid-2 { display: grid; gap: 16px; }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1.4fr 1fr 0.8fr; }
}
.select { appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 22px) 23px, calc(100% - 17px) 23px; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { min-height: 132px; padding: 14px 16px; line-height: 1.55; resize: vertical; }

.rules { display: grid; gap: 6px; font-size: 0.875rem; color: var(--text-3); }
.rules li { display: flex; align-items: center; gap: 10px; }
.rules li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--led-off); box-shadow: inset 0 0 0 1px #4a3f2c; transition: background-color 160ms ease; }
.rules li[data-ok]::before { background: var(--amber); box-shadow: none; }
.rules li[data-ok] { color: var(--text-2); }

.progress { display: grid; gap: 10px; }
.progress-meter { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 12px; }
.progress-meter i { border-radius: 2px; background: var(--led-off); transition: background-color 160ms ease; }
.progress-meter i.on { background: color-mix(in oklab, var(--orange) calc(var(--i) * 4%), var(--amber)); }
.progress-label { display: flex; justify-content: space-between; color: var(--text-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.sticky-progress { position: sticky; top: 0; z-index: 5; padding: 14px 0; background: var(--black); }

.captcha-box { display: grid; place-items: center; min-height: 78px; border-radius: 12px; border: 1px dashed var(--edge); color: var(--text-3); font-size: 0.875rem; }
.notice { display: grid; gap: 10px; padding: 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--edge); }
.notice h2 { font-size: 1.25rem; font-stretch: 110%; font-weight: 650; letter-spacing: -0.01em; }
.btn[data-loading] { opacity: 1; cursor: progress; }
.notice:focus { outline: none; }

/* ===== welcome.css ===== */
/* Seconda direzione: generica e accogliente, come la home di oggi.
   L'orizzonte della Terra all'alba resta il segno del sito; cambia solo come e' fatto (varianti A, B, C). */

/* Titoli: dimensione e larghezza normali, niente effetto "urlato" */
h1, h2, .display { font-stretch: 100%; font-weight: 600; letter-spacing: -0.018em; }
h2, .h2 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem); line-height: 1.12; }
h3, .h3 { font-stretch: 100%; }

/* Menu Resources */
.nav { align-items: center; }
.nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 0.96875rem; font-weight: 500; cursor: pointer;
  transition: color 160ms ease;
}
.nav-drop-btn .chev {
  width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 200ms var(--ease-out);
}
.nav-drop-btn[aria-expanded="true"] { color: var(--text); }
.nav-drop-btn[aria-expanded="true"] .chev { transform: translateY(1px) rotate(225deg); }
@media (hover: hover) and (pointer: fine) { .nav-drop-btn:hover { color: var(--text); } }
.nav-drop-menu {
  position: absolute; top: calc(100% + 8px); left: -8px; min-width: 210px; padding: 8px; display: grid;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85);
  transform-origin: top left; opacity: 0; transform: scale(0.96) translateY(-4px); visibility: hidden;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s linear 180ms;
}
.nav-drop[data-open] .nav-drop-menu { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.nav-drop-menu a { padding: 10px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
@media (hover: hover) and (pointer: fine) { .nav-drop-menu a:hover { background: var(--panel-raised); color: var(--text); } }

/* ---------- Prima schermata ---------- */

.welcome {
  position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center;
  min-height: 100vh; min-height: 100svh; text-align: center;
}
.welcome-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.welcome-inner { display: grid; justify-items: center; gap: 26px; padding-top: calc(var(--header-h) + 32px); padding-bottom: 22vh; }
.welcome h1 { display: grid; gap: 12px; margin: 0; }
.w-small { color: var(--amber); font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); font-weight: 500; letter-spacing: 0; }
.w-main { position: relative; color: var(--text); font-size: clamp(2.4rem, 1.5rem + 3.2vw, 4rem); line-height: 1.06; }
.w-main .ch { transition: opacity 90ms linear; }
.w-main[data-typing] .ch { opacity: 0; }
.w-main[data-typing] .ch.on { opacity: 1; }
.w-main .ch.caret-after { position: relative; }
.w-main .ch.caret-after::after {
  content: ""; position: absolute; right: -0.09em; top: 0.08em; bottom: 0.02em; width: 3px; border-radius: 2px; background: var(--amber);
  animation: caret 900ms steps(1) infinite;
}
.w-main[data-done] .ch.caret-after::after { animation: none; opacity: 0; transition: opacity 500ms ease 900ms; }
@keyframes caret { 50% { opacity: 0; } }
.welcome-lead { max-width: 33em; color: var(--text-2); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.6; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }

/* A: la foto della Terra di oggi, alleggerita, con un lento avvicinamento all'apertura */
.bg-photo picture { position: absolute; inset: 16% 0 -16% 0; }
.bg-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.bg-photo::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(56% 40% at 50% 44%, rgba(0, 0, 0, 0.62), transparent 72%), linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.5) 30%, rgba(0, 0, 0, 0.15) 66%, rgba(0, 0, 0, 0.8) 92%, #000 100%);
}
.bg-photo[data-enter] img { transform: scale(1.07); opacity: 0.2; }
.bg-photo img { transition: transform 2600ms var(--ease-out), opacity 1400ms ease; }

/* B: la Terra fatta di punti, disegnata nel canvas da welcome.js */
.bg-globe canvas { width: 100%; height: 100%; display: block; }
.bg-globe::after { content: ""; position: absolute; inset: auto 0 0 0; height: 18%; background: linear-gradient(to bottom, transparent, #000); }

/* C: solo l'orizzonte illuminato, senza immagini */
.bg-horizon::before {
  content: ""; position: absolute; z-index: 1; left: 50%; top: 74%; width: max(170vw, 1700px); aspect-ratio: 1; border-radius: 50%;
  transform: translateX(-50%); background: #000;
  box-shadow: 0 0 0 1px rgba(254, 181, 0, 0.6), 0 -6px 24px rgba(255, 160, 20, 0.35), 0 -40px 120px rgba(255, 120, 2, 0.16);
}
.bg-horizon::after {
  content: ""; position: absolute; z-index: 0; left: 50%; top: calc(74% - 200px); width: min(1000px, 120vw); height: 260px; transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 100%, rgba(254, 181, 0, 0.32), rgba(255, 120, 2, 0.08) 55%, transparent 75%);
}
.bg-horizon .stars, .bg-photo .stars { position: absolute; inset: 0 0 30% 0; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 27% 64%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 41% 12%, #fff7 50%, transparent 51%), radial-gradient(1px 1px at 58% 38%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 73% 18%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 86% 52%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 93% 9%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 6% 48%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 33%, #fff4 50%, transparent 51%), radial-gradient(1px 1px at 66% 70%, #fff4 50%, transparent 51%);
}
.bg-horizon[data-enter]::after { opacity: 0; transform: translate(-50%, 24px); }
.bg-horizon::after { transition: opacity 1600ms ease, transform 2200ms var(--ease-out); }

/* ---------- Tre punti forti ---------- */

.features { padding-top: clamp(72px, 8vw, 112px); }
.feature-grid { display: grid; gap: 44px; }
@media (min-width: 900px) { .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; } }
.feature { display: grid; gap: 14px; align-content: start; }
.feature-icon { width: 44px; height: 44px; color: var(--amber); }
.feature h3 { color: var(--text); font-size: 1.3125rem; }
.feature p { max-width: 32em; }

/* ---------- Sezione con illustrazione a linee ---------- */

.split-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 80px; } }
.split-art { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 24px; background: var(--panel); border: 1px solid var(--edge-soft); }
.split-art svg { width: min(58%, 240px); height: auto; color: var(--amber); }
.split-copy { display: grid; gap: 18px; }
.split-copy p { max-width: 34em; }
.draw path { stroke-dasharray: var(--len, 1000); stroke-dashoffset: 0; }
.draw[data-pending] path { stroke-dashoffset: var(--len, 1000); }
.draw[data-run] path { transition: stroke-dashoffset 1400ms var(--ease-out); }
.draw[data-run] path + path { transition-delay: 500ms; }

@media (prefers-reduced-motion: reduce) {
  .bg-photo img, .bg-horizon::after { transition: opacity 600ms ease; }
  .bg-photo[data-enter] img { transform: none; }
  .bg-horizon[data-enter]::after { transform: translateX(-50%); }
  .nav-drop-menu { transform: none; }
}

/* ======================================================================
   Restyling della home di oggi: stesse sezioni, stessi testi e immagini.
   ====================================================================== */

/* Header come oggi: semitrasparente e sfocato sopra la foto */
.page-restyle .site-header { background: rgba(0, 0, 0, 0.33); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: rgba(255, 255, 255, 0.04); }
.page-restyle .site-header[data-scrolled] { background: rgba(0, 0, 0, 0.6); }

/* Prima schermata: la foto originale con lo stesso velo nero al 50% */
.hero-photo { position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/assets/images/earth-1756274.webp") center / cover no-repeat; }
.hero-photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(to bottom, transparent, #000); }
.welcome .w-cycle { display: block; min-height: 1.1em; color: var(--text); font-size: clamp(2.4rem, 1.5rem + 3.2vw, 4rem); line-height: 1.1; }
.w-cycle .panel { color: var(--amber); }
.w-cycle .cursor { display: inline-block; width: 3px; height: 0.86em; margin-left: 6px; vertical-align: -0.06em; border-radius: 2px; background: var(--amber); animation: caret 1s steps(1) infinite; }
@media (max-width: 639px) { .welcome .w-cycle { min-height: 2.2em; } }

/* Le tre colonne */
.cols { display: grid; gap: 48px; }
@media (min-width: 900px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px; } }
.col { display: grid; gap: 14px; align-content: start; }
.col svg { width: 50px; height: 50px; }
.col h2, .band h2, .tools h2, .news h2 { color: var(--amber); }
.col h2 { font-size: 1.375rem; line-height: 1.3; letter-spacing: -0.01em; }
.col p, .band p, .band li { color: #c9c3b8; font-size: 1.0625rem; line-height: 1.7; }

/* Strumenti integrati */
.tools { padding: clamp(40px, 6vw, 72px) 0 clamp(72px, 9vw, 112px); text-align: center; }
.tools h2 { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem); margin-bottom: 36px; }
.tools img { width: min(100%, 980px); margin: 0 auto; opacity: 0.85; }

/* Sezioni alternate, come oggi: testo e illustrazione, una sezione su due con lo sfondo grigio */
.band { padding-block: clamp(72px, 9vw, 120px); }
.band-alt { background: #161512; }
.band-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .band-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
  .band-alt .band-grid > .band-art { order: -1; }
}
.band-copy { display: grid; gap: 18px; max-width: 34rem; }
.band h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); line-height: 1.15; }
.band ul { display: grid; gap: 10px; margin: 2px 0; }
.band li { position: relative; padding-left: 26px; }
.band li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 8px; height: 8px; border-radius: 2px; background: var(--amber); }
.band-art { display: grid; place-items: center; }
.band-art img { width: min(100%, 460px); height: auto; }
@media (max-width: 899px) { .band-art img { width: min(72%, 300px); } }

/* Comparsa delicata delle illustrazioni, una volta sola */
.appear[data-pending] { opacity: 0; transform: translateY(18px) scale(0.98); }
.appear { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }

/* Newsletter: la banda arancione di oggi */
.news { background: var(--amber); color: #1a1405; text-align: center; padding-block: clamp(72px, 9vw, 112px); }
.news h2 { color: #000; font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); line-height: 1.15; }
.news p { max-width: 36rem; margin: 14px auto 0; color: #2b2108; }
.news form { display: grid; gap: 10px; justify-items: center; margin-top: 28px; }
.news .newsletter-row { width: min(100%, 520px); padding: 6px; border-radius: 16px; background: #000; }
.news .input { background: transparent; border-color: transparent; min-height: 48px; }
.news .input:focus-visible { background: #111; border-color: transparent; }
.news .btn { min-height: 48px; }
.news .form-message { color: #000; font-weight: 600; min-height: 1.5em; }
.news .form-message[data-kind="error"] { color: #6b1500; }
@media (prefers-reduced-motion: reduce) { .appear[data-pending] { transform: none; } }

/* Icone social nel footer, come oggi */
.socials { display: flex; gap: 18px; margin-top: 4px; }
.socials img { width: 22px; height: 22px; filter: brightness(0) invert(0.8); transition: filter 160ms ease; }
@media (hover: hover) and (pointer: fine) { .socials a:hover img { filter: brightness(0) invert(1); } }

/* Striscia dei loghi, in vettoriale: nitida a ogni dimensione e facile da cambiare */
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(22px, 3vw, 36px) clamp(28px, 3.4vw, 50px); max-width: 1240px; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 0.45em; color: #b4ada1; font-size: clamp(1.3rem, 0.95rem + 1vw, 1.8rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.logo svg { width: 1.3em; height: 1.3em; fill: currentColor; flex: none; }
.logo img { width: auto; height: 1.15em; opacity: 0.7; }

/* Richieste dell'utente: niente testi grigi nell'header e nella frase della prima schermata */
.nav > a, .nav-drop-btn { color: var(--amber); }
.nav-drop-btn[aria-expanded="true"] { color: var(--text); }
.nav-drop-menu a { color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .nav > a:hover, .nav-drop-btn:hover { color: var(--text); }
  .nav-drop-menu a:hover { color: var(--amber); }
}
.welcome-lead { color: var(--text); }
.footer-copy { margin-top: 6px; color: var(--text-3); font-size: 0.875rem; }

@media (prefers-reduced-motion: reduce) { .w-cycle .cursor { animation: none; } }

/* Tre colonne: titoli su una riga e testi che partono alla stessa altezza, come sul sito di oggi.
   Le righe (icona, titolo, testo) sono condivise tra le colonne: anche se un titolo va a capo, restano allineate. */
@media (min-width: 900px) {
  .cols { grid-template-rows: auto auto auto; gap: 14px 40px; }
  .col { grid-row: span 3; grid-template-rows: subgrid; }
  .col h2 { font-size: clamp(1rem, 1.9vw - 3.2px, 1.375rem); align-self: start; }
}

/* Header piu' leggibile (richiesta dell'utente): voci piu' grandi e piu' marcate */
.nav { gap: 4px; }
.nav > a, .nav-drop-btn { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.005em; }
.nav-drop-menu a { font-size: 1rem; font-weight: 500; }
.header-actions .link-login { font-size: 1.125rem; font-weight: 600; }
.site-header .btn-sm { min-height: 44px; padding: 0 22px; font-size: 1.0625rem; }
.brand img { width: 162px; }
@media (max-width: 1099px) { .nav > a, .nav-drop-btn { padding-inline: 9px; } .header-inner { gap: 20px; } }

/* Prima schermata senza frase: il pulsante Log in sta subito sotto la scritta animata */
.page-home .welcome-actions { margin-top: 14px; }

/* ===== pages.css ===== */
/* Pagine interne della parte pubblica, nello stile della home rifatta:
   documenti lunghi con indice (termini, privacy, cookie, API), FAQ con ricerca, accesso con la Terra sfocata, 404. */

/* Header sulle pagine senza foto: velo un po' piu' scuro per leggere bene sul testo che scorre sotto */
.page-doc .site-header { background: rgba(0, 0, 0, 0.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: var(--edge-soft); }

/* ---------- Documenti con indice ---------- */

.doc-wrap { padding: calc(var(--header-h) + clamp(36px, 5vw, 64px)) 0 clamp(72px, 9vw, 120px); }
.doc-grid { display: grid; gap: 32px; }
@media (min-width: 1100px) { .doc-grid { grid-template-columns: 250px minmax(0, 1fr); gap: 64px; } }
.doc-side { align-self: start; }
@media (min-width: 1100px) {
  .doc-side { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow: auto; padding: 18px 10px; border-radius: 18px; background: #0e0d0b; border: 1px solid var(--edge-soft); scrollbar-width: thin; }
}
.toc-title { padding: 0 12px; margin-bottom: 8px; color: var(--text-3); font-size: 0.8125rem; font-weight: 600; }
.toc { display: grid; gap: 2px; }
.toc a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 0.9063rem; line-height: 1.35; transition: color 160ms ease, background-color 160ms ease; }
.toc a[aria-current="true"] { color: var(--amber); background: rgba(254, 181, 0, 0.09); }
@media (hover: hover) and (pointer: fine) { .toc a:hover { color: var(--text); } }
.toc-mobile { display: none; }
@media (max-width: 1099px) {
  .doc-side .toc-title, .doc-side > .toc { display: none; }
  .toc-mobile { display: block; border: 1px solid var(--edge); border-radius: 14px; background: var(--panel); }
  .toc-mobile summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; color: var(--text); font-weight: 600; cursor: pointer; list-style: none; }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--amber); border-bottom: 2px solid var(--amber); transform: translateY(-2px) rotate(45deg); transition: transform 200ms var(--ease-out); }
  .toc-mobile[open] summary::after { transform: translateY(2px) rotate(225deg); }
  .toc-mobile .toc { padding: 0 6px 10px; max-height: 50vh; overflow: auto; }
}

.doc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; margin-bottom: 28px; }
.doc-head h1 { color: var(--amber); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.1; }
.doc-head .updated { flex-basis: 100%; margin-top: -8px; color: var(--text-3); font-size: 0.9375rem; }
.lang-switch { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--edge); }
.lang-switch button {
  min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, color 160ms ease;
}
.lang-switch button[aria-pressed="true"] { background: var(--amber); color: #000; }
@media (hover: hover) and (pointer: fine) { .lang-switch button[aria-pressed="false"]:hover { color: var(--text); } }

.doc { max-width: 47rem; }
.doc > :first-child { margin-top: 0; }
.doc h2 { margin: 2.4em 0 0.75em; color: var(--amber); font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem); line-height: 1.3; letter-spacing: -0.01em; scroll-margin-top: calc(var(--header-h) + 24px); }
.doc h3 { margin: 1.8em 0 0.6em; font-size: 1.125rem; scroll-margin-top: calc(var(--header-h) + 24px); }
.doc p, .doc li { color: #ddd7cd; font-size: 1.0625rem; line-height: 1.75; }
.doc p + p, .doc p + ul, .doc ul + p, .doc p + .table-scroll, .doc .table-scroll + p { margin-top: 1em; }
.doc ul, .doc ol { display: grid; gap: 0.55em; margin: 0.9em 0; }
.doc li { position: relative; padding-left: 24px; }
.doc li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 7px; height: 7px; border-radius: 2px; background: var(--amber); }
.doc a { color: var(--amber); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.doc strong { color: var(--text); font-weight: 650; }
.callout { margin: 0 0 1.6em; padding: 18px 22px; border-radius: 14px; background: rgba(254, 181, 0, 0.07); border: 1px solid rgba(254, 181, 0, 0.32); }
.callout, .callout p { color: #ece6db; font-size: 1rem; line-height: 1.7; }
.table-scroll { overflow-x: auto; margin: 1.1em 0 1.4em; border: 1px solid var(--edge-soft); border-radius: 14px; }
.doc table, .api table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.doc th, .doc td, .api th, .api td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--edge-soft); color: #ddd7cd; }
.doc th, .api th { color: var(--text-3); font-weight: 600; background: #0e0d0b; }
.doc tr:last-child td, .api tr:last-child td { border-bottom: 0; }

/* ---------- API ---------- */

.api-section { padding: clamp(20px, 2.6vw, 28px); border-radius: 18px; background: #0e0d0b; border: 1px solid var(--edge-soft); scroll-margin-top: calc(var(--header-h) + 24px); }
.api-section + .api-section { margin-top: 20px; }
.api-section h2 { margin: 0 0 16px; color: var(--amber); font-size: 1.25rem; }
.api-section h3 { margin: 22px 0 10px; color: var(--text); font-size: 1rem; }
.api-section .table-scroll { margin: 0; }
.api-section td:first-child { color: var(--text); font-family: var(--mono); font-size: 0.875rem; }
.api pre { margin: 0; padding: 16px 18px; overflow-x: auto; border-radius: 12px; background: #000; border: 1px solid var(--edge-soft); color: #e9e3d8; font-family: var(--mono); font-size: 0.8438rem; line-height: 1.65; }
.api-overview td:first-child { font-family: var(--font); color: var(--text-3); width: 36%; }
.api-overview td a { color: var(--amber); }
.api-actions-row { margin-top: 18px; }

/* ---------- FAQ ---------- */

.faq-wrap { max-width: 54rem; margin: 0 auto; }
.faq-head { display: grid; gap: 18px; justify-items: center; text-align: center; margin-bottom: 26px; }
.faq-head h1 { color: var(--amber); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); line-height: 1.1; }
.faq-head .callout { margin: 0; max-width: 40rem; }
.faq-search { position: relative; margin: 8px 0 10px; }
.faq-search svg { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.faq-search .input { min-height: 58px; padding-left: 50px; font-size: 1.0625rem; border-radius: 14px; }
.faq-count { min-height: 1.6em; margin-bottom: 10px; color: var(--text-3); font-size: 0.875rem; }
.faq-page .faq-item summary { font-size: 1.0625rem; }
.faq-page .faq-answer p, .faq-page .faq-answer li { color: #ddd7cd; }
.faq-page .faq-answer a { color: var(--amber); }
.faq-item[hidden] { display: none; }
.faq-empty { padding: 28px 0; color: var(--text-2); text-align: center; }
mark { padding: 0 2px; border-radius: 3px; background: rgba(254, 181, 0, 0.3); color: var(--text); }

/* ---------- Accesso: la Terra sfocata dietro, come oggi ---------- */

.auth-bg {
  position: fixed; inset: -30px; z-index: -1;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url("/assets/images/earth-1756274.webp") center / cover no-repeat;
  filter: blur(6px);
}
.auth2 { min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 22px; padding: 40px var(--gutter) 32px; }
.auth2-logo img { width: 210px; height: auto; }
.auth2-panel {
  width: min(100%, 460px); display: grid; gap: 20px; padding: clamp(22px, 4vw, 34px); border-radius: 22px;
  background: rgba(10, 9, 7, 0.66); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.auth2-panel.wide { width: min(100%, 780px); }
.auth2-panel h1 { color: var(--text); font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem); line-height: 1.25; text-align: center; }
.auth2-panel .sub { margin-top: -8px; color: var(--text-2); text-align: center; }
.auth2 .input, .auth2 .select { background: rgba(0, 0, 0, 0.5); border-color: rgba(255, 255, 255, 0.12); }
.auth2 .input:focus-visible, .auth2 .select:focus-visible { background: rgba(0, 0, 0, 0.7); border-color: var(--amber); }
.auth2-links { display: grid; gap: 6px; justify-items: center; text-align: center; color: var(--text-2); font-size: 0.9375rem; }
.auth2-links a { color: var(--amber); }
.auth2-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--text-3); font-size: 0.8125rem; }
.auth2-foot a { color: var(--text-3); }
.auth2 .form-section { border-top-color: rgba(255, 255, 255, 0.08); }
.auth2 .form-section > h2 { color: var(--amber); }
.auth2 .switch { background: rgba(0, 0, 0, 0.45); border-color: rgba(255, 255, 255, 0.12); }
.auth2 .captcha-box { border-color: rgba(255, 255, 255, 0.16); }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--orange)); transition: width 300ms var(--ease-out); }
.bar-label { display: flex; justify-content: space-between; margin-top: 8px; color: var(--text-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* ---------- 404 ---------- */

.nf-code { color: var(--amber); font-size: clamp(4rem, 2.5rem + 6vw, 7.5rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }

.api-section .select { max-width: 360px; margin: 0 0 14px; }
.api-section .table-scroll + .table-scroll { margin-top: 0; }

/* Etichetta delle FAQ riservate ai clienti, visibile solo agli admin */
.badge-private { margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--amber); color: #000; font-size: 0.75rem; font-weight: 650; vertical-align: middle; }

/* ---------- Accesso: compatibilita' con gli script del pannello (general.js, combined.js, validatePassword.js...) ---------- */
.page-auth { --bs-success: #9fe3a1; --bs-danger: #ff8a7a; }
.spinner-border { display: inline-block; width: 1rem; height: 1rem; vertical-align: -0.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.auth2 .input.is-valid { border-color: rgba(159, 227, 161, 0.55); }
.auth2 .input.is-invalid { border-color: rgba(255, 138, 122, 0.6); }
.text-success { color: #9fe3a1 !important; }
.text-muted { color: var(--text-3) !important; }
.bar .progress-bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--orange)); transition: width 300ms var(--ease-out); }
.hints { display: none; gap: 4px; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-3); font-size: 0.875rem; }
.hints[style*="block"] { display: grid !important; }
.auth2 .iti { width: 100%; display: block; }
.auth2 .iti input.input { padding-left: 92px; }
.auth2 .iti__selected-flag { padding: 0 10px 0 14px; border-radius: 12px 0 0 12px; }
.auth2 .iti__selected-dial-code, .auth2 .iti__dial-code { color: var(--text-2); }
.auth2 .iti__country-list { background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; color: var(--text); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85); }
.auth2 .iti__country.iti__highlight { background: var(--panel-raised); }
.auth2 .iti__divider { border-bottom-color: var(--edge); }
.auth2 .iti__arrow { border-top-color: var(--text-2); }
.auth2 .iti__arrow--up { border-bottom-color: var(--text-2); }
.auth2 .h-captcha, .auth2 .g-recaptcha { display: flex; justify-content: center; }
.jq-toast-wrap .jq-toast-single { background: var(--panel) !important; color: var(--text) !important; border: 1px solid var(--edge); border-radius: 12px; font-family: var(--font); font-size: 0.9375rem; line-height: 1.5; }
.jq-toast-wrap .jq-toast-single .jq-toast-loader { background: var(--amber) !important; }
.jq-toast-wrap .jq-toast-single .close-jq-toast-single { color: var(--text-2); }

/* ===== cookies.css ===== */
/* Banner dei cookie: stesso script di oggi (cookie-consent.js, classi cc-*), solo lo stile e' nuovo.
   Il banner sale dal basso come un cassetto, le preferenze si aprono come una finestra al centro. */

.cc-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 250ms ease; }
.cc-overlay.cc-visible { opacity: 1; pointer-events: auto; }

.cc-banner {
  position: fixed; left: 50%; bottom: 16px; z-index: 91; width: min(100% - 24px, 1000px);
  transform: translate(-50%, calc(100% + 40px)); transition: transform 500ms cubic-bezier(0.32, 0.72, 0, 1);
}
.cc-banner.cc-visible { transform: translate(-50%, 0); }
.cc-inner {
  display: grid; gap: 12px; padding: 22px 24px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--edge); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9);
}
.cc-inner h3, .cc-preferences h3 { margin: 0; color: var(--amber); font-size: 1.125rem; font-weight: 650; }
.cc-inner p, .cc-preferences > p { margin: 0; color: var(--text-2); font-size: 0.9375rem; line-height: 1.6; }
.cc-inner a { color: var(--amber); }
.cc-buttons, .cc-pref-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.cc-btn {
  min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--edge);
  background: transparent; color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 650; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.cc-btn:active { transform: scale(0.97); }
.cc-btn-accept { background: var(--amber); border-color: var(--amber); color: #000; }
@media (hover: hover) and (pointer: fine) {
  .cc-btn-accept:hover { background: #ffc22e; }
  .cc-btn-reject:hover, .cc-btn-settings:hover { background: var(--panel-raised); border-color: #4a4133; }
}

.cc-preferences {
  position: fixed; left: 50%; top: 50%; z-index: 92; width: min(100% - 24px, 560px); max-height: calc(100dvh - 32px); overflow: auto;
  display: grid; gap: 14px; padding: 26px; border-radius: 22px; background: var(--panel); border: 1px solid var(--edge);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.95);
  opacity: 0; visibility: hidden; transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out), visibility 0s linear 250ms;
}
.cc-preferences.cc-visible { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition-delay: 0s; }
.cc-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-size: 26px; line-height: 1; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .cc-close:hover { background: var(--panel-raised); color: var(--text); } }
.cc-category { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--edge-soft); }
.cc-category-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cc-category-title { color: var(--text); font-weight: 600; }
.cc-category-desc { color: var(--text-2); font-size: 0.9375rem; line-height: 1.55; }
.cc-badge { color: var(--amber); font-size: 0.8125rem; font-weight: 600; }
.cc-toggle { position: relative; flex: none; width: 46px; height: 28px; }
.cc-toggle input { position: absolute; inset: 0; z-index: 1; margin: 0; opacity: 0; cursor: pointer; }
.cc-toggle-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--led-off); border: 1px solid var(--edge); transition: background-color 160ms ease; }
.cc-toggle-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform 200ms var(--ease-out), background-color 160ms ease; }
.cc-toggle input:checked + .cc-toggle-slider { background: var(--amber); border-color: var(--amber); }
.cc-toggle input:checked + .cc-toggle-slider::after { transform: translateX(18px); background: #000; }
.cc-toggle input:focus-visible + .cc-toggle-slider { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Pulsante per riaprire le impostazioni, dopo la scelta: un biscotto disegnato, senza Font Awesome */
.cc-settings-float {
  position: fixed; left: 16px; bottom: 16px; z-index: 80; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--edge); background: var(--panel); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 250ms ease, transform 160ms var(--ease-out);
}
.cc-settings-float.cc-visible { opacity: 1; pointer-events: auto; }
.cc-settings-float:active { transform: scale(0.95); }
.cc-settings-float i { display: none; }
.cc-settings-float::before {
  content: ""; position: absolute; inset: 11px; background: var(--amber);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.6 12.6A9.6 9.6 0 1 1 11.4 2.4a3.2 3.2 0 0 0 4 4 3.2 3.2 0 0 0 4.1 3.9 3.2 3.2 0 0 0 2.1 2.3zM8 9.5a1.3 1.3 0 1 0 0-2.6 1.3 1.3 0 0 0 0 2.6zm1.5 6.6a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm5.6.4a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.6 12.6A9.6 9.6 0 1 1 11.4 2.4a3.2 3.2 0 0 0 4 4 3.2 3.2 0 0 0 4.1 3.9 3.2 3.2 0 0 0 2.1 2.3zM8 9.5a1.3 1.3 0 1 0 0-2.6 1.3 1.3 0 0 0 0 2.6zm1.5 6.6a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm5.6.4a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner { transition: opacity 250ms ease; }
  .cc-preferences { transform: translate(-50%, -50%); }
}

/* ===== compatibilita' con gli script di oggi ===== */
.d-none { display: none !important; }
#newsletter_message.hidden { display: none; }
#newsletter_message { margin-top: 12px; font-weight: 600; }
#newsletter_message.alert-danger { color: #6b1500; }
#login-error { padding: 12px 14px; border-radius: 12px; background: rgba(255, 138, 122, 0.1); border: 1px solid rgba(255, 138, 122, 0.4); color: var(--danger); font-size: 0.9375rem; }
