@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
}

:root {
  --ink: #0a2f4e;        /* blu del logo AF */
  --ink-soft: #46627a;
  --mist: #e8edf1;
  --paper: #ffffff;
  --line: #c3cfd9;
  --gold: #d4a537;
  --gold-soft: #f6ecd2;
  --sage: #5f8a68;
  --error: #b03a24;
  --error-soft: #fbeae6;
  --radius: 12px;
  --font: "Archivo", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Barra in alto ---------- */

body[data-step="0"] .bar { display: none; }

.bar {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.bar__inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bar__logo { width: 44px; height: auto; }

.bar__title {
  font-stretch: 80%;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.progress { background: var(--ink); padding: 0 16px 12px; }

.progress__track {
  max-width: 648px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--steps, 7), 1fr);
  gap: 4px;
}

.progress__seg {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  transition: background-color 0.3s ease;
}

.progress__seg.is-done { background: var(--gold); }
.progress__seg.is-current { background: #fff; }

/* ---------- Contenitore ---------- */

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 16px 72px;
  outline: none;
}

.step-count {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 15px;
}

.step-title {
  margin: 0 0 10px;
  font-stretch: 72%;
  font-weight: 800;
  font-size: clamp(38px, 9vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  outline: none;
}

.step-intro {
  margin: 0 0 30px;
  max-width: 34em;
  color: var(--ink-soft);
}

/* ---------- Schermata iniziale ---------- */

.intro { padding-top: 20px; }

.intro__logo { width: 112px; margin: 0 0 36px; }

.intro__title {
  margin: 0 0 22px;
  font-stretch: 66%;
  font-weight: 850;
  font-size: clamp(52px, 15vw, 92px);
  line-height: 0.9;
  letter-spacing: -0.015em;
  outline: none;
}

.intro__title span { display: block; color: var(--ink-soft); font-weight: 500; }

.intro p { max-width: 32em; margin: 0 0 14px; }

.intro__facts {
  list-style: none;
  padding: 0;
  margin: 26px 0 30px;
  display: grid;
  gap: 10px;
  max-width: 32em;
}

.intro__facts li {
  padding-left: 18px;
  position: relative;
  color: var(--ink-soft);
}

.intro__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

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

/* ---------- Campi ---------- */

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px 16px;
}

@media (min-width: 560px) {
  .fields { grid-template-columns: 1fr 1fr; }
}

.field { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; min-width: 0; }

@media (min-width: 560px) {
  .field--half { grid-column: span 1; }
}

.field[hidden] { display: none; }

.field__label {
  display: block;
  padding: 0;
  margin: 0 0 8px;
  font-weight: 620;
  font-size: 17px;
  line-height: 1.35;
}

.field__opt {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 15px;
}

.field__help {
  margin: -4px 0 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 17px;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.textarea { resize: vertical; min-height: 64px; }

.input::placeholder,
.textarea::placeholder { color: #8a9cac; }

.input:focus,
.select:focus,
.textarea:focus {
  outline: 3px solid rgba(10, 47, 78, 0.22);
  outline-offset: 1px;
  border-color: var(--ink);
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 96px; }

.input-wrap__suffix {
  position: absolute;
  right: 14px;
  color: var(--ink-soft);
  font-size: 15px;
  pointer-events: none;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

/* Scelte a pillola (radio e checkbox multiple) */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--stack { flex-direction: column; align-items: stretch; }
.chips--stack .chip { display: flex; }

.chip { position: relative; display: inline-flex; cursor: pointer; }

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.chip span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  line-height: 1.3;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chips--stack .chip span { border-radius: var(--radius); width: 100%; }

.chip--multi span::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: var(--paper) no-repeat center / 12px;
}

.chip:hover span { border-color: var(--ink-soft); }

.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip--multi input:checked + span::before {
  border-color: var(--gold);
  background-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.2 4.8 9 10 3' fill='none' stroke='%230a2f4e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

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

/* Casella singola (consensi) */

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

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

/* Errori */

.field__error {
  margin: 8px 0 0;
  color: var(--error);
  font-size: 15px;
  font-weight: 560;
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select,
.field.has-error .check,
.field.has-error .chip span { border-color: var(--error); }

.notice {
  margin: 0 0 22px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--error-soft);
  color: var(--error);
  font-weight: 560;
}

/* ---------- Navigazione ---------- */

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1.5px solid var(--line);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 680;
  font-stretch: 88%;
  font-size: 18px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: #12406a; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: rgba(10, 47, 78, 0.06); }

.btn--next { margin-left: auto; }

.linkish {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 15px;
}

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

/* ---------- Riepilogo ---------- */

.review { display: grid; gap: 16px; margin-bottom: 30px; }

.review__block {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px 18px 8px;
  border-left: 5px solid var(--gold);
}

.review__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.review__head h2 {
  margin: 0;
  font-stretch: 78%;
  font-weight: 760;
  font-size: 22px;
}

.review dl { margin: 0; }

.review__row {
  padding: 9px 0;
  border-top: 1px solid var(--mist);
}

.review dt { color: var(--ink-soft); font-size: 14px; }
.review dd { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

.review__empty { color: var(--ink-soft); font-size: 15px; padding-bottom: 10px; }

/* ---------- Fine ---------- */

.done { padding-top: 16px; }

.done__mark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--sage);
  display: grid;
  place-items: center;
  margin-bottom: 26px;
}

.done__mark svg { width: 34px; height: 34px; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
