/* Formulaire de devis — complète la feuille de style du site (assets/style.css) */
body { background: var(--ice); display: flex; flex-direction: column; min-height: 100vh; }
.devis { flex: 1; padding: 32px 0 56px; }
.devis-inner { max-width: 760px; }
.header-help { margin-left: auto; font-weight: 600; text-decoration: none; font-size: .95rem; }
@media (max-width: 520px) { .header-help { display: none; } }
.devis-footer { padding: 20px 0; }
.devis-footer .footer-bottom { margin: 0 auto; padding-top: 0; border: 0; }

[hidden] { display: none !important; }

/* Progression */
.progress { height: 8px; background: #dbe5f3; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue-500), var(--orange)); border-radius: 99px; transition: width .35s ease; }
.progress-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin: 8px 0 20px; }

/* Étapes */
#wizard { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; }
@media (max-width: 640px) { #wizard { padding: 22px 16px; border-radius: 14px; } .devis { padding-top: 20px; } }
.step h1 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin: 0 0 24px; outline: none; }

/* Champs */
.field { margin: 0 0 18px; flex: 1; min-width: 0; }
.field label, .field .label { display: block; font-weight: 600; font-size: .95rem; color: var(--blue-900); margin-bottom: 6px; }
.field small { font-weight: 400; color: var(--muted); }
.field-sm { flex: 0 0 120px; }
.field-md { max-width: 260px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { min-width: 180px; }
.row > .field-sm { min-width: 100px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: .72em .85em; border: 1.5px solid #c9d5e6; border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s; min-height: 48px;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231c4fa3' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input:focus, select:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(47, 111, 214, .15); }
input:user-invalid, select:user-invalid { border-color: #d24a3c; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 2.4em; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }

/* Choix sous forme de cartes */
.choices { display: grid; gap: 14px; }
.choices-2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 20px 22px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .15s, background .15s, transform .15s;
}
.choice strong { font-size: 1.08rem; }
.choice small { color: var(--muted); }
.choice:hover span { border-color: var(--blue-500); transform: translateY(-2px); }
.choice input:checked + span { border-color: var(--blue-700); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-700); }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(47, 111, 214, .25); }

/* Boutons segmentés (oui / non, types…) */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
  padding: .6em 1em; border: 1.5px solid #c9d5e6; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--ink);
  background: #fff; transition: border-color .15s, background .15s;
}
.segmented input { accent-color: var(--blue-700); margin: 0; }
.segmented label:has(input:checked) { border-color: var(--blue-700); background: var(--blue-50); color: var(--blue-900); }
#date-mode { margin-bottom: 20px; }

/* Banques */
.banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.bank { cursor: pointer; position: relative; }
.bank input { position: absolute; opacity: 0; pointer-events: none; }
.bank span {
  display: grid; place-items: center; height: 84px; padding: 10px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, transform .15s;
}
.bank img { max-height: 56px; width: auto; object-fit: contain; }
.bank:hover span { border-color: var(--blue-500); transform: translateY(-2px); }
.bank input:checked + span { border-color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue-700); background: var(--blue-50); }
.bank input:focus-visible + span { box-shadow: 0 0 0 4px rgba(47, 111, 214, .25); }

/* Cartes de prêt et d'emprunteur */
fieldset.card { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px 6px; margin: 0 0 20px; box-shadow: none; background: var(--ice); }
fieldset.card legend { font-weight: 800; color: var(--blue-900); padding: 0 8px; margin-left: -8px; font-size: 1.05rem; }
@media (max-width: 640px) { fieldset.card { padding: 16px 14px 4px; } }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; margin: 8px 0 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue-700); flex: none; }
.note { font-size: .88rem; color: var(--muted); }

/* Navigation */
.nav-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.nav-buttons .btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem; }
.nav-buttons .btn-ghost { border: 2px solid currentColor; background: none; }
#next { margin-left: auto; }
#next:disabled { opacity: .7; cursor: progress; transform: none; }
.form-error { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: #a1281c; font-weight: 600; }
@media (max-width: 480px) { .nav-buttons .btn { padding: .8em 1.1em; } }

/* Attente pendant la tarification (devis.js, waiting) */
#attente { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(10, 14, 22, .65); }
body.en-attente { overflow: hidden; }
.attente-carte { background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); padding: 32px 28px; max-width: 460px; width: 100%; text-align: center; }
.attente-carte h2 { font-size: 1.3rem; margin: 14px 0 10px; color: var(--blue-900); }
.attente-carte p { margin: 0 0 12px; color: var(--ink); }
.attente-assureur { color: var(--muted) !important; font-size: .95rem; min-height: 1.5em; }
.attente-assureur strong { color: var(--blue-900); }
.attente-roue { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--orange); animation: attente-tourne .9s linear infinite; }
@keyframes attente-tourne { to { transform: rotate(360deg); } }
.attente-barre { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
#attente-avance { height: 100%; width: 0; background: var(--orange); border-radius: 99px; transition: width 2.4s linear; }
@media (prefers-reduced-motion: reduce) { .attente-roue { animation-duration: 3s; } #attente-avance { transition: none; } }
