:root {
  /* Charte Avant / Après (avantapres.fr) */
  --ink: #000000;
  --muted: #5c5c5c;
  --line: #e2e2e2;
  --bg: #f5f5f5;
  --panel: #ffffff;
  --red: #FF5442;
  --blue: #0083C3;
  --accent: #000000;
  --accent-ink: #000000;
  --accent-soft: #eef6fb;
  --ok: #0083C3;
  --ok-soft: #e3f2fa;
  --warn: #b5400f;
  --warn-soft: #fff0ec;
  --bad: #d63a29;
  --bad-soft: #ffe9e6;
  --info: #0083C3;
  --info-soft: #e8f4fa;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 6px 20px rgba(0, 0, 0, .06);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 350 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
strong, b, h1, h2, h3, button, .pill, .badge { font-weight: 600; }
[hidden] { display: none !important; }
h1 { font-size: 1.6rem; line-height: 1.18; margin: .15rem 0 .6rem; letter-spacing: -.01em; font-weight: 500; }
h2 { font-size: 1rem; margin: 0; }
h3 { font-size: .92rem; margin: 1rem 0 .4rem; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Barre supérieure et étapes. En-tête commun à toutes les pages (accueil et maintenance compris) : 64 px de haut,
   logo de 22 px centré verticalement, marges de 24 px (16 px sur smartphone). */
.topbar { height: 64px; border-bottom-color: var(--ink); display: flex; align-items: center; gap: 18px; padding: 0 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand small { display: block; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.brand strong { display: block; font-size: 1rem; }
.brand-logo { height: 22px; width: auto; display: block; }
.brand { gap: 12px; }   /* le sous-titre à côté du logo : le logo reste centré dans la barre */
.brand small { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; padding-left: 12px; border-left: 1px solid var(--line); }
.stepper { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.stepper button { border: 0; background: transparent; padding: 6px 10px; border-radius: 999px; color: var(--muted);
  font-size: .82rem; white-space: nowrap; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.stepper button i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-size: .72rem; border: 1px solid var(--line); background: #fff; }
.stepper button.done i { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper button.active { background: transparent; color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.stepper button.active i { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper button.active.done i { background: var(--blue); border-color: var(--blue); }   /* dernière étape validée */
.stepper button:disabled { cursor: default; opacity: .55; }

/* Mise en page */
.layout { display: grid; grid-template-columns: minmax(380px, 480px) 1fr; height: calc(100% - 64px); }
.panel { overflow-y: auto; padding: 22px 22px 40px; background: var(--panel); border-right: 1px solid var(--line); }
.mapwrap { position: relative; min-height: 300px; }
#map { position: absolute; inset: 0; }
.eyebrow { text-transform: uppercase; font-size: .72rem; letter-spacing: .18em; color: var(--ink); font-weight: 600; margin: 0; }
.lead { color: var(--muted); margin: 0 0 1rem; }
.hint { color: var(--muted); font-size: .86rem; margin: .4rem 0; }

/* Boutons */
.primary, .ghost, .chip { border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid transparent; font-weight: 600; }
.primary { background: var(--ink); color: #fff; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.primary:hover:not(:disabled) { background: var(--blue); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.ghost { background: #fff; border-color: var(--line); }
.ghost:hover { border-color: #c9c5bb; }
.small { white-space: nowrap; padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.actions { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 8px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Cartes de choix du projet */
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.type-card { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 12px;
  cursor: pointer; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: start; transition: border-color .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.type-card.selected { border-color: var(--blue); background: var(--accent-soft); }
.type-card svg { width: 38px; height: 38px; color: var(--blue); }
.type-card strong { display: block; font-size: .92rem; line-height: 1.25; }
.type-card span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.35; margin-top: 2px; }
.reassure { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 6px; font-size: .84rem; color: var(--muted); }
.reassure li::before { content: "—"; color: var(--blue); font-weight: 700; margin-right: 8px; }

/* Cartes d'information */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 12px 0; background: #fff; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.pill { font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--bg); color: var(--muted); }

/* Recherche d'adresse */
.search { position: relative; }
.search input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); z-index: 10; overflow: hidden; }
.search-results button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 10px 14px; cursor: pointer; }
.search-results button:hover, .search-results button:focus { background: var(--bg); }
.search-results small { color: var(--muted); display: block; font-size: .78rem; }

.parcel-list { list-style: none; padding: 0; margin: 0; }
.parcel-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.parcel-list li:last-child { border-bottom: 0; }
.parcel-list button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.ref-search summary { cursor: pointer; color: var(--muted); font-size: .84rem; margin-top: 8px; }

/* Formulaires */
.form { display: grid; gap: 10px; }
.form label, .row3 label, .dialog label { display: grid; gap: 4px; font-size: .84rem; font-weight: 600; }
.form label small { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea, .row3 input, .dialog input, .dialog textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.form .check input { width: auto; margin-top: 3px; }
.form fieldset { border: 0; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; }
.form legend { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.unit { display: flex; align-items: center; gap: 6px; }
.unit input { flex: 1; }
.unit span { color: var(--muted); font-size: .82rem; font-weight: 400; }
.openings { display: grid; gap: 6px; }
.opening-row { display: grid; grid-template-columns: 1.1fr 1.1fr .7fr .7fr .5fr auto; gap: 4px; align-items: center; }
.opening-row select, .opening-row input { padding: 6px 6px; font-size: .82rem; }
.opening-row button { border: 0; background: none; cursor: pointer; color: var(--muted); }

/* Résultat en direct et qualification */
.live { position: sticky; top: -22px; z-index: 3; background: var(--panel); padding: 6px 0; }
.regime-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.regime-chip b { font-size: 1.05rem; }
.regime-chip.DP { background: var(--info-soft); border-color: #b9dcef; }
.regime-chip.PC { background: var(--warn-soft); border-color: #ffc9c0; }
.regime-chip.aucune { background: var(--bg); border-color: var(--line); }
.regime-card { border-radius: var(--radius); padding: 16px; margin: 12px 0; border: 1px solid var(--line); }
.regime-card.DP { background: var(--info-soft); }
.regime-card.PC { background: var(--warn-soft); }
.regime-card.aucune { background: var(--bg); }
.regime-card h2 { font-size: 1.2rem; }
.regime-card .meta { color: var(--muted); font-size: .85rem; }
.reasons { margin: 8px 0 0; padding-left: 18px; font-size: .88rem; }
.callout { border-radius: 10px; padding: 12px 14px; margin: 10px 0; font-size: .9rem; }
.callout.warn { background: var(--warn-soft); }
.callout.bad { background: var(--bad-soft); }
.callout.info { background: var(--info-soft); }
.callout.archi { background: var(--ink); color: #fff; }
.callout.archi .primary { background: #fff; color: var(--ink); margin-top: 8px; }
.callout.archi .primary:hover { background: var(--red); color: #fff; }
.checks, .pieces { list-style: none; padding: 0; margin: 0; }
.checks li, .pieces li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.checks li:last-child, .pieces li:last-child { border-bottom: 0; }
.checks details { color: var(--muted); font-size: .8rem; }
.checks blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--line); background: var(--bg); white-space: pre-wrap; }
.pieces .code { font-weight: 800; font-size: .82rem; min-width: 64px; }
.pieces .who { margin-top: 2px; }
.distances { list-style: none; padding: 0; margin: 6px 0 0; font-size: .84rem; display: grid; gap: 2px; }
.distances li { display: flex; justify-content: space-between; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; margin: 6px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* Photos et photomontage */
.photo-slot { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; }
.photo-thumb { width: 112px; height: 84px; border-radius: 8px; background: var(--bg) center/cover no-repeat; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--muted); font-size: .74rem; text-align: center; }
.panoramax-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.panoramax-grid button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg); position: relative; }
.panoramax-grid button:hover { border-color: var(--blue); }
.panoramax-grid img { width: 100%; height: 70px; object-fit: cover; display: block; }
.panoramax-grid small { position: absolute; left: 4px; bottom: 3px; background: rgba(0,0,0,.6); color: #fff; font-size: .66rem; padding: 0 4px; border-radius: 4px; }
.montage { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg); touch-action: none; }
.montage canvas { width: 100%; height: auto; display: block; cursor: grab; }

/* Dossier */
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 10px 0 4px; }
.progress div { height: 100%; background: var(--blue); width: 0; transition: width .4s; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.files a { font-weight: 600; text-decoration: none; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.downloads a { text-decoration: none; }

/* Carte */
.map-tools { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; }
.chip { padding: 6px 12px; background: #fff; border-color: var(--line); font-size: .82rem; box-shadow: var(--shadow); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.map-status { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(27,28,25,.86); color: #fff;
  padding: 7px 14px; border-radius: 999px; font-size: .84rem; z-index: 2; }
.map-legend { position: absolute; right: 12px; bottom: 30px; background: rgba(255,255,255,.95); border-radius: 10px; padding: 8px 10px;
  font-size: .76rem; box-shadow: var(--shadow); z-index: 2; display: grid; gap: 3px; }
.map-legend i { display: inline-block; width: 14px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.dist-label { background: #fff; border: 1px solid #000; color: #000; font: 700 11px/1 var(--font); padding: 3px 5px; border-radius: 5px;
  white-space: nowrap; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.photo-marker { background: var(--ink); color: #fff; font: 700 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 10px; z-index: 50; box-shadow: var(--shadow); max-width: min(92vw, 560px); font-size: .9rem; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(92vw, 480px); }
dialog::backdrop { background: rgba(27,28,25,.45); }
.dialog { padding: 20px; display: grid; gap: 10px; }

.sv-dialog { width: min(96vw, 1100px); }
.g3d-offscreen { position: fixed; left: -12000px; top: 0; width: 1500px; height: 1000px; }
.g3d-view { width: 100%; height: 100%; }
.g3d-view .cesium-widget-credits { font-size: 10px; }
.gallery .shot { margin: 0 0 16px; }
.gallery .shot img { width: 100%; display: block; border: 1px solid var(--ink); background: var(--bg); }
.gallery figcaption { padding: 8px 0 0; font-size: .88rem; }
.gallery .download-all { display: block; text-align: center; text-decoration: none; padding: 14px; margin: 6px 0 8px; }
.ins-view { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.ins-view:first-child { border-top: 0; padding-top: 4px; }
.ins-view img { width: 100%; border-radius: 8px; display: block; margin: 6px 0; background: var(--bg); }
.ins-view .ins-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sv-pano { width: 100%; height: min(62vh, 620px); border-radius: 10px; overflow: hidden; background: var(--bg); }

/* Vue de droite de l'étape Dossier : plan ou 3D en orbite */
.viewport3d { position: absolute; inset: 0; z-index: 3; background: #dfe3e6; }
.viewport3d .g3d-view { width: 100%; height: 100%; }
.vp-tools { z-index: 4; }

/* Compte et paiement */
.checkout-dialog { width: min(94vw, 520px); }
.order { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 12px 0; }
.order .price { font-size: 1.8rem; font-weight: 300; color: var(--blue); white-space: nowrap; }
.order-incl { margin: 0; padding-left: 18px; font-size: .86rem; color: var(--muted); }
.download-one { display: block; width: 100%; text-align: center; text-decoration: none; padding: 16px; }
/* Pied de page de Mon espace : informations légales */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 16px 28px; font-size: .8rem; color: var(--muted); }
.site-foot nav { max-width: 1088px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.dialog label.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; font-weight: 400; line-height: 1.45; cursor: pointer; }
.consent input { margin-top: 3px; flex: none; width: 16px; height: 16px; accent-color: var(--blue); }
.ghost.download-one { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; border-color: var(--ink); color: var(--ink); }
.downloads-hint { margin: -4px 0 12px; text-align: center; }
.top-actions { display: flex; gap: 6px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #000; }
.auth-tabs button { border: 0; background: #fff; padding: 10px; cursor: pointer; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 600; }
.auth-tabs button.active { background: #000; color: #fff; }
.pay-box { border: 1px solid #000; padding: 16px; margin: 12px 0; display: grid; gap: 8px; }
.pay-box .price { font-size: 2rem; font-weight: 300; color: var(--blue); }
.pay-box .primary { padding: 14px; font-size: .82rem; }
.paid-badge { color: var(--blue); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; }

/* Présentation du projet : vue 3D en orbite + récapitulatif */
dialog.show { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; border-radius: 0; padding: 0;
  background: #fff; overflow: hidden; }
dialog.show::backdrop { background: #fff; }
.show-close { position: fixed; top: 16px; right: 20px; z-index: 5; border: 1px solid #000; background: #fff; width: 40px; height: 40px;
  font-size: 1rem; cursor: pointer; }
.show-grid { display: grid; grid-template-columns: 1fr minmax(320px, 400px); height: 100%; }
.show-3d { position: relative; background: #dfe3e6; display: grid; place-items: center; overflow: hidden; border-right: 1px solid #000; }
.show-3d .g3d-view { position: absolute; inset: 0; width: 100%; height: 100%; }
.show-3d > .show-still { width: 100%; height: 100%; object-fit: cover; }
.show-recap { padding: 40px 28px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; animation: fade .6s ease both; }
.show-recap h1 { font-size: 1.9rem; font-weight: 400; margin: 2px 0; }
.show-logo { width: 200px; margin-bottom: 22px; }
.show-addr { color: var(--muted); margin: 0 0 14px; }
.show-kv { display: grid; grid-template-columns: minmax(0, 45%) minmax(0, 1fr); gap: 0; margin: 4px 0 14px; border-top: 1px solid #000; font-size: .9rem; }
/* Libellé et valeur s'étirent sur toute la hauteur de la ligne : leurs traits du bas restent alignés. */
.show-kv dt, .show-kv dd { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; display: flex; align-items: center; }
.show-kv dt { color: var(--muted); padding-right: 14px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.show-kv dd { font-weight: 500; }
.show-dl { text-align: center; text-decoration: none; padding: 16px; margin-top: 6px; }
.show-foot { margin-top: auto; padding-top: 16px; }
@keyframes fade { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
/* Attributions de la visionneuse 3D : logo Cesium ion masqué, mention Google conservée et discrète. */
.cesium-credit-logoContainer { display: none !important; }
.cesium-widget-credits { font-size: 10px !important; opacity: .85; }
.cesium-credit-textContainer img { max-height: 16px !important; width: auto !important; }

@media (max-width: 900px) {
  .show-grid { grid-template-columns: 1fr; grid-template-rows: 55vh auto; overflow-y: auto; }
  dialog.show { overflow-y: auto; }
  .show-3d { border-right: 0; border-bottom: 1px solid #000; }
  /* La carte prend la place libre : le panneau et ses boutons descendent en bas de l'écran. La carte reste en place
     pendant le défilement et le panneau glisse par-dessus : on le pousse vers le haut pour la masquer. */
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(42vh, 1fr) auto; height: auto; min-height: calc(100% - 64px); }
  .mapwrap { order: -1; position: sticky; top: 0; z-index: 0; }
  /* La page défile, pas le panneau. La colonne reste à la largeur de l'écran : sans cela, le diaporama des pièces
     (toutes les vignettes côte à côte) l'élargissait et le téléphone affichait la page dézoomée, comme sur ordinateur. */
  .panel { border-right: 0; padding: 16px 16px 20px; overflow: visible; position: relative; z-index: 1;
    box-shadow: 0 -10px 24px rgba(0,0,0,.08); }
  .panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #d6d6d6; margin: -6px auto 12px; }
  .search-results { top: auto; bottom: calc(100% + 4px); }   /* au-dessus du champ, le clavier occupe le bas */
  .topbar { gap: 10px; }
  .brand small { display: none; }
  .stepper button span { display: none; }
  .type-grid { grid-template-columns: 1fr; }
  .live { top: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Remarques de l'écran final */
.remarks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .88rem; }
.remarks li { padding-left: 22px; position: relative; line-height: 1.45; }
.remarks li::before { position: absolute; left: 0; top: 0; width: 16px; text-align: center; font-weight: 700; }
.remarks li.info::before { content: "i"; color: var(--blue); }
.remarks li.ok::before { content: "✓"; color: var(--blue); }
.remarks li.warn::before { content: "!"; color: var(--red); }
.remarks li.archi::before { content: "→"; color: var(--red); }
.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; font: inherit; cursor: pointer; }

/* Modèles prêts à l'emploi (étape Implantation) */
.presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 14px; }
.preset { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius); padding: 8px 10px 10px; cursor: pointer; font: inherit; color: inherit; }
.preset:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.preset.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--accent-soft); }
.preset svg { width: 100%; height: auto; display: block; margin-bottom: 4px; }
.preset b { font-size: .9rem; line-height: 1.25; }
.preset small { color: var(--muted); font-size: .77rem; line-height: 1.3; }
.preset .dims { color: var(--blue); font-size: .75rem; font-weight: 600; margin-top: 2px; }
.place-tools { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.place-tools input[type=range] { flex: 1; }
.dims-row { margin-top: 8px; }
details.more { padding: 0; }
details.more summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; }
details.more summary::after { content: "+"; float: right; color: var(--blue); }
details.more[open] summary::after { content: "−"; }
details.more .form { padding: 0 14px 14px; }

/* Préparation du dossier : phrases d'attente, puis arrivée des pièces une à une */
@keyframes pieceIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wait-line { display: block; min-height: 1.5em; }
.wait-line.in { animation: pieceIn .45s ease; }
.files.reveal li, .reveal-late { opacity: 0; animation: pieceIn .45s ease forwards; }

/* Terrain analysé : seul l'encart « Votre terrain » reste affiché */
.step.analysed > .search, .step.analysed > #parcelHint, .step.analysed > #parcelCard, .step.analysed > .reassure, .step.analysed > .actions { display: none; }

/* Numéros de parcelle au centre des parcelles */
.parcel-num { font: 700 11px/1 var(--font); color: #000; background: #fff; border: 1px solid #000; border-radius: 9px;
  padding: 2px 6px; pointer-events: none; }

/* Poignées du projet sur le plan */
.h-corner { width: 12px; height: 12px; background: #fff; border: 2px solid var(--blue); cursor: nwse-resize; }
.h-rot { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--blue), 0 2px 6px rgba(0,0,0,.3); cursor: grab; display: grid; place-items: center; }
.h-rot svg { display: block; }
.h-rot:active { cursor: grabbing; }
.h-area { background: rgba(255,255,255,.92); border: 1px solid var(--blue); padding: 3px 6px; text-align: center;
  font: 600 12px/1.15 var(--font); color: #000; white-space: nowrap; }
.h-area small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); }

/* Aperçu des pièces (vignettes des PDF) en diaporama : la page occupe toute la largeur, points posés dessus */
.preview { position: relative; overflow: hidden; border: 1px solid var(--line); background: #fff; margin: 4px 0 12px; }
.pv-track { display: flex; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.pv-slide { flex: 0 0 100%; min-width: 0; margin: 0; position: relative; overflow: hidden; }
.pv-slide img { display: block; width: 100%; aspect-ratio: 1.414; object-fit: cover; object-position: top; background: #fff; }
.pv-slide figcaption { padding: 7px 10px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-slide figcaption b { color: var(--ink); margin-right: 6px; }
.pv-nav { position: absolute; top: calc((100% - 32px) / 2 - 14px); width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); font: 700 18px/1 var(--font); cursor: pointer; display: grid; place-items: center; padding: 0 0 2px; }
.pv-nav.prev { left: 8px; } .pv-nav.next { right: 8px; }
.pv-dots { position: absolute; bottom: 42px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; padding: 5px 8px;
  border-radius: 999px; background: rgba(255,255,255,.88); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c4c7c9; cursor: pointer; transition: width .3s, background .3s; }
.pv-dots i.on { width: 16px; border-radius: 3px; background: var(--blue); }

/* Faisabilité de chaque type de projet d'après le PLU */
.type-card .feas { display: block; font-style: normal; font-size: .74rem; line-height: 1.3; margin-top: 6px; color: var(--muted); }
.type-card .feas b { font-weight: 700; }
.type-card.feas-ok .feas b { color: var(--blue); }
.type-card.feas-warn .feas b { color: #b5400f; }
.type-card.feas-no { opacity: .62; }
.type-card.feas-no .feas b { color: var(--red); }
.pv-slide.portrait img { object-fit: contain; background: #eceeef; }
.placement-more { padding: 0 14px 6px; }
.placement-more .dims-row { margin-top: 0; }

/* Navigation entre écrans : flèche retour et flèche suivant */
.step .actions > .ghost, .step .actions > .primary { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.step .actions > .ghost::before { content: "←"; display: inline-block; margin-right: 8px; transition: transform .2s; }
.step .actions > .ghost:hover::before { transform: translateX(-3px); }
.step .actions > .primary::after { content: "→"; display: inline-block; margin-left: 10px; transition: transform .2s; }
.step .actions > .primary:hover::after { transform: translateX(3px); }
.step[data-step="terrain"]:not([hidden]) { display: flex; flex-direction: column; min-height: 100%; }
.reassure.bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.step[data-step="terrain"] #analysisBox { margin-bottom: 28px; }
@media (max-width: 900px) {
  /* Sur smartphone, l'étape terrain s'en tient à la carte, à la recherche et aux boutons : ni croquis ni texte du bas */
  .step[data-step="terrain"] .search-anim, .step[data-step="terrain"] .reassure.bottom { display: none; }
  .step[data-step="terrain"] #analysisBox:empty { display: none; }
  .step .actions > .ghost { flex: none; white-space: nowrap; }   /* « ← Accueil » sur une ligne, à côté du bouton principal */
}

/* Bouton « Me localiser » dans le champ d'adresse */
.search input { padding-right: 132px; }
.geo-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: var(--accent-soft); color: var(--blue); font: 600 .78rem/1 var(--font); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.geo-btn:hover { background: #d6ebf6; }
.geo-btn.busy svg { animation: geoPulse 1s ease-in-out infinite; }
@keyframes geoPulse { 50% { transform: scale(.75); opacity: .5; } }

/* Coordonnées obligatoires : champ à compléter signalé en rouge */
#applicantForm label.invalid { color: var(--red); }
#applicantForm label.invalid input { border-color: var(--red); background: #fff6f5; }

/* Poignées au milieu des côtés : déplacer une arête */
.h-edge { width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.h-edge.ew { cursor: ew-resize; }
.h-edge.ns { cursor: ns-resize; }
.h-edge:hover, .h-corner:hover { background: var(--blue); }
.h-front { color: var(--blue); cursor: default; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.addr-pin { filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); cursor: default; }

/* Étape Télécharger en vue plan : le choix Cadastre / Photo aérienne passe sous Plan / 3D / Plein écran */
#baseTools.below-vp { top: 54px; }

/* Préparation du dossier : croquis au trait (existant noir, démolition en tirets rouges, projet bleu) */
.gen-sketch { margin: 34px auto 0; max-width: 300px; text-align: center; }
.gen-art .sk { display: block; width: 100%; height: auto; overflow: visible; }
.gen-art .sk * { fill: none; stroke-width: 1.25; }
.gen-art .sk .e { stroke: #000; }
.gen-art .sk .p { stroke: var(--blue); }
.gen-art .sk .d { stroke: var(--red); stroke-dasharray: 4 3; opacity: 0; }
.gen-art .sk .e, .gen-art .sk .p { stroke-dasharray: 1; stroke-dashoffset: 1; }
.gen-art.in .sk .e { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.6,.1,.2,1); }
.gen-art.in .sk .d { opacity: 1; transition: opacity .6s ease .9s; }
.gen-art.in .sk .p { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.6,.1,.2,1) 1.3s; }
.gen-sketch figcaption { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: .74rem; color: var(--muted); }
.gen-sketch .lg::before { content: ""; display: inline-block; width: 20px; vertical-align: middle; margin-right: 6px; border-top: 2px solid #000; }
.gen-sketch .lg.d::before { border-top: 2px dashed var(--red); }
.gen-sketch .lg.p::before { border-top-color: var(--blue); }
@media (prefers-reduced-motion: reduce) { .gen-art .sk .e, .gen-art .sk .p { stroke-dashoffset: 0; transition: none !important; } }

/* Chargement du cadastre : une parcelle dont les traits se dessinent en boucle */
.map-loading { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 999px; padding: 7px 14px 7px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.15); font-size: .8rem; pointer-events: none; }
.map-loading .ml { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: mlDraw 1.6s ease-in-out infinite; }
.map-loading .ml.b { stroke: #000; animation-delay: .3s; }
@keyframes mlDraw { 0% { stroke-dashoffset: 1; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }

/* Préparation du dossier : le croquis animé au centre vertical de l'espace sous la carte de progression */
.step[data-step="dossier"]:not([hidden]) { display: flex; flex-direction: column; min-height: 100%; }
.step[data-step="dossier"] #dossierBox { flex: 1; display: flex; flex-direction: column; }
#dossierBox .gen-sketch { margin: auto; }

/* Vérification des coordonnées (compte connecté ou coordonnées complètes) */
#applicantSummary { display: grid; gap: 12px; justify-items: start; }
.check-list { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 16px; margin: 0; font-size: .92rem; width: 100%; }
.check-list dt { color: var(--muted); }
.check-list dd { margin: 0; overflow-wrap: anywhere; }
#emailNotice { display: grid; gap: 8px; justify-items: start; margin-top: 12px; }
#emailNotice p { margin: 0; }
@media (max-width: 1100px) { .brand small.wide-only { display: none; } }   /* les étapes gardent leur place */
@media (max-width: 560px) { .topbar { padding: 0 16px; } }
@media (max-width: 520px) { .check-list { grid-template-columns: 1fr; gap: 0 0; } .check-list dd { margin-bottom: 8px; } }

/* Étape terrain, avant la recherche : même croquis au trait que pendant la préparation du dossier. Le plan cadastral se
   dessine ; la loupe le parcourt en le grossissant, puis s'arrête sur votre parcelle, qui se dessine en bleu. */
.search-anim { flex: 1; display: flex; align-items: center; justify-content: center; margin: 20px 0; min-height: 170px; }
.search-anim .gen-sketch { margin: 0 auto; width: 100%; }
.gen-art .sk .thin { stroke-width: .7; }
.gen-art .sk .hair { stroke-width: .45; }
.gen-art .sk .ax { stroke: #000; stroke-width: .5; stroke-dasharray: 5 1.6 1 1.6; }
.gen-art .sk .m { stroke: #000; stroke-width: .55; }
.gen-art .sk .m.ax { stroke-width: .35; stroke-dasharray: 3.5 1.1 .7 1.1; }
.gen-art .sk .lens .p { stroke-width: .9; }
.gen-art .sk .disc { fill: #fff; }
.gen-art .sk .bar { stroke-width: 2.4; }   /* la loupe : un cercle et une barre */
.gen-art .sk .lens { opacity: 0; transform: translate(30px, 32px); }
.gen-art .sk .mgm { transform: scale(1.4) translate(-30px, -32px); }
.gen-art.in .sk .lens { opacity: 1; transition: opacity .7s ease .4s; animation: tsLens 3.8s cubic-bezier(.5,.1,.3,1) 1.4s both; }
.gen-art.in .sk .mgm { animation: tsMag 3.8s cubic-bezier(.5,.1,.3,1) 1.4s both; }
.gen-art.in .sk .p.late { transition-delay: 5.2s; }
@keyframes tsLens {
  0% { transform: translate(30px, 32px); }
  30%, 38% { transform: translate(62px, 72px); }
  62%, 70% { transform: translate(86px, 34px); }
  100% { transform: translate(120.49px, 55.28px); }
}
@keyframes tsMag {
  0% { transform: scale(1.4) translate(-30px, -32px); }
  30%, 38% { transform: scale(1.4) translate(-62px, -72px); }
  62%, 70% { transform: scale(1.4) translate(-86px, -34px); }
  100% { transform: scale(1.4) translate(-120.49px, -55.28px); }
}
@media (prefers-reduced-motion: reduce) {
  .gen-art .sk .lens, .gen-art.in .sk .lens { animation: none; opacity: 1; transform: translate(120.49px, 55.28px); }
  .gen-art .sk .mgm, .gen-art.in .sk .mgm { animation: none; transform: scale(1.4) translate(-120.49px, -55.28px); }
}

/* Coordonnées : identité du demandeur, coordonnées du demandeur et adresse du projet bien séparées */
.ap-group { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; display: grid; gap: 10px; }
.ap-group + .ap-group { border-top: 1px solid var(--line); padding-top: 16px; }
.ap-group legend, .ap-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: var(--muted);
  margin: 0; padding: 0; }
.ap-group legend { float: left; width: 100%; margin-bottom: 4px; }
.ap-project { margin: 0; }
#applicantSummary .ap-title { margin: 4px 0 -4px; }
#applicantSummary .ap-title ~ .ap-title { border-top: 1px solid var(--line); padding-top: 12px; width: 100%; }

/* Offre de lancement : prix habituel barré au paiement */
#coPrice s, .launch-note s { color: #9a9a9a; font-weight: 400; }
#coPrice .co-launch { display: block; margin-top: 4px; font-size: .74rem; font-weight: 600; color: var(--red); letter-spacing: .02em; }
.launch-note { margin: 8px 0 0; text-align: center; font-size: .82rem; color: var(--red); font-weight: 600; }
