/* FRATTIN-PERMUTA-CSS-VERSION: 1.21.0 */
/* ============================================================
   Frattin Permuta Modal — CSS
   Brand colors: Navy #1a1f5e, Red #d32f2f, White #ffffff
   ============================================================ */

/* ── Font della targa ──
   Alte DIN 1451 Mittelschrift (Peter Wiegel) — il carattere delle targhe
   italiane deriva dal DIN 1451. Self-hosted nel plugin: subset ai soli
   A-Z 0-9, 3,6 KB. Vedi assets/fonts/LICENSE-targa.txt.
   Il percorso è relativo a questo file CSS (assets/css/ → assets/fonts/). */
@font-face {
  font-family: 'FP Targa';
  src: url('../fonts/targa.woff2') format('woff2'),
       url('../fonts/targa.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020, U+002D, U+0030-0039, U+0041-005A;
}

:root {
  --fp-navy: #1a1f5e;
  --fp-navy-dark: #12175a;
  --fp-navy-light: #2a3180;
  /* Gradiente brand */
  --fp-blue: #0000c0;
  --fp-blue-light: #3a3aff;
  --fp-grad: linear-gradient(90deg, #0000c0, #3a3aff);
  --fp-red: #d32f2f;
  --fp-red-dark: #b71c1c;
  --fp-green: #2e7d32;
  --fp-green-light: #e8f5e9;
  --fp-white: #ffffff;
  --fp-bg: #f7f8fc;
  --fp-border: #e0e3ef;
  --fp-text: #1a1a2e;
  --fp-muted: #6b7080;
  --fp-muted-light: #a0a6b8;
  --fp-radius: 20px;
  --fp-radius-sm: 12px;
  --fp-radius-xs: 8px;
  --fp-shadow: 0 20px 60px rgba(26,31,94,0.18), 0 4px 20px rgba(0,0,0,0.08);
  /* Il modale eredita il font del sito: nessun Google Fonts caricato
     dal plugin. Anche il "condensato" eredita, così nome vettura,
     valutazione e targa usano lo stesso carattere del resto. */
  --fp-font: inherit;
  --fp-font-cond: inherit;
  /* Solo per l'input targa: tutto il resto eredita dal sito. */
  --fp-font-plate: 'FP Targa', 'Arial Narrow', sans-serif;
  --fp-transition: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset box-sizing (scoped al modale) ──
   Senza questo, i temi che non impostano border-box fanno traboccare
   ogni input con width:100% + padding fuori dal pannello. */
#fp-overlay,
#fp-overlay *,
#fp-overlay *::before,
#fp-overlay *::after {
  box-sizing: border-box;
}

/* ── Overlay ── */
#fp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 50, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}
#fp-overlay.fp-visible { opacity: 1; }

/* ── Modal container ── */
#fp-modal {
  background: var(--fp-white);
  border-radius: var(--fp-radius);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  max-height: 92dvh; /* dvh = viewport reale, esclude la barra URL del browser mobile */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--fp-shadow);
  transform: translateY(32px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  font-family: var(--fp-font);
}
#fp-overlay.fp-visible #fp-modal {
  transform: translateY(0) scale(1);
}

/* ── Modal header ── */
.fp-header {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--fp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.fp-logo {
  width: 150px;
}
.fp-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--fp-bg);
  color: var(--fp-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.fp-close:hover { background: #ffe0e0; color: var(--fp-red); transform: rotate(90deg); }

/* ── Progress bar ── */
.fp-progress {
  height: 4px;
  background: var(--fp-border);
  flex-shrink: 0;
}
.fp-progress-fill {
  height: 100%;
  background: var(--fp-grad);
  border-radius: 0 4px 4px 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Steps indicator ── */
.fp-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px 10px;
  flex-shrink: 0;
}
.fp-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fp-muted-light);
  transition: color 0.3s;
}
.fp-step.active { color: var(--fp-blue); }
.fp-step.done { color: var(--fp-green); }
.fp-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--fp-border);
  color: var(--fp-muted);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
}
.fp-step.active .fp-step-num { background: var(--fp-grad); color: white; }
.fp-step.done .fp-step-num { background: var(--fp-green); color: white; }

/* Step già completati: cliccabili per tornare indietro */
.fp-step-clickable {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border-radius: 20px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.fp-step-clickable:hover .fp-step-num {
  background: var(--fp-grad);
  transform: scale(1.12);
}
.fp-step-clickable:hover .fp-step-label { color: var(--fp-blue); }
.fp-step-clickable:active .fp-step-num { transform: scale(0.95); }
.fp-step-clickable:focus-visible {
  outline: 2px solid var(--fp-blue);
  outline-offset: 2px;
}
@media (hover: none) {
  .fp-step-clickable:hover .fp-step-num { background: var(--fp-green); transform: none; }
  .fp-step-clickable:hover .fp-step-label { color: var(--fp-green); }
}
.fp-step-sep {
  width: 20px; height: 2px;
  background: var(--fp-border);
  border-radius: 2px;
}
.fp-step-label { display: none; }
/* Le etichette compaiono solo sopra il breakpoint mobile: sotto i 560px
   sei step + etichette non entrano in riga e l'ultima viene tagliata. */
@media (min-width: 561px) { .fp-step-label { display: inline; } }

/* ── Scrollable body ── */
.fp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* evita che lo scroll "sfondi" sulla pagina retrostante */
}
.fp-body::-webkit-scrollbar { width: 4px; }
.fp-body::-webkit-scrollbar-track { background: transparent; }
.fp-body::-webkit-scrollbar-thumb { background: var(--fp-border); border-radius: 4px; }

/* ── Panels ── */
.fp-panel {
  padding: 20px 24px 28px;
  display: none;
  animation: fpFadeIn 0.3s ease;
}
.fp-panel.fp-active { display: block; }
@keyframes fpFadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Panel title ── */
.fp-panel-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--fp-navy);
  line-height: 1.25;
  margin-bottom: 6px;
  text-align: center;
}
.fp-panel-sub {
  font-size: 14px;
  color: var(--fp-muted);
  text-align: center;
  margin-bottom: 24px;
}

/* ── License plate input ── */
.fp-plate-wrap {
  display: flex;
  align-items: stretch;
  border: 2.5px solid var(--fp-blue);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fp-plate-wrap:focus-within {
  border-color: var(--fp-blue-light);
  box-shadow: 0 0 0 4px rgba(0,0,192,0.12);
}
.fp-plate-flag {
  background: var(--fp-blue);
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 46px;
  flex: 0 0 46px;
  overflow: hidden;
}
.fp-plate-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.05); /* rifila via il margine bianco del jpg — regola questo valore a occhio */
}
.fp-plate-input {
  flex: 1 1 auto;
  min-width: 0;   /* senza questo l'input impone la sua larghezza intrinseca e sfonda il box */
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--fp-font-plate);
  /* Il DIN 1451 ha un solo peso: 800 farebbe sintetizzare un finto grassetto
     al browser, sformando le lettere. */
  font-weight: 400;
  font-size: clamp(28px, 9vw, 44px);
  color: #111;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  padding: 8px 16px;
  background: transparent;
}
.fp-plate-input::placeholder {
  color: #c8ccdf;
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* ── Buttons ── */
.fp-btn {
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: var(--fp-radius-sm);
  font-family: var(--fp-font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  touch-action: manipulation; /* niente ritardo di 300ms al tap su mobile */
}
.fp-btn-primary {
  background: var(--fp-grad);
  border: 1px solid var(--fp-blue);
  color: white;
}
/* Hover/focus: schiarisco con un filtro invece di sostituire il colore.
   Con un background flat il gradiente sparirebbe al passaggio del mouse. */
.fp-btn-primary:hover:not(:disabled) {
  background: var(--fp-grad) !important;
  border-color: var(--fp-blue) !important;
  color: white !important;
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,192,0.32) !important;
}
.fp-btn-primary:active:not(:disabled),
.fp-btn-primary:focus:not(:disabled),
.fp-btn-primary:focus-visible:not(:disabled) {
  background: var(--fp-grad) !important;
  border-color: var(--fp-blue) !important;
  color: white !important;
  filter: brightness(1.08);
  outline: none !important;
  box-shadow: 0 4px 12px rgba(0,0,192,0.32) !important;
}
.fp-btn-red {
  background: var(--fp-red);
  color: white;
}
.fp-btn-red:hover:not(:disabled) {
  background: var(--fp-red-dark) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(211,47,47,0.35) !important;
}
.fp-btn-red:active:not(:disabled),
.fp-btn-red:focus:not(:disabled),
.fp-btn-red:focus-visible:not(:disabled) {
  background: var(--fp-red-dark) !important;
  color: white !important;
  outline: none !important;
  box-shadow: 0 4px 12px rgba(211,47,47,0.35) !important;
}
.fp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.fp-btn-outline {
  background: transparent;
  border: 2px solid var(--fp-border);
  color: var(--fp-muted);
  font-size: 14px;
  padding: 10px 24px;
}
.fp-btn-outline:hover:not(:disabled) {
  background: transparent !important;
  border-color: var(--fp-blue) !important;
  color: var(--fp-blue) !important;
}
.fp-btn-outline:active:not(:disabled),
.fp-btn-outline:focus:not(:disabled),
.fp-btn-outline:focus-visible:not(:disabled) {
  background: transparent !important;
  border-color: var(--fp-blue) !important;
  color: var(--fp-blue) !important;
  outline: none !important;
}
.fp-btn-link {
  background: none;
  border: none;
  color: var(--fp-navy);
  font-family: var(--fp-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  display: inline;
}

/* ── Loading spinner inside button ── */
.fp-spin {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: fpSpin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes fpSpin { to { transform: rotate(360deg); } }

/* ── Confirmed row ── */
.fp-confirmed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--fp-bg);
  border: 1.5px solid var(--fp-border);
  border-radius: var(--fp-radius-xs);
  margin-bottom: 8px;
  transition: background 0.2s;
}
.fp-confirmed-row:hover { background: #eef0fa; }
.fp-confirmed-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fp-text);
}
.fp-check { color: var(--fp-green); font-size: 16px; }
.fp-confirmed-edit {
  background: none;
  border: none;
  color: var(--fp-muted-light);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.fp-confirmed-edit:hover { color: var(--fp-navy); }

/* ── Version chips ── */
.fp-version-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fp-muted);
  margin-bottom: 10px;
  margin-top: 16px;
}
.fp-version-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.fp-chip {
  padding: 8px 16px;
  border: 2px solid var(--fp-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fp-muted);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.fp-chip:hover { border-color: var(--fp-navy); color: var(--fp-navy); }
.fp-chip.fp-chip-active {
  border-color: var(--fp-navy);
  background: var(--fp-navy);
  color: white;
}

/* ── Select rows (dropdown-style options) ── */
.fp-select-row {
  width: 100%;
  padding: 13px 14px;
  background: var(--fp-bg);
  border: 1.5px solid var(--fp-border);
  border-radius: var(--fp-radius-xs);
  font-family: var(--fp-font);
  font-size: 14px;
  font-weight: 500;
  color: var(--fp-muted);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7080' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  margin-bottom: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fp-select-row:focus {
  border-color: var(--fp-navy);
  box-shadow: 0 0 0 3px rgba(26,31,94,0.08);
  color: var(--fp-text);
}
.fp-select-row.fp-filled {
  background-color: white;
  border-color: var(--fp-border);
  color: var(--fp-text);
}

/* ── KM slider ── */

/* Le frecce native di input[type=number] si sovrappongono ai suffissi
   "km" e "€" posizionati in absolute. Le rimuoviamo: il valore si
   digita, non si incrementa a colpi di freccia. */
#fp-overlay input[type="number"]::-webkit-outer-spin-button,
#fp-overlay input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
#fp-overlay input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.fp-km-input-wrap {
  position: relative;
  margin-bottom: 8px;
}
.fp-km-input {
  width: 100%;
  padding: 13px 60px 13px 14px;
  background: var(--fp-bg);
  border: 1.5px solid var(--fp-border);
  border-radius: var(--fp-radius-xs);
  font-family: var(--fp-font);
  font-size: 15px;
  font-weight: 700;
  color: var(--fp-text);
  outline: none;
  transition: border-color 0.2s;
}
.fp-km-input:focus { border-color: var(--fp-navy); background: white; }
.fp-km-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--fp-muted);
  pointer-events: none;
}

/* ── Color picker ── */
.fp-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.fp-color-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 6px 4px;
  transition: all 0.2s;
}
.fp-color-opt:hover { border-color: var(--fp-border); background: var(--fp-bg); }
.fp-color-opt.fp-color-active { border-color: var(--fp-navy); background: #eef0fa; }
.fp-color-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
}
.fp-color-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--fp-muted);
  text-align: center;
}
.fp-color-opt.fp-color-active .fp-color-name { color: var(--fp-navy); }

/* ── Condition picker ── */
.fp-condition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.fp-condition-opt {
  border: 2px solid var(--fp-border);
  border-radius: var(--fp-radius-xs);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}
.fp-condition-opt:hover { border-color: var(--fp-navy); }
.fp-condition-opt.fp-active { border-color: var(--fp-navy); background: #eef0fa; }
.fp-condition-opt-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fp-text);
  margin-bottom: 2px;
}
.fp-condition-opt-sub { font-size: 11px; color: var(--fp-muted); }
.fp-condition-opt.fp-active .fp-condition-opt-title { color: var(--fp-navy); }

/* ── Photo upload ── */
.fp-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
@media (min-width: 420px) {
  .fp-photos-grid { grid-template-columns: repeat(4, 1fr); }
}
.fp-photo-slot {
  position: relative;
  aspect-ratio: 4/3;
  border: 1.5px solid var(--fp-border);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  background: var(--fp-bg);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fp-photo-slot:hover {
  border-color: var(--fp-navy);
  background: #eef0fa;
  box-shadow: 0 4px 14px rgba(26,31,94,0.12);
  transform: translateY(-1px);
}
.fp-photo-slot.fp-has-photo { border-style: solid; border-color: var(--fp-green); box-shadow: none; transform: none; }
.fp-photo-slot input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.fp-photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fp-photo-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(26,31,94,0.12);
  font-size: 16px;
  z-index: 1;
}
.fp-photo-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fp-muted);
  text-align: center;
  line-height: 1.3;
  padding: 0 4px;
  z-index: 1;
}
.fp-photo-slot.fp-has-photo .fp-photo-icon,
.fp-photo-slot.fp-has-photo .fp-photo-label { display: none; }
.fp-photo-remove {
  position: absolute !important;
  top: 6px !important; right: 6px !important;
  width: 22px !important; height: 22px !important;
  background: rgba(0,0,0,0.55) !important;
  border: none !important;
  border-radius: 50% !important;
  color: white !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  padding: 0 !important;
  cursor: pointer;
  z-index: 3;
  display: none !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fp-photo-slot.fp-has-photo .fp-photo-remove { display: flex !important; }
.fp-photo-required { color: var(--fp-red); font-size: 11px; }

/* ── Section label ── */
.fp-section-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fp-navy);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--fp-border);
}
.fp-section-label:first-child { margin-top: 0; }

/* ── Input fields ── */
.fp-field { margin-bottom: 12px; }
.fp-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--fp-muted);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.fp-label .fp-req { color: var(--fp-red); }
.fp-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--fp-border);
  border-radius: var(--fp-radius-xs);
  font-family: var(--fp-font);
  font-size: 14px;
  font-weight: 500;
  color: var(--fp-text);
  background: var(--fp-bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.fp-input:focus {
  border-color: var(--fp-navy);
  background: white;
  box-shadow: 0 0 0 3px rgba(26,31,94,0.07);
}
.fp-input.fp-error { border-color: var(--fp-red); background: #fff5f5; }
.fp-error-msg {
  font-size: 12px;
  color: var(--fp-red);
  margin-top: 4px;
  display: none;
}
.fp-input.fp-error + .fp-error-msg { display: block; }
.fp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Radio options ── */
.fp-radio-group { display: flex; flex-direction: column; gap: 8px; }
.fp-radio-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--fp-border);
  border-radius: var(--fp-radius-xs);
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}
.fp-radio-opt:hover { border-color: var(--fp-navy); }
.fp-radio-opt.fp-active { border-color: var(--fp-navy); background: #eef0fa; }
.fp-radio-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--fp-border);
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.fp-radio-opt.fp-active .fp-radio-dot {
  border-color: var(--fp-navy);
  background: var(--fp-navy);
}
.fp-radio-opt.fp-active .fp-radio-dot::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: white;
}
.fp-radio-text { font-size: 14px; font-weight: 600; color: var(--fp-text); }
.fp-radio-opt.fp-active .fp-radio-text { color: var(--fp-navy); }

/* ── Inline radios (Sì/No) ── */
.fp-inline-radio { display: flex; gap: 8px; }
.fp-inline-radio .fp-radio-opt { flex: 1; justify-content: center; }

/* ── Expected value input ── */
.fp-euro-wrap { position: relative; }
.fp-euro-wrap .fp-input { padding-right: 36px; }
.fp-euro-sym {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px; font-weight: 700;
  color: var(--fp-muted);
  pointer-events: none;
}

/* ── Summary card (step 5) ── */
.fp-summary-card {
  background: linear-gradient(135deg, var(--fp-navy) 0%, var(--fp-navy-light) 100%);
  border-radius: var(--fp-radius-sm);
  padding: 18px 20px;
  color: white;
  margin-bottom: 16px;
}
.fp-summary-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0.7;
  margin-bottom: 6px;
}
.fp-summary-car {
  font-family: var(--fp-font-cond);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.fp-summary-plate {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.75;
}

/* ── Valuation result card ── */
.fp-valuation-result {
  background: var(--fp-bg);
  border: 2px solid var(--fp-border);
  border-radius: var(--fp-radius-sm);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.fp-val-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fp-muted);
  margin-bottom: 8px;
}
.fp-val-range {
  font-family: var(--fp-font-cond);
  /* Era 30px con un font condensato. Con il font del sito, più largo,
     "€ 24.200 – 27.000" sfonda la card su schermi stretti. */
  font-size: clamp(22px, 6.5vw, 30px);
  font-weight: 800;
  color: var(--fp-navy);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.fp-val-note { font-size: 12px; color: var(--fp-muted); }
.fp-val-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fp-muted);
  font-size: 14px;
}
.fp-val-loading .fp-spin {
  border-color: rgba(26,31,94,0.2);
  border-top-color: var(--fp-navy);
}

/* ── Footer / privacy ── */
.fp-footer-note {
  font-size: 11px;
  color: var(--fp-muted-light);
  text-align: center;
  line-height: 1.5;
  margin-top: 14px;
}
.fp-footer-note a {
  color: var(--fp-navy);
  text-decoration: underline;
}
.fp-divider {
  height: 1px;
  background: var(--fp-border);
  margin: 16px 0;
}

/* ── Success screen ── */
.fp-success {
  text-align: center;
  padding: 12px 0 8px;
}
.fp-success-icon {
  width: 72px; height: 72px;
  background: var(--fp-green-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  margin: 0 auto 20px;
}
.fp-success-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--fp-navy);
  margin-bottom: 8px;
}
.fp-success-sub {
  font-size: 15px;
  color: var(--fp-muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto 24px;
}

/* ── Alert boxes ── */
.fp-alert {
  padding: 11px 14px;
  border-radius: var(--fp-radius-xs);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.fp-alert-warn {
  background: #fff8e1;
  border: 1.5px solid #ffe082;
  color: #795548;
}
.fp-alert-info {
  background: #e8eaf6;
  border: 1.5px solid #9fa8da;
  color: #283593;
}
.fp-alert-error {
  background: #ffebee;
  border: 1.5px solid #ef9a9a;
  color: #b71c1c;
}

/* ── Checkbox ── */
.fp-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.fp-checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--fp-navy);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}
.fp-checkbox-label {
  font-size: 12px;
  color: var(--fp-muted);
  line-height: 1.4;
  cursor: pointer;
}

/* ── Email info text ── */
.fp-email-note {
  background: #e8eaf6;
  border-radius: var(--fp-radius-xs);
  padding: 10px 12px;
  font-size: 12px;
  color: #3949ab;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Sticky footer buttons ── */
.fp-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--fp-border);
  background: white;
  flex-shrink: 0;
}

/* ── Car info card (step 2 – dati vettura da Motornet) ── */
.fp-car-info-card {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eaf6 100%);
  border: 1px solid #c5cae9;
  border-radius: var(--fp-radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.fp-car-info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--fp-navy);
  color: white;
}
.fp-car-info-icon {
  font-size: 20px;
}
.fp-car-info-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.fp-car-info-grid {
  padding: 4px 0;
}
.fp-car-info-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-bottom: 1px solid #dde1f0;
  font-size: 13px;
}
.fp-car-info-row:last-child {
  border-bottom: none;
}
.fp-car-info-row-icon {
  font-size: 15px;
  text-align: center;
}
.fp-car-info-row-label {
  color: var(--fp-muted);
  font-weight: 500;
}
.fp-car-info-row-value {
  color: var(--fp-text);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.fp-car-info-row-label { min-width: 0; overflow-wrap: anywhere; }

/* ============================================================
   MOBILE — bottom sheet
   ============================================================ */
@media (max-width: 560px) {

  /* Modale centrato, con margine su tutti i lati.
     Il padding include le safe-area così su iPhone non finisce
     sotto il notch o sopra la barra home. */
  #fp-overlay {
    align-items: center;
    padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right))
             calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  #fp-modal {
    max-height: 100%;
    border-radius: 18px;
  }

  /* Spaziature */
  .fp-panel  { padding: 16px 16px 24px; }
  .fp-header { padding: 14px 16px 12px; }
  .fp-footer { padding: 12px 16px 16px; }
  .fp-steps  { padding: 12px 12px 8px; gap: 5px; }

  .fp-logo { width: 120px; }

  /* Area di tap del pulsante chiudi (44px = minimo consigliato) */
  .fp-close {
    width: 40px; height: 40px;
    font-size: 22px;
  }
  .fp-close:hover { transform: none; }

  /* Indicatore step: 6 pallini + separatori non ci stanno a 360px */
  .fp-step-sep { width: 10px; }
  .fp-step-num { width: 24px; height: 24px; font-size: 11px; }

  /* Tipografia */
  .fp-panel-title { font-size: 20px; }
  .fp-panel-sub   { font-size: 13px; margin-bottom: 20px; }

  /* ⚠️ CRITICO iOS: qualsiasi campo sotto i 16px fa zoomare Safari
     sulla pagina al focus, e l'utente resta bloccato zoomato. */
  .fp-input,
  .fp-select-row,
  .fp-km-input,
  #fp-overlay textarea,
  #fp-overlay select {
    font-size: 16px;
  }

  /* Target di tap sufficienti */
  .fp-btn { min-height: 50px; padding: 14px 20px; }
  .fp-btn-outline { min-height: 46px; }
  .fp-radio-opt, .fp-condition-opt { min-height: 48px; }
  .fp-chip { padding: 10px 16px; }

  /* Niente effetti hover su touch: restano "incollati" dopo il tap.
     ⚠️ Solo sugli elementi NON selezionati: senza il :not() questa
     regola sovrascriverebbe lo stato attivo (stessa specificità ma
     dichiarata dopo) e il selezionato tornerebbe bianco al tap. */
  .fp-radio-opt:not(.fp-active):hover,
  .fp-condition-opt:not(.fp-active):hover {
    border-color: var(--fp-border);
    background: white;
    box-shadow: none;
    transform: none;
  }
  .fp-photo-slot:not(.fp-has-photo):hover {
    border-color: var(--fp-border);
    background: var(--fp-bg);
    box-shadow: none;
    transform: none;
  }
  .fp-color-opt:not(.fp-color-active):hover {
    border-color: transparent;
    background: transparent;
  }
  .fp-chip:not(.fp-chip-active):hover {
    border-color: var(--fp-border);
    color: var(--fp-muted);
    background: white;
  }

  /* Griglie */
  .fp-condition-grid { grid-template-columns: 1fr; }
  .fp-color-grid     { grid-template-columns: repeat(4, 1fr); }
  .fp-field-row      { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Foto: 2 colonne in 4/3 = tiles enormi e uno scroll lunghissimo.
     3 colonne quadrate = tutti gli slot visibili in due righe. */
  .fp-photos-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .fp-photo-slot  { aspect-ratio: 1 / 1; border-radius: 10px; gap: 4px; }
  .fp-photo-icon  { width: 28px; height: 28px; font-size: 14px; }
  .fp-photo-label { font-size: 9.5px; padding: 0 2px; }

  /* Scheda dati vettura */
  .fp-car-info-row { grid-template-columns: 22px 1fr 1fr; padding: 7px 12px; font-size: 12.5px; }
  .fp-summary-card { padding: 16px; }
  .fp-val-range    { font-size: 26px; }
}

/* ── Schermi stretti (iPhone SE, Galaxy A, ecc.) ── */
@media (max-width: 380px) {
  #fp-overlay {
    padding: calc(8px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right))
             calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  }
  .fp-panel  { padding: 14px 12px 20px; }
  .fp-header { padding: 12px 12px 10px; }
  .fp-footer { padding: 10px 12px 14px; }

  .fp-panel-title { font-size: 18px; }
  .fp-step-sep    { width: 6px; }
  .fp-steps       { gap: 4px; padding: 10px 8px 6px; }

  /* Due campi affiancati a 320px diventano illeggibili */
  .fp-field-row { grid-template-columns: 1fr; gap: 0; }

  .fp-color-grid  { grid-template-columns: repeat(3, 1fr); }
  .fp-photos-grid { gap: 6px; }
  .fp-photo-label { font-size: 9px; }
}

/* ── Landscape su telefono: il sheet a tutta altezza non lascia
      spazio, meglio recuperare verticale ── */
@media (max-height: 480px) and (orientation: landscape) {
  #fp-overlay { padding: 8px; }
  #fp-modal { max-height: 100%; border-radius: 14px; }
  .fp-steps { display: none; }
  .fp-panel { padding-top: 12px; }
  .fp-header { padding: 8px 16px; }
  .fp-footer { padding: 8px 16px; }
  .fp-btn { min-height: 44px; }
}

/* ── Rispetta chi ha ridotto le animazioni ── */
@media (prefers-reduced-motion: reduce) {
  #fp-overlay, #fp-modal, .fp-panel, .fp-progress-fill { transition: none !important; animation: none !important; }
}

/* ============================================================
   STATI SELEZIONATI — hanno la precedenza su tutto
   Dichiarati per ultimi così nessun :hover, :focus o :active
   (né del plugin né del tema WordPress) può sovrascriverli.
   ============================================================ */
.fp-chip.fp-chip-active,
.fp-chip.fp-chip-active:hover,
.fp-chip.fp-chip-active:focus,
.fp-chip.fp-chip-active:active {
  border-color: var(--fp-blue) !important;
  background: var(--fp-grad) !important;
  color: #fff !important;
}

.fp-radio-opt.fp-active,
.fp-radio-opt.fp-active:hover,
.fp-radio-opt.fp-active:focus,
.fp-condition-opt.fp-active,
.fp-condition-opt.fp-active:hover,
.fp-condition-opt.fp-active:focus {
  border-color: var(--fp-navy) !important;
  background: #eef0fa !important;
}
.fp-radio-opt.fp-active .fp-radio-text,
.fp-condition-opt.fp-active .fp-condition-opt-title {
  color: var(--fp-navy) !important;
}
.fp-radio-opt.fp-active .fp-radio-dot {
  border-color: var(--fp-navy) !important;
  background: var(--fp-navy) !important;
}

.fp-color-opt.fp-color-active,
.fp-color-opt.fp-color-active:hover,
.fp-color-opt.fp-color-active:focus {
  border-color: var(--fp-navy) !important;
  background: #eef0fa !important;
}
.fp-color-opt.fp-color-active .fp-color-name { color: var(--fp-navy) !important; }

.fp-photo-slot.fp-has-photo,
.fp-photo-slot.fp-has-photo:hover {
  border-color: var(--fp-green) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ── Disclaimer foto (step 4) ── */
.fp-photo-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #eef0fa;
  border: 1px solid rgba(0, 0, 192, 0.14);
  border-radius: var(--fp-radius-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fp-text);
}
.fp-photo-disclaimer strong { color: var(--fp-blue); }
.fp-photo-disclaimer-icon { flex: 0 0 auto; line-height: 1.45; }

/* La valutazione spostata nella schermata finale */
#fp-success-val:not(:empty) { margin: 4px 0 20px; }

/* ── Modalità test (solo staging, ?fp_test=1) ── */
.fp-test-box {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed #d08700;
  border-radius: var(--fp-radius-sm);
  background: #fff8e6;
  font-size: 13px;
  line-height: 1.45;
  color: #6b4a00;
}
.fp-test-badge {
  font-weight: 800;
  color: #a35c00;
  margin-bottom: 4px;
}

/* Slot foto in elaborazione (compressione in corso) */
.fp-photo-slot.fp-photo-loading { opacity: 0.55; pointer-events: none; }
.fp-photo-slot.fp-photo-loading .fp-photo-label::after { content: ' …'; }
