/* Font self-hosted */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-600.woff2') format('woff2'); }

:root {
  --bg: #000000;
  --surface: #141414;
  --line: #2a2a2a;
  --text: #ffffff;
  --text-soft: #d9d9d9;
  --text-muted: #a6a6a6;
  --gold: #d4af37;
  --red: #8b0000;
  --radius: 12px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  /* Footer sempre in fondo, anche nelle schermate corte */
  display: flex;
  flex-direction: column;
}

/* Sfumatura rossa nell'angolo, come nei materiali del brand */
.glow {
  position: fixed;
  right: -20vmax;
  bottom: -20vmax;
  width: 70vmax;
  height: 70vmax;
  background: radial-gradient(circle, rgba(139, 0, 0, 0.55) 0%, rgba(139, 0, 0, 0) 65%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

@media (min-width: 600px) {
  .wrap { padding: 40px 24px 80px; }
}

[hidden] { display: none !important; }

.brand {
  margin: 0 0 40px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.dash {
  display: block;
  width: 56px;
  height: 3px;
  margin-bottom: 24px;
  background: var(--gold);
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2rem, 8vw, 3rem); }
h2 { font-size: clamp(1.375rem, 5.5vw, 1.75rem); }
h3 { font-size: 1.125rem; }

h1:focus, h2:focus { outline: none; }

p { margin: 0 0 16px; }

.lead { margin-top: 16px; color: var(--text-soft); font-size: 1.0625rem; }
.meta { color: var(--gold); font-style: italic; font-weight: 500; }

a { color: var(--gold); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Pulsanti */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  margin-top: 24px;
  background: var(--gold);
  color: #000000;
}

.btn-primary:hover { background: #e2c25a; }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }

.btn-ghost {
  min-height: 48px;
  margin-top: 16px;
  padding: 12px 0;
  background: none;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-ghost:hover { color: var(--text); }

/* Barra di avanzamento */
.progress-head { margin-bottom: 28px; }

.progress {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--gold);
}

/* Domande */
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 24px; }

.options { display: grid; gap: 12px; }

.option { position: relative; }

.option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.option label {
  display: block;
  min-height: 56px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
  cursor: pointer;
}

.option label:hover { border-color: var(--text-muted); }

.option input:focus-visible + label {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.option input:checked + label {
  border-color: var(--gold);
  color: var(--text);
  box-shadow: inset 4px 0 0 var(--gold);
}

/* Form */
.field { margin-top: 20px; }

.field label { display: block; margin-bottom: 6px; font-weight: 500; }

.field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}

.field input:focus-visible { outline-offset: 0; border-color: var(--gold); }
.field input[aria-invalid="true"] { border-color: #ff6b6b; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  accent-color: var(--gold);
}

.check label { cursor: pointer; }

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

.turnstile:not(:empty) { margin-top: 20px; }

.form-error {
  min-height: 1.6em;
  margin-top: 12px;
  color: #ff8a8a;
  font-weight: 500;
}

/* Risultato */
/* Punteggio totale: anello grande e centrato, senza riquadro */
.result-total { text-align: center; }

.ring-wrap {
  display: flex;
  justify-content: center;
  margin: 28px 0 8px;
}

.ring { width: min(240px, 66vw); height: auto; }
.ring-track { stroke: var(--line); }
.ring-value { stroke: var(--gold); }
.ring-value.is-fragile { stroke: var(--red); }
.ring-text { fill: var(--text); font-family: inherit; font-size: 36px; font-weight: 600; }
.ring-sub { fill: var(--text-muted); font-family: inherit; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

.band {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.band-critico, .band-fragile { background: var(--red); color: #ffffff; }
.band-da_rafforzare, .band-in_costruzione { border: 1px solid var(--gold); color: var(--gold); }
.band-solido { background: var(--gold); color: #000000; }

.text-block { margin-top: 16px; }
.text-block h4 {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.text-block p { color: var(--text-soft); }

.cta {
  margin: 32px 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cta p { margin: 0; color: var(--text-soft); }
.cta .btn-primary { margin-top: 16px; }

.section-title { margin: 40px 0 16px; }

.areas { display: grid; gap: 12px; }

.area {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.area.is-urgent { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }

.area summary {
  display: block;
  min-height: 48px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.area summary::-webkit-details-marker { display: none; }

.area-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.area-head h3::after {
  content: '+';
  margin-left: 10px;
  color: var(--gold);
  font-weight: 500;
}

.area[open] .area-head h3::after { content: '−'; }

.area-score { flex: none; color: var(--text); font-weight: 600; }
.area-score span { color: var(--text-muted); font-weight: 400; }

.urgent-tag {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.bar {
  height: 6px;
  margin: 12px 0;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill { height: 100%; background: var(--gold); }
.bar-fill.is-critico { background: var(--red); }

.area-body { padding: 0 20px 20px; }

.summary { margin-top: 48px; }
.summary h2 { margin-bottom: 12px; }
.summary h3 { margin: 28px 0 10px; color: var(--gold); }
.summary p, .summary li { color: var(--text-soft); }
.summary strong { color: var(--text); font-weight: 600; }
.summary ol { margin: 0 0 16px; padding-left: 1.4em; }
.summary li { margin-bottom: 10px; }
.summary li::marker { color: var(--gold); font-weight: 600; }

.final-line { margin-top: 8px; color: var(--text-muted); text-align: center; }

/* Pagina informativa privacy */
.legal-page h2 { margin: 40px 0 12px; color: var(--gold); font-size: 1.25rem; }
.legal-page h3 { margin: 24px 0 8px; }
.legal-page p, .legal-page li { color: var(--text-soft); }
.legal-page ul { margin: 0 0 16px; padding-left: 1.3em; }
.legal-page li { margin-bottom: 8px; }
.legal-page ul.plain { padding-left: 0; list-style: none; }
.legal-page strong { color: var(--text); font-weight: 600; }
.legal-page .back-link { margin-top: 40px; }
.fill { padding: 1px 6px; border: 1px dashed var(--gold); border-radius: 4px; color: var(--gold); }

/* Footer con i dati legali */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  /* Sfondo a tutta larghezza, testo allineato alla colonna del quiz */
  padding: 28px max(16px, calc((100% - 640px) / 2 + 16px)) 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.875rem;
}

@media (min-width: 600px) {
  .site-footer { padding-left: max(24px, calc((100% - 640px) / 2 + 24px)); padding-right: max(24px, calc((100% - 640px) / 2 + 24px)); }
}

.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--gold); }
