@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --blu: #1A3A6B;
  --blu2: #2A5298;
  --rosso: #D0021B;
  --giallo: #FFD700;
  --nero: #0A0A0A;
  --bianco: #FFFFFF;
  --grigio: #F4F6F9;
  --testo: #1A1A1A;
  --sub: #4A4A4A;
  --bordo: #DDE3EC;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--testo); background: #fff; }

/* TOPBAR */
.topbar {
  background: var(--blu);
  color: #fff;
  text-align: center;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
}
.topbar span { color: var(--giallo); }

/* HEADER */
.header {
  background: var(--blu);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header img { height: 48px; }
.header-contact {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-contact:hover { color: var(--giallo); }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--blu) 0%, var(--blu2) 100%);
  color: #fff;
  padding: 64px 24px 56px;
  text-align: center;
}
.hero-tag {
  display: inline-block;
  background: var(--rosso);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Anton', sans-serif;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--giallo); }
.hero p {
  font-size: 17px;
  color: rgba(255,255,255,.85);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}
.hero-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* COME FUNZIONA */
.come-funziona {
  background: #fff;
  padding: 56px 24px;
}
.container { max-width: 960px; margin: 0 auto; }
.section-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  color: var(--blu);
  text-align: center;
  margin-bottom: 12px;
}
.section-sub {
  text-align: center;
  color: var(--sub);
  font-size: 15px;
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.step-card {
  background: var(--grigio);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  border-top: 4px solid var(--blu);
}
.step-card .step-num {
  width: 40px; height: 40px;
  background: var(--rosso);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  margin: 0 auto 14px;
}
.step-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--blu);
  margin-bottom: 8px;
}
.step-card p { font-size: 14px; color: var(--sub); line-height: 1.5; }

/* GARANZIA STRIP */
.garanzia-strip {
  background: var(--blu);
  padding: 28px 24px;
  text-align: center;
  color: #fff;
}
.garanzia-strip p {
  font-size: 15px;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}
.garanzia-strip strong { color: var(--giallo); }

/* FORM SECTION */
.form-section {
  background: var(--grigio);
  padding: 56px 24px;
}
.form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(26,58,107,.1);
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
}

/* PROGRESS BAR */
.progress-bar {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
}
.prog-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.prog-step::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--bordo);
  z-index: 0;
}
.prog-step:last-child::after { display: none; }
.prog-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bordo);
  border: 2px solid var(--bordo);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #999;
  margin: 0 auto 6px;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}
.prog-step.active .prog-dot {
  background: var(--rosso);
  border-color: var(--rosso);
  color: #fff;
}
.prog-step.done .prog-dot {
  background: #2ECC71;
  border-color: #2ECC71;
  color: #fff;
}
.prog-step.done::after { background: #2ECC71; }
.prog-label {
  font-size: 11px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.prog-step.active .prog-label { color: var(--rosso); }
.prog-step.done .prog-label { color: #2ECC71; }

/* FORM STEPS */
.form-step { display: none; }
.form-step.visible { display: block; }

.step-title {
  font-family: 'Anton', sans-serif;
  font-size: 24px;
  color: var(--blu);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.step-subtitle {
  font-size: 14px;
  color: var(--sub);
  margin-bottom: 24px;
}

/* FIELDS */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--blu);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.field label .req { color: var(--rosso); margin-left: 2px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--bordo);
  border-radius: 10px;
  font-size: 15px;
  color: var(--testo);
  background: #fff;
  transition: border-color 0.2s;
  font-family: 'Inter', sans-serif;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blu);
}
.field textarea { resize: vertical; min-height: 80px; }

/* OPZIONI CLICCABILI */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.options-grid.cols-2 { grid-template-columns: 1fr 1fr; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--bordo);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}
.option-btn:hover {
  border-color: var(--blu);
  background: #F0F4FA;
}
.option-btn.selected {
  border-color: var(--blu);
  background: #F0F4FA;
}
.option-btn.selected .opt-radio {
  background: var(--blu);
  border-color: var(--blu);
}
.option-btn.selected .opt-radio::after { display: block; }
.opt-radio {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--bordo);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.opt-radio::after {
  content: '';
  display: none;
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
/* Checkbox quadrata per multi-selezione problema */
.opt-check {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 2px solid var(--bordo);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s;
}
.option-btn.selected .opt-check {
  background: var(--blu);
  border-color: var(--blu);
}
.option-btn.selected .opt-check::after { display: block; }
.opt-check::after {
  content: '';
  display: none;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  position: absolute;
  top: 1px; left: 5px;
  transform: rotate(45deg);
}
.opt-icon { font-size: 22px; flex-shrink: 0; }
.opt-text strong {
  display: block;
  font-size: 14px;
  color: var(--testo);
  font-weight: 700;
  line-height: 1.3;
}
.opt-text span { font-size: 12px; color: var(--sub); }

/* DETTAGLI PROBLEMA */
.dettaglio-box {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background: #F0F4FA;
  border-radius: 10px;
  border-left: 4px solid var(--blu);
}
.dettaglio-box.visible { display: block; }
.dettaglio-box p {
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 12px;
  font-style: italic;
}

/* CHECKBOX */
.check-options { display: flex; flex-direction: column; gap: 8px; }
.check-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--bordo);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.check-btn:hover { border-color: var(--blu); background: #F0F4FA; }
.check-btn.selected { border-color: var(--blu); background: #F0F4FA; }
.check-box {
  width: 18px; height: 18px;
  border: 2px solid var(--bordo);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.check-btn.selected .check-box {
  background: var(--blu);
  border-color: var(--blu);
}
.check-btn.selected .check-box::after {
  content: '✓';
  color: white;
  font-size: 11px;
  font-weight: 700;
}
.check-btn span { font-size: 14px; color: var(--testo); }

/* NAVIGAZIONE FORM */
.form-nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: space-between;
  align-items: center;
}
.btn-back {
  padding: 12px 24px;
  border: 2px solid var(--bordo);
  border-radius: 8px;
  background: transparent;
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.btn-back:hover { border-color: #999; color: var(--testo); }
.btn-next {
  flex: 1;
  padding: 16px 24px;
  background: var(--rosso);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-next:hover { background: #B5021A; }
.btn-next:disabled { background: #ccc; cursor: not-allowed; }

/* RIEPILOGO */
.riepilogo-box {
  background: var(--grigio);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.riepilogo-box h3 {
  font-family: 'Anton', sans-serif;
  font-size: 16px;
  color: var(--blu);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.riepilogo-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--testo);
  padding: 8px 0;
  border-bottom: 1px solid var(--bordo);
}
.riepilogo-row:last-child { border-bottom: none; }
.riepilogo-row span:first-child { color: var(--sub); }
.riepilogo-row span:last-child { font-weight: 700; color: var(--blu); }
.prezzo-totale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 4px;
}
.prezzo-totale span:first-child { font-weight: 700; font-size: 16px; color: var(--testo); }
.prezzo-totale span:last-child {
  font-family: 'Anton', sans-serif;
  font-size: 32px;
  color: var(--rosso);
}

.garanzia-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #EEF7EE;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #2D6A2D;
  line-height: 1.5;
}
.garanzia-note strong { display: block; margin-bottom: 2px; font-size: 14px; }

/* LOADING */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,.88);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  padding: 24px;
}
.loading-overlay.visible { display: flex; }
.spinner {
  width: 52px; height: 52px;
  border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--rosso);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { font-size: 17px; color: #fff; max-width: 320px; }
.loading-overlay strong {
  display: block;
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* ERRORE */
.error-msg {
  display: none;
  background: #FFF0F0;
  border: 1.5px solid var(--rosso);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: #B5021A;
  margin-top: 12px;
}
.error-msg.visible { display: block; }

/* FOOTER */
footer {
  background: var(--blu);
  color: rgba(255,255,255,.75);
  padding: 32px 24px;
  text-align: center;
}
footer img {
  height: 40px;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
footer p { font-size: 13px; margin-bottom: 4px; }
footer a { color: rgba(255,255,255,.6); text-decoration: none; }
footer a:hover { color: var(--giallo); }

/* STICKY CTA MOBILE */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: #fff;
  border-top: 1px solid var(--bordo);
  padding: 12px 16px;
}
.sticky-cta a {
  display: block;
  background: var(--rosso);
  color: #fff;
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  text-decoration: none;
}

@media (max-width: 640px) {
  .header { padding: 12px 16px; }
  .header-contact span { display: none; }
  .form-card { padding: 24px 16px; }
  .options-grid { grid-template-columns: 1fr; }
  .options-grid.cols-2 { grid-template-columns: 1fr; }
  .sticky-cta { display: block; }
  .prog-label { display: none; }
}
