/**
 * Flynet Wizard — Brand UI
 * Design: teal-to-purple gradient, Sora typeface, premium card aesthetic
 */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* =========================================================================
   Design Tokens
   ========================================================================= */
:root {
  /* Brand gradient */
  --grad-start:    #21C7A8;
  --grad-end:      #6B4DE6;
  --gradient:      linear-gradient(135deg, #21C7A8 0%, #6B4DE6 100%);
  --gradient-h:    linear-gradient(135deg, #1ab898 0%, #5c3fd0 100%);

  /* Semantic colors */
  --success:       #2DD4BF;
  --border:        #E5E7EB;
  --bg:            #F8FAFC;
  --card-bg:       #FFFFFF;
  --text-primary:  #1F2937;
  --text-secondary:#6B7280;
  --error:         #EF4444;
  --warn-bg:       #E6F4F3;
  --warn-text:     #374151;

  /* Radii */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-pill: 999px;

  /* Shadows */
  --sh-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh-md: 0 4px 16px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --sh-lg: 0 8px 32px rgba(0,0,0,.09);
  --sh-teal: 0 4px 14px rgba(33,199,168,.30);
  --sh-ring: 0 0 0 3px rgba(33,199,168,.18);

  /* Motion */
  --ease: 200ms ease;

  /* Typography */
  --font:      'Sora', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Menlo', monospace;
}

/* =========================================================================
   Reset & Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  /* Ambient gradient blot top-right */
  background-image:
    radial-gradient(ellipse 700px 500px at 110% -10%,
      rgba(33,199,168,.10) 0%,
      rgba(107,77,230,.06) 45%,
      transparent 70%);
}

/* =========================================================================
   Container
   ========================================================================= */
.flynet-wizard-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* =========================================================================
   Header
   ========================================================================= */
.wizard-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Logo Flynet */
.wizard-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.375rem;
}

.flynet-logo {
  width: 160px;
  height: auto;
  display: block;
}

.wizard-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.025em;
  line-height: 1.3;
  margin-bottom: .375rem;
}

.wizard-header h1 .brand-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wizard-header p {
  color: var(--text-secondary);
  font-size: .9rem;
}

/* =========================================================================
   Progress Bar
   ========================================================================= */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto 2.5rem;
  position: relative;
}

/* Full connector track — always gray */
.wizard-progress::before {
  content: '';
  position: absolute;
  top: 17px;           /* center of 36px circle */
  left: 18px;          /* half-circle from left */
  right: 18px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-step-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  position: relative;
  z-index: 1;
  flex: 1;
}

.progress-step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  transition: all var(--ease);
  position: relative;
  z-index: 2;
}

.progress-step.done {
  background: #14b49a;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(20,180,154,.35);
}

.progress-step.active {
  background: #14b49a;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(20,180,154,.20),
              0 2px 8px rgba(20,180,154,.35);
}

/* Done steps are clickable links */
a.progress-step-wrapper {
  text-decoration: none;
  cursor: pointer;
}
a.progress-step-wrapper:hover .progress-step {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(20,180,154,.50);
}
a.progress-step-wrapper:hover .progress-label {
  color: var(--text-primary);
}

.progress-label {
  font-size: .65rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: .01em;
  transition: color var(--ease);
}

.progress-step-wrapper.active .progress-label { color: var(--text-primary); }
.progress-step-wrapper.done   .progress-label { color: #14b49a; }

/* =========================================================================
   Step Card
   ========================================================================= */
.wizard-step {
  background: var(--card-bg);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  box-shadow: var(--sh-md);
  border: 1px solid rgba(229,231,235,.8);
  animation: fadeSlide .3s ease both;
}

.wizard-step.hidden { display: none; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-step h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.015em;
  padding-bottom: 1.125rem;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 1.75rem;
}

/* Section heading used inside steps */
.wizard-step h3 {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .75rem;
}

.wizard-step h4 {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .75rem;
}

/* =========================================================================
   Form Groups
   ========================================================================= */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.125rem;
  flex: 1;
  min-width: 150px;
}

.form-group label {
  font-size: .7875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .375rem;
  letter-spacing: .01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.form-group textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}

.form-group input::placeholder  { color: #9CA3AF; }
.form-group select::placeholder { color: #9CA3AF; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--grad-start);
  box-shadow: var(--sh-ring);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.form-group-wide  { flex: 3; }
.form-group-small { flex: 1; min-width: 80px; }

/* =========================================================================
   Custom checkbox / radio circle
   ========================================================================= */

/* Nasconde il controllo nativo */
.checkbox-label input[type="checkbox"],
.radio-inline-group label input[type="radio"],
.radio-card input[type="radio"],
.opzione-item input[type="radio"],
.opzione-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Il cerchio custom */
.chk-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  background: #fff;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
  cursor: pointer;
}

/* Checkmark via ::after */
.chk-icon::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid transparent;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-0.5px, -1px);
  transition: border-color var(--ease);
}

/* Checked state — verde Flynet */
input[type="checkbox"]:checked + .chk-icon,
input[type="radio"]:checked   + .chk-icon {
  background: #14b49a;
  border-color: #14b49a;
  box-shadow: 0 2px 8px rgba(20,180,154,.30);
}

input[type="checkbox"]:checked + .chk-icon::after,
input[type="radio"]:checked   + .chk-icon::after {
  border-color: #fff;
}

/* Focus visibile per accessibilità */
input[type="checkbox"]:focus-visible + .chk-icon,
input[type="radio"]:focus-visible    + .chk-icon {
  box-shadow: 0 0 0 3px rgba(20,180,154,.25);
}

/* Hover sul cerchio quando non ancora selezionato */
.checkbox-label:hover        .chk-icon,
.radio-inline-group label:hover .chk-icon,
.radio-card:hover            .chk-icon,
.opzione-item:hover          .chk-icon {
  border-color: #14b49a;
}

/* chk-icon dentro opzione-item: allineamento griglia */
.opzione-item .chk-icon {
  align-self: center;
}

/* =========================================================================
   Checkbox label
   ========================================================================= */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: .875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-label a {
  color: var(--grad-start);
  font-weight: 600;
  text-decoration: none;
}
.checkbox-label a:hover { text-decoration: underline; }

/* =========================================================================
   Privacy Fieldset
   ========================================================================= */
.privacy-fieldset {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.privacy-fieldset legend {
  font-weight: 700;
  padding: 0 .5rem;
  font-size: .7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.privacy-fieldset label {
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  margin-bottom: 0;
  font-size: .875rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.privacy-item {
  padding: .875rem 0;
  border-bottom: 1px solid var(--border);
}

.privacy-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.privacy-item:first-child { padding-top: 0; }

.privacy-text {
  font-size: .8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: .625rem;
}

.privacy-text a {
  color: var(--grad-start);
  font-weight: 600;
  text-decoration: none;
}
.privacy-text a:hover { text-decoration: underline; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  height: 44px;
  padding: 0 24px;
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: .01em;
  box-shadow: var(--sh-teal);
  transition: opacity var(--ease), transform var(--ease), box-shadow var(--ease);
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(107,77,230,.35);
}

.btn-primary:active {
  transform: scale(.98);
  opacity: 1;
}

.btn-primary.btn-large {
  height: 50px;
  padding: 0 32px;
  font-size: .9375rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  height: 44px;
  padding: 0 20px;
  font-size: .875rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--ease);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: #9CA3AF;
  background: #F9FAFB;
  color: var(--text-primary);
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid var(--border);
  flex-wrap: wrap;
  gap: .75rem;
}

/* =========================================================================
   Offerte Grid
   ========================================================================= */
.offerte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.offerta-card {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--ease);
  position: relative;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
}

.offerta-card:hover {
  border-color: var(--grad-start);
  box-shadow: var(--sh-lg);
  transform: translateY(-2px);
}

.offerta-card.selected {
  border-color: var(--grad-start);
  box-shadow: 0 0 0 2px rgba(33,199,168,.20);
  background: #F9FFFE;
}

/* Checkmark for selected */
.offerta-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 22px;
  text-align: center;
}

.offerta-card h3 {
  font-size: .9375rem;
  font-weight: 700;
  margin-bottom: .625rem;
  color: var(--text-primary);
  border: none;
  padding: 0;
}

.offerta-speed {
  font-size: 1.0625rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}

.offerta-prezzo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.offerta-prezzo small {
  font-size: .725rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.offerta-attivazione {
  font-size: .775rem;
  color: var(--success);
  font-weight: 600;
  margin: .375rem 0 .5rem;
}

.offerta-descr {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-top: .5rem;
  line-height: 1.55;
  flex: 1;
}

.btn-scegli {
  margin-top: 1rem;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  height: 36px;
  padding: 0 1.125rem;
  cursor: pointer;
  font-size: .8125rem;
  font-weight: 600;
  font-family: var(--font);
  width: 100%;
  transition: opacity var(--ease);
}

.btn-scegli:hover { opacity: .88; }

/* Badge (tipo "Fibra") */
.offerta-badge {
  display: inline-block;
  background: var(--success);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .675rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .875rem;
}

/* Filters */
.offerte-filters {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.btn-filter {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: .35rem 1rem;
  cursor: pointer;
  font-size: .8rem;
  font-family: var(--font);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--ease);
}

.btn-filter:hover {
  border-color: var(--grad-start);
  color: var(--text-primary);
}

.btn-filter.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

/* =========================================================================
   Opzioni
   ========================================================================= */
.opzioni-grid { display: flex; flex-direction: column; gap: 1.75rem; }

.opzioni-categoria h3 {
  font-size: .725rem;
  font-weight: 700;
  margin-bottom: .875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: .5rem;
  border: none;
}

.opzioni-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .625rem;
}

@media (max-width: 600px) {
  .opzioni-list { grid-template-columns: 1fr; }
}

.opzione-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .5rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .875rem 1rem;
  cursor: pointer;
  transition: all var(--ease);
  background: #fff;
}

.opzione-item:hover {
  background: #F9FFFE;
  border-color: var(--grad-start);
}

.opzione-item input {
  width: 18px;
  height: 18px;
  height: auto;
  accent-color: var(--grad-start);
  cursor: pointer;
}

.opzione-nome         { font-weight: 600; font-size: .875rem; color: var(--text-primary); }
.opzione-prezzo       { font-size: .8rem; color: var(--grad-end); font-weight: 700; white-space: nowrap; }
.opzione-attivazione  { font-size: .75rem; color: var(--text-secondary); white-space: nowrap; }
.opzione-descr        { grid-column: 2 / -1; font-size: .775rem; color: var(--text-secondary); line-height: 1.5; }

/* =========================================================================
   Copertura — badge e panel offerte
   ========================================================================= */
.copertura-ok-badge {
  display: flex;
  align-items: center;
  gap: .625rem;
  background: #f0fdf9;
  border: 1.5px solid #14b49a;
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--text-primary);
  margin-top: 1.25rem;
  animation: fadeSlide .25s ease both;
}

.badge-icon {
  width: 22px;
  height: 22px;
  background: #14b49a;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.btn-modifica {
  margin-left: auto;
  font-size: .8rem;
  color: #14b49a;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: underline;
  padding: 0;
  white-space: nowrap;
}
.btn-modifica:hover { color: #0e9e87; }

.offerte-result-header {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 2rem 0 1rem;
  padding-top: 1.75rem;
  border-top: 1.5px solid var(--border);
}

/* ── Summary cards grid ── */
.offerte-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.summary-card {
  border-radius: var(--r-lg);
  padding: 1.75rem;
  color: #fff;
  animation: fadeSlide .35s ease both;
}

.summary-card--privati {
  background: var(--gradient);
}

.summary-card--business {
  background: linear-gradient(135deg, #374151 0%, #1a2535 100%);
}

.summary-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.25);
  letter-spacing: -.01em;
}

.summary-speed-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem 1rem;
  padding: .875rem 0;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

.summary-speed-val {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font);
  line-height: 1.1;
}

.summary-speed-label {
  font-size: .75rem;
  opacity: .75;
  margin-top: .2rem;
}

.summary-price {
  margin-top: 1.25rem;
  padding-top: .875rem;
  border-top: 1px solid rgba(255,255,255,.2);
}

.summary-price-label {
  font-size: .8125rem;
  opacity: .8;
  margin-bottom: .25rem;
}

.summary-price-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.summary-price-value small {
  font-size: .875rem;
  font-weight: 400;
  opacity: .8;
}

.btn-attiva-ora {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  margin-top: 1.5rem;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.55);
  border-radius: var(--r-pill);
  color: #fff;
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--ease);
  backdrop-filter: blur(4px);
  letter-spacing: .01em;
}

.btn-attiva-ora:hover {
  background: rgba(255,255,255,.28);
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.btn-attiva-ora:active { transform: scale(.98); }

.summary-loading {
  font-size: .875rem;
  opacity: .7;
  font-style: italic;
  padding: .5rem 0;
}

.summary-empty {
  font-size: .875rem;
  opacity: .7;
  padding: .5rem 0;
}

@media (max-width: 640px) {
  .offerte-summary-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Copertura Fields (step 0)
   ========================================================================= */
.copertura-fields {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  flex: 2;
  min-width: 160px;
}

.field-group--small { flex: 1; min-width: 80px; }

.field-group label {
  font-size: .7875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .375rem;
}

.field-group input {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-family: var(--font);
  color: var(--text-primary);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.field-group input:focus {
  outline: none;
  border-color: var(--grad-start);
  box-shadow: var(--sh-ring);
}

@media (max-width: 600px) {
  .copertura-fields { flex-direction: column; }
}

/* =========================================================================
   OTP — digit boxes
   ========================================================================= */
.otp-subtitle {
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.otp-boxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  margin-bottom: 1.5rem;
}

.otp-sep {
  color: var(--border);
  font-size: 1.25rem;
  line-height: 1;
  margin: 0 .125rem;
  user-select: none;
}

.otp-box {
  width: 52px;
  height: 62px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  caret-color: var(--grad-start);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease), transform var(--ease);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.otp-box:focus {
  border-color: var(--grad-start);
  box-shadow: var(--sh-ring);
  background: #F9FFFE;
}

.otp-box:not(:placeholder-shown):not(.otp-box--error):not(.otp-box--success) {
  border-color: var(--grad-start);
  background: #F9FFFE;
}

.otp-box--error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
  background: #FFF5F5 !important;
  animation: otp-shake .35s ease;
}

.otp-box--success {
  border-color: #14b49a !important;
  background: #f0fdf9 !important;
  box-shadow: 0 0 0 3px rgba(20,180,154,.15) !important;
  transform: scale(1.04);
}

@keyframes otp-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  60%      { transform: translateX(4px); }
  80%      { transform: translateX(-2px); }
}

.otp-actions {
  display: flex;
  gap: .875rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}

/* Responsive: box più piccoli su mobile */
@media (max-width: 400px) {
  .otp-box  { width: 42px; height: 52px; font-size: 1.375rem; }
  .otp-boxes { gap: .4rem; }
}

/* =========================================================================
   Messages
   ========================================================================= */
.error-box, .error-msg {
  background: #FFF5F5;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--r-sm);
  padding: .875rem 1.125rem;
  color: #DC2626;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  line-height: 1.55;
}

.error-box ul { margin-left: 1.25rem; }

.success-msg { color: #059669; font-weight: 600; }

.success-box {
  text-align: center;
  padding: 3rem 2rem;
}

.success-box h2 {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.625rem;
  margin-bottom: 1rem;
}

.alert { padding: .875rem 1.125rem; border-radius: var(--r-sm); }
.alert-warning {
  background: var(--warn-bg);
  border: 1px solid rgba(33,199,168,.25);
  color: var(--warn-text);
}

/* =========================================================================
   Riepilogo
   ========================================================================= */
.riepilogo-box {
  background: #F9FFFE;
  border: 1.5px solid rgba(33,199,168,.25);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.riepilogo-box h3 {
  font-size: .725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--grad-start);
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.riepilogo-box p {
  font-size: .875rem;
  margin-bottom: .375rem;
  color: var(--text-secondary);
}

.riepilogo-box p strong { color: var(--text-primary); }

/* =========================================================================
   Radio Card Group
   ========================================================================= */
.radio-card-group {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: .75rem 0 1.25rem;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.375rem;
  cursor: pointer;
  transition: all var(--ease);
  flex: 1;
  min-width: 160px;
  background: var(--card-bg);
}

.radio-card:hover {
  border-color: var(--grad-start);
  background: #F9FFFE;
}

.radio-card.selected {
  border-color: var(--grad-start);
  background: #F9FFFE;
  box-shadow: 0 0 0 2px rgba(33,199,168,.15);
}

.radio-card input[type="radio"] {
  accent-color: var(--grad-start);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.radio-card-title {
  font-weight: 600;
  font-size: .875rem;
  color: var(--text-primary);
}

/* =========================================================================
   Radio Inline Group
   ========================================================================= */
.radio-inline-group {
  display: flex;
  gap: 1.5rem;
  margin: .625rem 0 1.125rem;
  flex-wrap: wrap;
}

.radio-inline-group label {
  display: flex;
  align-items: center;
  gap: .625rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
}

/* =========================================================================
   Conditional Fields
   ========================================================================= */
.conditional-fields {
  margin-top: 1.25rem;
  padding: 1.375rem 1.5rem;
  background: #F9FAFB;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
}

.conditional-fields h3 {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border: none;
  padding: 0;
}

/* =========================================================================
   Wizard Fieldset
   ========================================================================= */
.wizard-fieldset {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.375rem 1.5rem;
  margin: 1.375rem 0;
}

.wizard-fieldset legend {
  font-weight: 700;
  font-size: .7rem;
  color: var(--text-secondary);
  padding: 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.wizard-fieldset h3 {
  font-size: .9375rem;
  font-weight: 700;
  margin-bottom: .875rem;
  color: var(--text-primary);
  border: none;
  padding: 0;
}

.wizard-fieldset h4 {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: .875rem;
  color: var(--text-primary);
}

/* =========================================================================
   IBAN
   ========================================================================= */
#iban {
  font-family: var(--font-mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* =========================================================================
   File Upload
   ========================================================================= */
.form-group input[type="file"] {
  height: auto;
  padding: 12px 14px;
  border: 2px dashed var(--border);
  background: var(--bg);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: .8125rem;
}

.form-group input[type="file"]:hover {
  border-color: var(--grad-start);
  background: #F9FFFE;
}

.form-group input[type="file"]:focus {
  outline: none;
  border-color: var(--grad-start);
  box-shadow: none;
}

/* =========================================================================
   Inline field error
   ========================================================================= */
.field-inline-error {
  display: block;
  background: #e0f7f4;
  color: #EF4444;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .3rem .65rem;
  margin-top: .375rem;
  border-radius: 4px;
  pointer-events: none;
}

.field-has-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
}

/* =========================================================================
   Utility
   ========================================================================= */
.hidden  { display: none !important; }
.loading {
  color: var(--text-secondary);
  font-size: .875rem;
  font-style: italic;
  padding: 1rem 0;
}

.hint {
  font-size: .8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.375rem;
  line-height: 1.6;
  background: var(--warn-bg);
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  border-left: 3px solid var(--grad-start);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 640px) {
  .flynet-wizard-container { padding: 1.25rem 1rem 4rem; }
  .wizard-step { padding: 1.5rem 1.25rem; }
  .wizard-header h1 { font-size: 1.25rem; }
  .form-row { flex-direction: column; }
  .offerte-grid { grid-template-columns: 1fr; }
  .step-actions { flex-direction: column-reverse; }
  .btn-primary,
  .btn-secondary { width: 100%; justify-content: center; }
  .radio-card { min-width: 100%; }
  .progress-label { display: none; }
  .wizard-progress { max-width: 100%; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .offerte-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================================
   Wizard Layout (colonna principale + sidebar opzionale)
   ========================================================================= */
.wizard-layout {
  display: block;
}

.wizard-layout--with-sidebar {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.75rem;
  align-items: start;
}

.wizard-main {
  min-width: 0; /* evita overflow in grid */
}

/* =========================================================================
   Sidebar riepilogo
   ========================================================================= */
.wizard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1.5rem;
}

/* Stessa estetica dei wizard-step */
.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  border: 1px solid rgba(229,231,235,.8);
  overflow: hidden;
  animation: fadeSlide .35s ease both;
}

/* Barra teal in cima */
.sidebar-card::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #14b49a 0%, #21C7A8 100%);
}

.sidebar-card-inner {
  padding: 1.125rem 1.25rem 1.25rem;
}

/* Label intestazione */
.sidebar-card-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #14b49a;
  margin-bottom: .875rem;
}

.sidebar-card-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14b49a;
  flex-shrink: 0;
}

/* Nome offerta */
.sidebar-offerta-nome {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -.01em;
}

/* Griglia velocità + prezzo */
.sidebar-speeds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .25rem;
  padding: .75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}

.sidebar-speed-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 0 .25rem;
}

.sidebar-speed-item + .sidebar-speed-item {
  border-left: 1px solid var(--border);
}

.sidebar-speed-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sidebar-speed-label {
  font-size: .575rem;
  color: var(--text-secondary);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* Costo attivazione */
.sidebar-attivazione {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .675rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: .25rem .65rem;
}

.sidebar-attivazione::before {
  content: '⚡';
  font-size: .6rem;
}

/* Lista opzioni */
.sidebar-opzione {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .5rem 0;
  border-bottom: 1px dashed rgba(229,231,235,.9);
}

.sidebar-opzione:first-child { padding-top: 0; }
.sidebar-opzione:last-child  { border-bottom: none; padding-bottom: 0; }

.sidebar-opzione-nome {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.sidebar-opzione-prezzo {
  font-size: .7rem;
  font-weight: 700;
  color: #14b49a;
  white-space: nowrap;
}

/* Stato caricamento */
.sidebar-loading {
  font-size: .8rem;
  color: var(--text-secondary);
  padding: .5rem 0;
}

/* Animazione ingresso dopo il popolamento */
.sidebar-card {
  opacity: .45;
  transform: translateX(6px);
  transition: opacity .35s ease, transform .35s ease;
}

.sidebar-card--ready {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive: ≤ 900px sidebar va sotto */
@media (max-width: 900px) {
  .wizard-layout--with-sidebar {
    grid-template-columns: 1fr;
  }
  .wizard-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-card { flex: 1 1 220px; }
}
