/* ============================================================
   Framia — landing (framia.site)
   Token allineati a frontend/src/theme.ts (dark-first, ambra iOS)
   ============================================================ */

:root {
  --surface: #000000;
  --on-surface: #FFFFFF;
  --surface-2: #1C1C1E;
  --on-surface-2: #98989D;
  --surface-3: #2C2C2E;
  --on-surface-3: #EBEBF5;
  --brand: #FFD60A;
  --on-brand: #000000;
  --brand-dark: #332D06;
  --success: #32D74B;
  --warning: #FF9F0A;
  --error: #FF453A;
  --border: #38383A;
  --border-strong: #545458;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint */

  /* z-scale semantica */
  --z-nav: 100;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* ---------- Bottoni ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), background-color 0.25s var(--ease-out),
              box-shadow 0.25s var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-brand {
  background: var(--brand);
  color: var(--on-brand);
}
.btn-brand:hover { box-shadow: 0 6px 32px rgba(255, 214, 10, 0.35); }

.btn-ghost {
  color: var(--on-surface);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-sm { padding: 9px 20px; font-size: 15px; }

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

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out);
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding: 14px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  gap: 32px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-surface);
  text-decoration: none;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.wordmark .logomark { width: 28px; height: 28px; color: var(--brand); }

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.nav-links a {
  color: var(--on-surface-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s var(--ease-out);
}
.nav-links a:hover { color: var(--on-surface); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  /* nav-links porta con sé il margin-left:auto: senza, serve sul prossimo elemento */
  .lang-toggle { margin-left: auto; }
  .nav-inner .btn-sm { flex-shrink: 0; white-space: nowrap; padding-inline: 16px; }
}

/* ---------- Lingua (IT/EN, client-side) ---------- */

/* blocchi di contenuto duali: solo la lingua attiva è visibile;
   senza JS (nessun data-lang) resta l'italiano */
html[data-lang="en"] [data-lang-block][lang="it"] { display: none; }
html[data-lang="it"] [data-lang-block][lang="en"] { display: none; }
html:not([data-lang]) [data-lang-block][lang="en"] { display: none; }

/* il toggle funziona solo con JS attivo: senza data-lang resta nascosto */
.lang-toggle { display: none; }
html[data-lang] .lang-toggle {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.lang-toggle button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--on-surface-2);
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.lang-toggle button:hover { color: var(--on-surface); }
.lang-toggle button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 10vh, 120px) clamp(64px, 10vh, 120px);
}

/* alone ambra dietro al telefono, tenue e direzionale */
.hero::before {
  content: "";
  position: absolute;
  right: -10%;
  top: 10%;
  width: 55%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 214, 10, 0.10), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.hero-lead {
  margin-top: 24px;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  color: var(--on-surface-3);
  max-width: 34em;
}
.hero-lead strong { color: var(--brand); font-weight: 700; }

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-note {
  margin-top: 20px;
  font-size: 14px;
  color: var(--on-surface-2);
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero::before { right: -40%; top: auto; bottom: -10%; width: 90%; }
}

/* ---------- Demo phone ---------- */

.hero-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.phone {
  width: min(340px, 82vw);
  border-radius: 48px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  padding: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(255, 214, 10, 0.06);
}

.phone-screen {
  position: relative;
  border-radius: 38px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--surface);
}

.demo-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* linea di scansione */
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  height: 10%;
  background: linear-gradient(to bottom, transparent, rgba(255, 214, 10, 0.35), rgba(255, 214, 10, 0.9));
  border-bottom: 2px solid var(--brand);
  opacity: 0;
  filter: blur(0.5px);
}
.phone.scanning .scanline {
  opacity: 1;
  animation: scan 1.7s var(--ease-out) forwards;
}
@keyframes scan {
  from { top: -12%; }
  to   { top: 104%; }
}

/* chip "analisi in corso" */
.analysis-status {
  position: absolute;
  top: 16px;
  left: 50%;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(28, 28, 30, 0.85);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-3);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  white-space: nowrap;
}
.analysis-status.show { opacity: 1; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.75); }
}

/* pannello risultato */
.analysis-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: var(--radius-lg);
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  padding: 18px;
  opacity: 0;
  translate: 0 16px;
  transition: opacity 0.5s var(--ease-out), translate 0.5s var(--ease-out);
}
.analysis-panel.show { opacity: 1; translate: 0 0; }

.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.score-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 9;
}
.ring-fill {
  fill: none;
  stroke: var(--success);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;   /* 2πr, r=52 */
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.4s var(--ease-out);
}
.analysis-panel.show .ring-fill { stroke-dashoffset: 58.8; } /* 82/100 */

.score-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.panel-title { display: flex; flex-direction: column; gap: 2px; }
.panel-title strong { font-size: 17px; font-weight: 800; }
.panel-title span { font-size: 13px; color: var(--on-surface-2); }

/* righe categorie */
.cat-rows {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cat-rows li {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.45s var(--ease-out), translate 0.45s var(--ease-out);
}
.analysis-panel.show .cat-rows li { opacity: 1; translate: 0 0; }
.analysis-panel.show .cat-rows li:nth-child(1) { transition-delay: 0.55s; }
.analysis-panel.show .cat-rows li:nth-child(2) { transition-delay: 0.7s; }
.analysis-panel.show .cat-rows li:nth-child(3) { transition-delay: 0.85s; }

.cat-name { color: var(--on-surface-3); font-weight: 600; }

.cat-bar {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.cat-bar i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-out) 0.6s;
}
.analysis-panel.show .cat-bar i { transform: scaleX(1); }

.cat-val { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.val-high { color: var(--success); }
.val-mid  { color: var(--brand); }

/* testo in streaming */
.stream-text {
  position: relative;
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--on-surface-3);
}
/* il sizer invisibile riserva l'altezza del testo completo: niente salti durante lo streaming */
.stream-sizer { visibility: hidden; }
.stream-live { position: absolute; inset: 0; }
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--brand);
  vertical-align: -0.15em;
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}
.caret.done { display: none; }
@keyframes blink { 50% { opacity: 0; } }

.demo-caption {
  font-size: 13px;
  color: var(--on-surface-2);
  text-align: center;
}

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

section h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* reveal on scroll — visibile di default, animato solo con JS attivo */
html.js [data-reveal] {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out);
}
html.js [data-reveal].in-view {
  opacity: 1;
  translate: 0 0;
}

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

.steps { padding-block: clamp(72px, 12vh, 140px); }

.steps-list {
  list-style: none;
  margin: clamp(40px, 6vh, 64px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(32px, 4vw, 56px);
  counter-reset: step;
}

.steps-list li { display: flex; gap: 18px; align-items: flex-start; }

.step-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-dark);
  color: var(--brand);
  font-weight: 800;
  font-size: 19px;
}

.steps-list h3 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.steps-list p { color: var(--on-surface-2); font-size: 15.5px; }

/* ---------- L'analisi (tabs) ---------- */

.analysis {
  padding-block: clamp(72px, 12vh, 140px);
  background: var(--surface-2);
  border-block: 1px solid var(--border);
}

.analysis-intro { max-width: 560px; }
.analysis-intro p { margin-top: 16px; color: var(--on-surface-2); }

.cat-explorer { margin-top: clamp(32px, 5vh, 48px); }

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-tabs [role="tab"] {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--on-surface-3);
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out),
              border-color 0.25s var(--ease-out);
}
.cat-tabs [role="tab"]:hover { border-color: var(--brand); }
.cat-tabs [role="tab"][aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

.cat-pane {
  margin-top: 28px;
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  align-items: flex-start;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: clamp(24px, 4vw, 40px);
}

.cat-score {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cat-score-num {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.cat-score-label { font-size: 13px; color: var(--on-surface-2); }

.cat-feedback {
  margin: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.6;
  color: var(--on-surface-3);
  max-width: 30em;
}

.cat-pane.swapping .cat-feedback,
.cat-pane.swapping .cat-score { opacity: 0; transition: opacity 0.15s ease-out; }
.cat-feedback, .cat-score { transition: opacity 0.3s var(--ease-out); }

@media (max-width: 640px) {
  .cat-pane { flex-direction: column; gap: 16px; }
}

/* ---------- Scuola ---------- */

.school { padding-block: clamp(72px, 12vh, 140px); }

.school-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}

.school-photo { margin: 0; }
.school-photo img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.school-copy p { margin-top: 20px; color: var(--on-surface-3); max-width: 36em; }
.school-copy em { font-style: normal; color: var(--brand); font-weight: 700; }

.lesson-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.lesson-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
  color: var(--on-surface-3);
}
.lesson-list li:first-child { border-top: 1px solid var(--border); }
.lesson-list .lesson-ai { color: var(--brand); }

@media (max-width: 820px) {
  .school-grid { grid-template-columns: 1fr; }
  .school-photo { max-width: 440px; }
}

/* ---------- Pianificazione ---------- */

.planning {
  padding-block: clamp(72px, 12vh, 140px);
  background: var(--surface-2);
  border-block: 1px solid var(--border);
}

.planning-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}

.planning-copy p { margin-top: 20px; color: var(--on-surface-3); max-width: 34em; }

.planning-pdf {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.planning-pdf svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--brand);
  margin-top: 2px;
}
.planning-pdf strong { display: block; font-size: 15.5px; font-weight: 700; }
.planning-pdf span { display: block; margin-top: 3px; font-size: 14.5px; color: var(--on-surface-2); max-width: 30em; }

/* card "itinerario" */
.plan-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: clamp(24px, 3.5vw, 32px);
  max-width: 420px;
  margin-inline: auto;
}

.plan-card-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-2);
}

.plan-prompt {
  margin-top: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  font-weight: 700;
  min-height: 1.5em;
}

.plan-outputs {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-outputs li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface-3);
  opacity: 0;
  translate: 0 6px;
  transition: opacity 0.4s var(--ease-out), translate 0.4s var(--ease-out);
}
.plan-outputs li.show { opacity: 1; translate: 0 0; }
.plan-outputs svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--brand); }

@media (max-width: 820px) {
  .planning-grid { grid-template-columns: 1fr; }
  .plan-card { max-width: 440px; }
}

/* ---------- Piani ---------- */

.plans { padding-block: clamp(48px, 8vh, 100px) clamp(72px, 12vh, 140px); }

.plans-row {
  margin-top: clamp(36px, 5vh, 56px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: stretch;
  max-width: 880px;
}

.plan {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: clamp(24px, 3.5vw, 36px);
  display: flex;
  flex-direction: column;
}
.plan h3 { font-size: 22px; font-weight: 800; }
.plan-tag { margin-top: 4px; font-size: 14px; color: var(--on-surface-2); }

.plan ul {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15.5px;
  color: var(--on-surface-3);
}
.plan ul li { display: flex; gap: 10px; }
.plan ul li::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
  flex-shrink: 0;
}

.plan-pro {
  border-color: var(--brand);
  background: var(--surface-2);
  box-shadow: 0 12px 60px rgba(255, 214, 10, 0.08);
}
.plan-pro .btn { margin-top: 28px; align-self: flex-start; }

@media (max-width: 700px) {
  .plans-row { grid-template-columns: 1fr; }
}

/* ---------- Download (drench ambra) ---------- */

.download {
  background: var(--brand);
  color: var(--on-brand);
  padding-block: clamp(72px, 12vh, 130px);
}

.download-inner { text-align: center; }

.download h2 {
  color: var(--on-brand);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.025em;
}
.download p {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
}

.store-badges {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--on-brand);
  color: var(--brand);
  text-decoration: none;
}
a.badge {
  transition: transform 0.25s var(--ease-out);
}
a.badge:hover { transform: translateY(-2px); }
a.badge:active { transform: scale(0.97); }
.badge svg { width: 26px; height: 26px; }
.badge span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  font-weight: 800;
  font-size: 17px;
}
.badge small {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 214, 10, 0.75);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 16px;
}
.wordmark-footer { font-size: 18px; }
.wordmark-footer .logomark { width: 24px; height: 24px; }
.footer p { font-size: 14px; color: var(--on-surface-2); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-left: auto;
}
.footer-links a {
  color: var(--on-surface-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s var(--ease-out);
}
.footer-links a:hover { color: var(--on-surface); }
.footer-copy { flex-basis: 100%; }

@media (max-width: 640px) {
  .footer-links { margin-left: 0; flex-basis: 100%; }
}

/* ============================================================
   Pagine documento — Supporto · Privacy · Termini
   ============================================================ */

.page-doc .nav { border-bottom-color: var(--border); }

.doc { padding-block: clamp(40px, 7vh, 72px) clamp(72px, 12vh, 140px); }

/* tabs di navigazione tra le pagine documento */
.doc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.doc-tabs a {
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--on-surface-3);
  text-decoration: none;
  transition: border-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.doc-tabs a:hover { border-color: var(--brand); color: var(--on-surface); }
.doc-tabs a[aria-current="page"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}

.doc-head { max-width: 68ch; }
.doc-head h1 {
  margin-top: clamp(28px, 5vh, 44px);
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.doc-meta { margin-top: 12px; font-size: 14px; color: var(--on-surface-2); }
.doc-lede {
  margin-top: 18px;
  font-size: clamp(1.05rem, 1.6vw, 1.15rem);
  line-height: 1.65;
  color: var(--on-surface-3);
}

.doc-body { max-width: 68ch; margin-top: clamp(24px, 4vh, 36px); }
.doc-body h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-top: clamp(40px, 7vh, 56px);
}
.doc-body h2 + p { margin-top: 12px; }
.doc-body p { margin-top: 14px; color: var(--on-surface-3); }
.doc-body ul {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--on-surface-3);
}
.doc-body ul li { position: relative; padding-left: 22px; }
.doc-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: var(--brand);
}
.doc-body a {
  color: var(--on-surface);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.doc-body a:hover { color: var(--brand); }
.doc-body strong { color: var(--on-surface); }

/* riquadro "in breve" */
.doc-brief {
  margin-top: clamp(28px, 5vh, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: clamp(20px, 3.5vw, 28px);
}
.doc-brief h2 { margin: 0; font-size: 17px; font-weight: 800; }
.doc-brief ul { margin-top: 14px; gap: 10px; font-size: 15.5px; }
.doc-brief ul li { padding-left: 26px; }
.doc-brief ul li::before {
  content: "✓";
  width: auto;
  height: auto;
  top: 0;
  background: none;
  color: var(--success);
  font-weight: 800;
}

/* tabella fornitori */
.doc-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 15.5px;
}
.doc-table th {
  text-align: left;
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-2);
}
.doc-table td {
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--border);
  color: var(--on-surface-3);
  vertical-align: top;
}
.doc-table td:first-child { color: var(--on-surface); font-weight: 700; }

/* card contatto (Supporto) */
.contact-card {
  margin-top: clamp(28px, 5vh, 40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: clamp(24px, 4vw, 36px);
}
.contact-label { font-size: 14px; font-weight: 600; color: var(--on-surface-2); }
.contact-email {
  display: inline-block;
  margin-top: 6px;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--on-surface);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s var(--ease-out);
}
.contact-email:hover { color: var(--brand); }
.contact-meta { margin-top: 10px; font-size: 14.5px; color: var(--on-surface-2); }
.contact-actions { margin-top: 24px; }
.contact-hint {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--on-surface-2);
  max-width: 46em;
}

/* FAQ (Supporto) */
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--on-surface);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  color: var(--brand);
  transition: rotate 0.3s var(--ease-out);
}
.faq details[open] summary::after { rotate: 45deg; }
.faq-a { padding-bottom: 20px; max-width: 60ch; }
.faq-a p { margin-top: 0; font-size: 15.5px; line-height: 1.65; }
.faq-a p + p { margin-top: 10px; }

/* stampa: le pagine legali si stampano in chiaro */
@media print {
  :root {
    --surface: #FFFFFF;
    --on-surface: #111111;
    --surface-2: #FFFFFF;
    --on-surface-2: #555555;
    --surface-3: #F2F2F2;
    --on-surface-3: #222222;
    --brand: #111111;
    --border: #CCCCCC;
    --border-strong: #999999;
  }
  .nav, .footer, .doc-tabs, .contact-actions, .lang-toggle { display: none; }
  .doc-brief, .contact-card { background: none; }
  .faq details { display: block; }
}

/* ---------- Reduced motion ---------- */

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

  html.js [data-reveal] {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }

  .scanline, .phone.scanning .scanline { animation: none; opacity: 0; }
  .status-dot { animation: none; }
  .caret { animation: none; }

  .analysis-panel,
  .ring-fill,
  .cat-rows li,
  .cat-bar i,
  .plan-outputs li,
  .faq summary::after,
  .btn {
    transition: none !important;
  }

  .plan-outputs li { opacity: 1; translate: 0 0; }
}
