/* Landing di Radar Gare. Token del sistema di design 2 (docs/03-sviluppo/decisioni-redesign.md).
   Nessuno stile inline nell'HTML: la CSP del server ammette solo 'self'. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --night: #172c48;
  --plan: #1f3a5f;
  --plan-50: #eef3f9;
  --plan-100: #c8d4e3;
  --plan-300: #8fa3bd;
  --signal: #ffc96b;
  --focus: #b54708;
  --ink: #14202e;
  --ink-2: #3d4b5c;
  --ink-3: #56636f;
  --line-strong: #7d8996;
  --line: #dde3ea;
  --line-soft: #eef1f4;
  --paper: #f4f6f9;
  --white: #ffffff;
  --danger: #a4161a;
  --danger-bg: #fdeaea;
  --warning: #7a4a00;
  --warning-bg: #fdf1dc;
  --success: #1e6b34;
  --success-bg: #e6f4ea;
  --info: #1f4f8a;
  --info-bg: #e8f0fb;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 72rem;
  --gutter: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--white); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: var(--plan); text-underline-offset: 0.15em; }
a:hover { color: var(--night); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--signal); }
@media (forced-colors: active) { :focus-visible { outline: 2px solid Highlight; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 10; padding: 0.5rem 1rem; color: var(--white); background: var(--night); border-radius: 6px; transform: translateY(-200%); }
.skip-link:focus { transform: none; color: var(--white); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 40rem) { :root { --gutter: 2rem; } }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0 1.25rem; font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: background-color 120ms ease; }
.btn-primary { color: var(--ink); background: var(--signal); }
.btn-primary:hover { color: var(--ink); background: #ffd88f; }
.btn-plan { color: var(--white); background: var(--plan); }
.btn-plan:hover { color: var(--white); background: var(--night); }
.btn-quiet { color: var(--white); border-color: var(--plan-300); background: transparent; }
.btn-quiet:hover { color: var(--white); background: var(--plan); }
.btn[disabled], .btn[aria-busy="true"] { cursor: progress; opacity: 0.8; }

/* Testata */
.site-header { color: var(--white); background: var(--night); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; color: var(--white); font-size: 1.125rem; font-weight: 600; text-decoration: none; }
.brand:hover { color: var(--white); }
.brand svg { width: 2rem; height: 2rem; }
.header-nav { display: flex; align-items: center; gap: 0.25rem; }
.header-nav a:not(.btn) { display: none; padding: 0.5rem 0.75rem; color: var(--plan-100); font-size: 0.9375rem; text-decoration: none; border-radius: 6px; }
.header-nav a:not(.btn):hover { color: var(--white); background: var(--plan); }
.header-nav .btn { min-height: 2.5rem; padding: 0 1rem; font-size: 0.9375rem; }
@media (min-width: 52rem) { .header-nav a:not(.btn) { display: inline-flex; } }

/* Hero */
.hero { color: var(--white); background: var(--night); border-bottom: 3px solid var(--signal); }
.hero .wrap { display: grid; gap: 3rem; padding-top: 3rem; padding-bottom: 4rem; }
.hero h1 { max-width: 16ch; font-size: clamp(2.375rem, 6vw, 3.75rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.025em; }
.hero-lead { max-width: 34rem; margin-top: 1.25rem; color: var(--plan-100); font-size: 1.1875rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero-note { margin-top: 1.25rem; color: var(--plan-300); font-size: 0.9375rem; }
@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); align-items: center; gap: 4rem; padding-top: 5rem; padding-bottom: 6rem; }
}

/* Il filtro del Radar: elemento animato della hero */
.radar-panel { color: var(--ink); background: var(--white); border-radius: 12px; box-shadow: 0 24px 60px rgb(4 12 24 / 45%); overflow: hidden; }
.radar-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.radar-panel__title { font-size: 0.9375rem; font-weight: 600; }
.radar-panel__count { font-size: 0.875rem; color: var(--ink-3); }
.radar-list { list-style: none; padding: 0; }
.radar-item { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.75rem; align-items: center; padding: 0.625rem 1.25rem; border-top: 1px solid var(--line-soft); font-size: 0.875rem; line-height: 1.35; }
.radar-item:first-child { border-top: 0; }
.radar-item__score { font-weight: 600; font-variant-numeric: tabular-nums; }
.radar-item__title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-item__meta { display: block; color: var(--ink-3); font-size: 0.8125rem; }
.radar-item--out .radar-item__score { color: var(--ink-3); font-weight: 400; }
.radar-item--out { animation: rg-dim 500ms ease forwards; }
.radar-item--in { animation: rg-lift 500ms ease forwards; }
.radar-item--in .radar-item__bar { display: block; height: 4px; margin-top: 0.375rem; border-radius: 2px; background: var(--line); }
.radar-item--in .radar-item__bar span { display: block; height: 4px; border-radius: 2px; background: var(--plan); transform-origin: left; animation: rg-grow 700ms ease both; }
.w-88 { width: 88%; } .w-84 { width: 84%; } .w-78 { width: 78%; }
.radar-item:nth-child(1) { animation-delay: 300ms; } .radar-item:nth-child(2) { animation-delay: 450ms; }
.radar-item:nth-child(3) { animation-delay: 600ms; } .radar-item:nth-child(4) { animation-delay: 750ms; }
.radar-item:nth-child(5) { animation-delay: 900ms; } .radar-item:nth-child(6) { animation-delay: 1050ms; }
.radar-item:nth-child(7) { animation-delay: 1200ms; } .radar-item:nth-child(8) { animation-delay: 1350ms; }
.radar-item--in .radar-item__bar span { animation-delay: 1500ms; }
.radar-panel__foot { padding: 0.75rem 1.25rem; font-size: 0.8125rem; color: var(--ink-3); background: var(--paper); border-top: 1px solid var(--line); }
/* Le righe scartate si attenuano col colore (ink-3, 6,2:1 sul bianco), non con l'opacità: il testo
   resta sopra 4,5:1 anche nell'illustrazione. */
@keyframes rg-dim { to { color: var(--ink-3); } }
.radar-item--out .radar-item__title { font-weight: 400; }
.radar-item--out .radar-item__meta { color: inherit; }
@keyframes rg-lift { to { background: var(--plan-50); } }
@keyframes rg-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .radar-item, .radar-item--in .radar-item__bar span { animation-duration: 1ms !important; animation-delay: 0ms !important; }
}

/* Fonti */
.sources { padding: 1.25rem 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.sources p { color: var(--ink-2); font-size: 0.9375rem; }
.sources strong { color: var(--ink); font-weight: 600; }

/* Sezioni */
.section { padding: 4.5rem 0; }
.section--paper { background: var(--paper); }
.section-head { max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 3.5vw, 2.375rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
.section-head p { margin-top: 0.875rem; color: var(--ink-2); font-size: 1.125rem; }
@media (min-width: 60rem) { .section { padding: 6rem 0; } }

/* Problema */
.problems { display: grid; gap: 2rem; list-style: none; padding: 0; }
.problems li { padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.problems h3 { font-size: 1.1875rem; line-height: 1.3; font-weight: 600; }
.problems p { margin-top: 0.5rem; color: var(--ink-2); }
@media (min-width: 52rem) { .problems { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; } }

/* Flusso in quattro passi */
.flow { list-style: none; padding: 0; display: grid; gap: 3.5rem; counter-reset: step; }
.step { display: grid; gap: 1.5rem; }
.step__text { position: relative; padding-left: 3.5rem; }
.step__num { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: var(--white); background: var(--plan); font-weight: 600; font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.375rem; line-height: 1.25; font-weight: 600; }
.step p { margin-top: 0.5rem; color: var(--ink-2); max-width: 32rem; }
.step__points { margin-top: 1rem; padding: 0; list-style: none; display: grid; gap: 0.375rem; color: var(--ink-2); font-size: 0.9875rem; }
.step__points li { position: relative; padding-left: 1.25rem; }
.step__points li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 0.5rem; height: 2px; background: var(--plan); }
@media (min-width: 60rem) {
  .flow { gap: 5rem; }
  .step { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4rem; }
  .step:nth-child(even) .step__text { order: 2; }
}

/* Riquadri del prodotto (illustrazioni in HTML, nascoste agli screen reader) */
.ui { color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgb(20 32 46 / 10%); font-size: 0.875rem; line-height: 1.45; overflow: hidden; }
.ui__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--line-soft); font-weight: 600; }
.ui__body { padding: 1rem 1.125rem; display: grid; gap: 0.75rem; }
.ui__row { display: flex; align-items: center; gap: 0.625rem; }
.ui__row--between { justify-content: space-between; }
.ui__muted { color: var(--ink-3); }
.ui__mono { font-family: var(--mono); }
.ui__big { font-size: 2.5rem; line-height: 1; font-weight: 600; letter-spacing: -0.02em; }
.ui__track { flex: 1; height: 6px; border-radius: 3px; background: var(--line-soft); }
.ui__track span { display: block; height: 6px; border-radius: 3px; background: var(--plan); }
.w-100 { width: 100%; } .w-70 { width: 70%; } .w-62 { width: 62%; }
.ui__check { flex: none; width: 1rem; height: 1rem; color: var(--success); }
.ui__warn { flex: none; width: 1rem; height: 1rem; color: var(--danger); }
.ui__btns { display: flex; gap: 0.5rem; padding-top: 0.25rem; }
.ui__btn { padding: 0.375rem 0.75rem; border-radius: 6px; font-weight: 600; font-size: 0.8125rem; }
.ui__btn--plan { color: var(--white); background: var(--plan); }
.ui__btn--line { color: var(--plan); border: 1px solid var(--line-strong); }
.pill { display: inline-flex; align-items: center; padding: 0.0625rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.pill--danger { color: var(--danger); background: var(--danger-bg); }
.pill--warning { color: var(--warning); background: var(--warning-bg); }
.pill--success { color: var(--success); background: var(--success-bg); }
.pill--info { color: var(--info); background: var(--info-bg); }
.pill--neutral { color: var(--ink-2); background: var(--line-soft); }
.load { display: grid; grid-template-columns: 6.5rem repeat(4, minmax(0, 1fr)); gap: 0.25rem; align-items: center; font-size: 0.8125rem; }
.load__cell { display: grid; place-items: center; height: 2.25rem; border-radius: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.load__low { color: var(--ink-2); background: #f1f3f6; }
.load__mid { background: #dbe7f6; }
.load__high { background: #a9c3e6; }
.load__over { color: var(--white); background: var(--danger); }
.load__head { color: var(--ink-3); font-size: 0.75rem; text-align: center; }
.ui-caption { margin-top: 0.625rem; color: var(--ink-3); font-size: 0.8125rem; }

/* Prima e dopo */
.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.compare { width: 100%; min-width: 40rem; border-collapse: collapse; }
.compare th, .compare td { padding: 1rem 1.25rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line-soft); }
.compare thead th { border-top: 0; font-size: 0.9375rem; color: var(--ink-3); font-weight: 600; background: var(--paper); }
.compare tbody th { width: 22%; font-weight: 600; }
.compare td:first-of-type { color: var(--ink-3); }
.compare td:last-child { font-weight: 500; }

/* Per chi */
.audience { display: grid; gap: 2.5rem; }
.roles { list-style: none; padding: 0; display: grid; gap: 1rem; }
.roles li { padding: 1rem 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.roles strong { display: block; font-weight: 600; }
.roles span { color: var(--ink-2); font-size: 0.9875rem; }
@media (min-width: 52rem) { .audience { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4rem; } .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Domande */
.faq { max-width: 48rem; display: grid; gap: 0.5rem; }
.faq details { background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; padding: 0.75rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 0.6rem; height: 0.6rem; border-right: 2px solid var(--plan); border-bottom: 2px solid var(--plan); transform: rotate(45deg); transition: transform 120ms ease; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 1.25rem 1.25rem; color: var(--ink-2); }

/* Beta */
.beta { color: var(--white); background: var(--night); }
.beta .wrap { display: grid; gap: 2.5rem; }
.beta h2 { font-size: clamp(1.75rem, 3.5vw, 2.375rem); line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
.beta-intro p { margin-top: 1rem; color: var(--plan-100); max-width: 30rem; }
.beta-steps { margin-top: 1.5rem; padding: 0; list-style: none; display: grid; gap: 0.75rem; color: var(--plan-100); }
.beta-steps li { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.75rem; }
.beta-steps b { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; color: var(--ink); background: var(--signal); font-size: 0.875rem; }
@media (min-width: 60rem) { .beta .wrap { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4rem; align-items: start; } }

.form-panel { color: var(--ink); background: var(--white); border-radius: 12px; padding: 1.5rem; }
@media (min-width: 40rem) { .form-panel { padding: 2rem; } }
.form-grid { display: grid; gap: 1.125rem; }
@media (min-width: 40rem) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field--wide { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 0.375rem; }
.field label, .field legend { font-weight: 500; font-size: 0.9875rem; }
.req { color: var(--danger); }
.hint { color: var(--ink-3); font-size: 0.875rem; }
.control { width: 100%; min-height: 3rem; padding: 0.625rem 0.875rem; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white); border: 1px solid var(--line-strong); border-radius: 6px; }
.control:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--plan); }
textarea.control { min-height: 6.5rem; resize: vertical; }
.control[aria-invalid="true"] { border: 2px solid var(--danger); }
.field-error { display: none; color: var(--danger); font-size: 0.875rem; font-weight: 500; }
.field-error.is-shown { display: block; }
.consent { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.75rem; align-items: start; font-size: 0.9375rem; }
.consent input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--plan); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.required-note { color: var(--ink-3); font-size: 0.875rem; }
.alert { padding: 0.875rem 1rem; border: 1px solid currentColor; border-left-width: 4px; border-radius: 6px; font-weight: 500; }
.alert[hidden] { display: none; }
.alert--danger { color: var(--danger); background: var(--danger-bg); }
.alert--success { color: var(--success); background: var(--success-bg); }
.form-done h3 { font-size: 1.375rem; font-weight: 600; }
.form-done p { margin-top: 0.5rem; color: var(--ink-2); }

/* Piede */
.site-footer { color: var(--plan-100); background: #10223a; font-size: 0.9375rem; }
.site-footer .wrap { display: grid; gap: 2rem; padding-top: 3rem; padding-bottom: 3rem; }
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--signal); }
.maker { display: flex; align-items: center; gap: 1rem; }
.maker img { width: 6rem; height: auto; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.legal { color: var(--plan-300); font-size: 0.875rem; }
@media (min-width: 52rem) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; } .legal { grid-column: 1 / -1; } }

/* Pagina dell'informativa */
.doc { max-width: 46rem; padding-top: 3rem; padding-bottom: 5rem; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.doc h2 { margin-top: 2.25rem; font-size: 1.375rem; font-weight: 600; }
.doc p, .doc ul { margin-top: 0.75rem; color: var(--ink-2); }
.doc ul { padding-left: 1.25rem; }
.doc .updated { margin-top: 0.75rem; color: var(--ink-3); font-size: 0.9375rem; }
