/* Configurateur de garage : mise en page, étapes, choix, aperçu */

.page-configurateur { background: var(--beton-50); }
.page-configurateur .entete__cta { display: none; }
.config { display: grid; gap: 16px; padding-block: 16px 120px; grid-template-areas: "tete" "apercu" "etapes"; }
@media (min-width: 1000px) {
  .config { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "tete tete" "apercu etapes"; gap: 20px 40px; padding-block: 24px 64px; align-items: start; }
}
.config > * { min-width: 0; }
.config__tete { grid-area: tete; }
.config__apercu { grid-area: apercu; }
.config__etapes { grid-area: etapes; }
.config h1 { font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem); margin-bottom: 16px; }
.config h1 span { display: block; font: 500 1rem/1.3 var(--font-texte); text-transform: none; color: var(--ink-soft); letter-spacing: 0; margin-top: 6px; }

/* Progression */
.progression { height: 4px; background: var(--beton-200); overflow: hidden; }
.progression__barre { height: 100%; width: 11%; background: var(--signal); transition: width .35s ease; }
.etapier { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.etapier::-webkit-scrollbar { display: none; }
.etapier li { flex: none; }
.etapier button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px 4px 4px; border: 0; border-radius: 99px; background: transparent; color: var(--beton-500); font-size: .84rem; font-weight: 600; cursor: default; white-space: nowrap; }
.etapier .num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--beton-200); color: var(--beton-700); font-size: .78rem; font-weight: 700; }
.etapier .fait button { color: var(--navy-700); cursor: pointer; }
.etapier .fait .num { background: var(--navy-700); color: #fff; }
.etapier .fait button:hover { background: var(--navy-100); }
.etapier .courante button { color: var(--navy-900); background: #fff; box-shadow: var(--ombre-s); }
.etapier .courante .num { background: var(--signal); color: var(--charbon-950); }
@media (max-width: 999px) { .etapier li:not(.courante) .lib { display: none; } .etapier button { padding-right: 4px; } .etapier .courante button { padding-right: 12px; } }

/* Aperçu */
.apercu { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--ombre-s); overflow: hidden; }
@media (min-width: 1000px) { .config__apercu { position: sticky; top: calc(var(--entete-h) + 16px); } }
.apercu__dessin { background: linear-gradient(180deg, #eaf1f7 0%, #f6f4f0 62%, #ece7df 62.2%, #e7e1d8 100%); aspect-ratio: 16 / 10; }
.apercu__dessin svg { width: 100%; height: 100%; display: block; }
@media (max-width: 999px) { .apercu__dessin { aspect-ratio: 16 / 8; } }
.apercu__puces { list-style: none; margin: 0; padding: 12px 16px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.apercu__puces li { font-size: .78rem; font-weight: 600; color: var(--beton-700); background: var(--beton-100); border-radius: 99px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 6px; }
.apercu__puces .pastille { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.apercu__prix { display: none; padding: 14px 16px; }
@media (min-width: 1000px) { .apercu__prix { display: block; } }
.apercu__libelle { display: block; font-size: .85rem; color: var(--ink-soft); }
.apercu__montant { display: inline-block; font: 800 2.6rem/1 var(--font-titre); color: var(--charbon-900); font-stretch: 75%; transition: color .3s; }
.apercu__montant.pulse { color: var(--signal); }
.apercu__note { display: block; font-size: .78rem; color: var(--ink-soft); margin-top: 4px; max-width: 46ch; }
.sauvegarde { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--ink-soft); background: var(--beton-50); }
.sauvegarde svg { width: 16px; height: 16px; flex: none; }
.sauvegarde.ok { color: var(--ok); }
.sauvegarde.en-cours { color: var(--navy-700); }

/* Étape */
.etape { background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(18px, 3vw, 28px); box-shadow: var(--ombre-s); }
.etape:focus { outline: none; }
.etape__titre { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); margin-bottom: 8px; font-stretch: 75%; text-transform: uppercase; font-weight: 800; }
.etape__intro { color: var(--ink-soft); margin-bottom: 20px; }
.etape fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.etape fieldset:last-child { margin-bottom: 0; }
.etape legend { font-weight: 700; color: var(--navy-900); margin-bottom: 10px; padding: 0; font-size: 1rem; }
.etape legend small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .85rem; margin-top: 2px; }
.grille-champs { display: grid; gap: 14px; }
@media (min-width: 560px) { .grille-champs--2 { grid-template-columns: 1fr 1fr; } }
.etape .champ { margin-bottom: 0; }
.info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); background: var(--navy-100); color: var(--navy-900); font-size: .9rem; margin: 0 0 18px; }
.info--alerte { background: var(--warn-bg); color: var(--warn-ink); }
.info--ok { background: var(--ok-bg); color: #1d5a37; }
.info svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.rgpd { font-size: .8rem; color: var(--ink-soft); margin: 16px 0 0; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); margin-top: 14px; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy-700); flex: none; }

/* Cartes de choix */
.choix { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choix--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choix--liste { grid-template-columns: 1fr; }
.choix--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .choix--3 { grid-template-columns: 1fr; } }
.apercu__prix--devis .apercu__montant { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix label { position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 56px; padding: 12px 14px; border: 1.5px solid var(--beton-300); border-radius: var(--r-m); background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.choix label:hover { border-color: var(--navy-700); }
.choix input:checked + label { border-color: var(--charbon-900); background: #fbf7f2; box-shadow: inset 0 0 0 1px var(--charbon-900), inset 4px 0 0 var(--signal); }
.choix input:checked + label::after { content: ""; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--signal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316181b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.choix input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.choix input:disabled + label { opacity: .45; cursor: not-allowed; }
.choix .nom { font-weight: 700; color: var(--navy-900); padding-right: 22px; }
.choix .detail { font-size: .82rem; color: var(--ink-soft); line-height: 1.4; }
.choix .tarif { margin-top: auto; padding-top: 4px; font-size: .84rem; font-weight: 700; color: var(--navy-700); }
.choix .tarif.offert { color: var(--ok); }
.choix .alerte { font-size: .78rem; font-weight: 600; color: var(--warn-ink); background: var(--warn-bg); border-radius: 6px; padding: 3px 8px; align-self: flex-start; }
.choix .picto { display: block; height: 64px; margin: -2px 0 6px; }
.choix .picto svg { height: 100%; width: auto; max-width: 100%; }
.choix--liste label { flex-direction: row; align-items: center; gap: 12px; }
.choix--liste .texte { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.choix--liste .tarif { margin: 0 26px 0 0; padding: 0; white-space: nowrap; }

/* Nuanciers */
.nuancier { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.nuancier input { position: absolute; opacity: 0; pointer-events: none; }
.nuancier label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r-m); border: 1.5px solid transparent; cursor: pointer; text-align: center; font-size: .8rem; font-weight: 600; color: var(--navy-900); line-height: 1.25; }
.nuancier label:hover { background: var(--beton-50); }
.nuancier .rond { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); box-shadow: inset 0 -6px 10px rgba(0,0,0,.06); }
.nuancier .supp { font-weight: 500; color: var(--ink-soft); font-size: .74rem; }
.nuancier input:checked + label { border-color: var(--charbon-900); background: #fbf7f2; }
.nuancier input:checked + label .rond { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--signal); }
.nuancier input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.rond--autre { background: conic-gradient(#c0392b, #e67e22, #f1c40f, #27ae60, #2980b9, #8e44ad, #c0392b); }

/* Navigation */
.config__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.config__nav .btn--secondaire { background: #fff; }
@media (max-width: 999px) { .config__nav #suivant { display: none; } }
.barre-config { position: fixed; inset: auto 0 0 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px var(--gouttiere) calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(18, 38, 59, .25); }
.barre-config span { display: block; font-size: .75rem; color: var(--ink-soft); }
.barre-config strong { font: 800 1.5rem/1.1 var(--font-titre); font-stretch: 80%; color: var(--charbon-900); }
.barre-config .btn { min-width: 150px; }
@media (min-width: 1000px) { .barre-config { display: none; } }
.page-configurateur .barre-mobile { display: none; }

/* Récapitulatif */
.recap { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; margin-bottom: 18px; }
.recap > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.recap > div:last-child { border-bottom: 0; }
.recap dt { color: var(--ink-soft); }
.recap dd { margin: 0; font-weight: 600; color: var(--navy-900); text-align: right; }
.recap .modif { grid-column: 1 / -1; justify-self: start; font-size: .8rem; background: none; border: 0; padding: 0; color: var(--navy-700); text-decoration: underline; cursor: pointer; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px; background: var(--charbon-900); color: #fff; margin-bottom: 8px; box-shadow: inset 4px 0 0 var(--signal); }
.total strong { font: 800 2.2rem/1 var(--font-titre); font-stretch: 75%; color: var(--signal); }
.merci { text-align: center; padding-block: 12px; }
.merci .rond-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.merci .rond-ok svg { width: 32px; height: 32px; }
.suite { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; display: grid; gap: 12px; counter-reset: s; }
.suite li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; counter-increment: s; }
.suite li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-100); color: var(--orange-700); font-weight: 800; }

/* Démo back-office */
.demo-commerciale { position: fixed; right: 16px; bottom: 96px; z-index: 45; border: 2px solid var(--signal); border-radius: 2px; background: var(--charbon-900); color: #fff; padding: 10px 16px; font-size: .82rem; font-weight: 700; box-shadow: var(--ombre-l); cursor: pointer; }
@media (min-width: 1000px) { .demo-commerciale { bottom: 24px; } }
.panneau-demo { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(420px, 100vw); background: #fff; box-shadow: var(--ombre-l); overflow-y: auto; }
.panneau-demo__tete { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--navy-900); color: #fff; }
.panneau-demo .burger { color: #fff; }
#fiche-lead { padding: 16px; font-size: .88rem; }
.statut { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 99px; }
.statut--vide { background: var(--beton-100); color: var(--beton-700); }
.statut--partiel { background: var(--warn-bg); color: var(--warn-ink); }
.statut--complet { background: var(--ok-bg); color: #1d5a37; }
.fiche-lead dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0; }
.fiche-lead dt { color: var(--ink-soft); }
.fiche-lead dd { margin: 0; font-weight: 600; color: var(--navy-900); }
.journal { list-style: none; margin: 10px 0 0; padding: 0; border-left: 2px solid var(--line); }
.journal li { padding: 0 0 10px 12px; position: relative; color: var(--ink-soft); }
.journal li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-700); }
.journal time { font-weight: 700; color: var(--navy-900); margin-right: 6px; }

.prix-facteurs { margin-top: 24px; }

/* Places réservées avant le rendu JavaScript (évite les décalages de mise en page) */
.etapier { min-height: 46px; }
.etape { min-height: 620px; }
@media (min-width: 1000px) { .etape { min-height: 560px; } }
.apercu__puces { min-height: 44px; }

/* Champ piège anti-robots */
.gp-piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn[aria-busy="true"] { opacity: .6; cursor: progress; }

/* Formulaire de contact */
.form-contact { display: grid; gap: 16px; }
.form-contact__grille { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-contact__grille { grid-template-columns: 1fr 1fr; } .form-contact__large { grid-column: 1 / -1; } }
.form-contact .btn { justify-self: start; }
.form-contact__ok { padding: 16px 18px; background: var(--ok-bg); color: #1d5a37; font-weight: 600; border-left: 4px solid var(--ok); }

/* Vue 3D */
.apercu__scene { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(180deg, #dfe8ef 0%, #eef2f3 55%, #e6ecef 100%); }
@media (max-width: 999px) { .apercu__scene { aspect-ratio: 4 / 3; } }
.apercu__scene .apercu__dessin { position: absolute; inset: 0; aspect-ratio: auto; }
.vue3d { position: absolute; inset: 0; cursor: grab; }
.vue3d--glisse { cursor: grabbing; }
.vue3d__toile { display: block; width: 100% !important; height: 100% !important; }
.vue3d__plan { position: absolute; top: 10px; left: 10px; width: clamp(64px, 16%, 110px); background: rgba(255,255,255,.9); border: 1px solid var(--line); padding: 4px; cursor: zoom-in; transition: border-color .15s, box-shadow .15s; }
.vue3d__plan:hover, .vue3d__plan:focus-visible { border-color: var(--signal); box-shadow: 0 4px 14px rgba(22,24,27,.14); }
.vue3d__plan svg { width: 100%; height: auto; display: block; pointer-events: none; }
.vue3d__aide { position: absolute; top: 10px; right: 10px; font-size: .72rem; font-weight: 600; color: var(--charbon-900); background: rgba(255,255,255,.85); padding: 5px 9px; pointer-events: none; }

/* Plan coté : papier quadrillé */
.vue-plan { position: absolute; inset: 0; background-color: #fbfaf7; background-image: linear-gradient(rgba(22,24,27,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(22,24,27,.05) 1px, transparent 1px); background-size: 20px 20px; }
.vue-plan svg { display: block; width: 100%; height: 100%; }

/* Choix de l'affichage */
.vues { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: #fff; }
.vues button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--charbon-900); background: #fff; color: var(--charbon-900); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.vues button svg { width: 15px; height: 15px; }
.vues__choix { display: inline-flex; }
.vues__choix button + button { border-left: 0; }
.vues button[aria-pressed="true"] { background: var(--charbon-900); color: #fff; }
.vues button:disabled { opacity: .4; cursor: progress; }
.vues button:not(:disabled):hover { box-shadow: inset 0 -3px 0 var(--signal); }
.vues__actions { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .vue3d__aide, .vues__voiture { display: none; }
  .vues { padding: 8px; }
  .vues button { padding: 4px 10px; font-size: .74rem; }
}

/* Plan agrandi */
.plan-dialogue { width: min(96vw, 1180px); height: min(92vh, 820px); max-width: none; max-height: none; padding: 0; border: 0; background: #fff; color: var(--charbon-900); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.plan-dialogue[open] { display: flex; flex-direction: column; }
.plan-dialogue::backdrop { background: rgba(14,16,18,.62); }
.plan-dialogue__tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 3px solid var(--signal); background: var(--charbon-900); }
.plan-dialogue__tete h2 { margin: 0; font-size: 1.25rem; color: #fff; text-transform: uppercase; }
.plan-dialogue__fermer { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center; }
.plan-dialogue__fermer svg { width: 20px; height: 20px; }
.plan-dialogue__plan { flex: 1; min-height: 0; background-color: #fbfaf7; background-image: linear-gradient(rgba(22,24,27,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(22,24,27,.05) 1px, transparent 1px); background-size: 24px 24px; }
.plan-dialogue__plan svg { display: block; width: 100%; height: 100%; }
.plan-dialogue__pied { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line); }
.plan-dialogue__pied .btn { flex: none; white-space: nowrap; }
.plan-dialogue__pied p { margin: 0; font-size: .85rem; color: var(--gris-texte, #50565d); }
@media (max-width: 560px) { .plan-dialogue { width: 100vw; height: 100dvh; } .plan-dialogue__pied { flex-direction: column; align-items: stretch; } }

/* Récapitulatif : accès au plan */
.recap__plan { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 6px; }
.recap__plan span { font-size: .85rem; color: #50565d; }
/* reCAPTCHA v2 sous le récapitulatif, juste avant « Envoyer ma demande de devis » (12/11) */
.captcha { margin: 22px 0 4px; min-height: 78px; }
.captcha .erreur { margin: 8px 0 0; }
