:root {
  --noir: #000000;
  --fond-2: #0E0E0E;
  --surface: #141414;
  --surface-2: #1B1B1B;
  --bord: #2E2E2E;
  --bord-doux: #1F1F1F;
  --blanc: #FFFFFF;
  --texte-2: #C9C9C9;
  --texte-3: #B5B5B5;
  --orange: #F08F05;
  --orange-clair: #FFB547;
  --gris-mur: #8C8C8C;
  --gris-mitoyen: #4A4A4A;
  --rayon: 14px;
  --police: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--noir); color: var(--blanc); font-family: var(--police); font-size: 16px; line-height: 1.5; }
a { color: var(--orange); }
a:hover { color: var(--orange-clair); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.conteneur { max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.orange { color: var(--orange); }
.mono { font-family: var(--mono); }
.petit { font-size: 14px; color: var(--texte-3); margin: 0 0 12px; }
.surtitre { font-family: var(--mono); font-size: 13px; letter-spacing: 0.14em; color: var(--orange); }

/* ---------- En-tête ---------- */
.entete { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; }
.logo { height: 52px; width: auto; display: block; }
.nav { display: flex; flex-wrap: wrap; gap: 28px; font-weight: 500; }
.nav a { color: var(--blanc); text-decoration: none; }
.nav a:hover { color: var(--orange); }
.nav a.accent { color: var(--orange); }

/* ---------- Accueil ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 88px; }
.hero-texte { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { margin: 0; font-size: clamp(40px, 6vw, 66px); line-height: 1; font-weight: 800; letter-spacing: -0.01em; }
.chapo { margin: 0; font-size: 19px; color: var(--texte-2); max-width: 520px; }
.hero-visuel { flex: 1 1 380px; min-width: 0; display: flex; justify-content: center; }
.hero-visuel svg { width: 100%; max-width: 440px; height: auto; }
.onde { fill: none; stroke: var(--orange); stroke-width: 2; }
.o1 { stroke-opacity: .12 } .o2 { stroke-opacity: .22 } .o3 { stroke-opacity: .35 } .o4 { stroke-opacity: .55 }
.balayage { transform-origin: 220px 220px; animation: balayage 6s linear infinite; }
@keyframes balayage { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .balayage { animation: none; } html { scroll-behavior: auto; } }
.mono-svg { fill: var(--orange); font-family: var(--mono); font-size: 12px; }

/* ---------- Formulaires ---------- */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 22px; }
.form-adresse { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.champ { display: flex; flex-direction: column; gap: 6px; position: relative; margin-bottom: 12px; }
.form-adresse .champ { margin-bottom: 0; }
.champ-adresse { flex: 3 1 260px; }
.champ-etage { flex: 1 1 150px; }
label { font-size: 13px; color: var(--texte-3); }
input[type=text], input[type=number], select {
  height: 50px; border-radius: 10px; border: 1px solid #3A3A3A; background: var(--noir); color: var(--blanc);
  padding: 0 14px; font: inherit; font-size: 16px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 1000; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface-2); border: 1px solid var(--bord); border-radius: 10px; max-height: 260px; overflow-y: auto; }
.suggestions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.suggestions li[aria-selected=true], .suggestions li:hover { background: #2A2A2A; color: var(--orange); }

.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px; border-radius: 10px;
  font: inherit; font-weight: 800; letter-spacing: 0.02em; text-decoration: none; cursor: pointer; border: 0; }
.bouton-principal { background: var(--orange); color: var(--noir); }
.bouton-principal:hover { background: var(--orange-clair); color: var(--noir); }
.bouton-principal:disabled { opacity: .6; cursor: wait; }
.form-adresse .bouton { flex: 1 1 210px; }
.bouton-contour { background: transparent; border: 2px solid var(--orange); color: var(--orange); border-radius: 999px; }
.bouton-contour:hover { background: var(--orange); color: var(--noir); }
.bouton-large { width: 100%; }
.lien-bouton { background: none; border: 0; color: var(--orange); font: inherit; text-decoration: underline; cursor: pointer; padding: 8px 0; min-height: 44px; }
.message { width: 100%; margin: 8px 0 0; color: var(--orange-clair); }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--blanc); margin: 0 0 14px; cursor: pointer; }
.case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--orange); }
.rangee { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin-bottom: 12px; }

/* ---------- Outil ---------- */
.outil { background: var(--fond-2); border-top: 1px solid var(--bord-doux); border-bottom: 1px solid var(--bord-doux); padding: 56px 0 72px; }
.outil-entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin-bottom: 24px; }
.outil-entete .surtitre { width: 100%; }
.outil-entete h2 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; }
.outil-grille { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.carte-carte { flex: 1 1 480px; min-width: 0; padding: 12px; position: sticky; top: 16px; }
.carte-leaflet { height: 520px; border-radius: 10px; background: #111; }
.legende-carte { font-size: 13px; color: var(--texte-3); margin: 10px 4px 2px; }
.pastille { display: inline-block; width: 22px; height: 6px; border-radius: 3px; margin: 0 6px 2px 10px; vertical-align: middle; }
.pastille:first-child { margin-left: 0; }
.p-fenetre { background: var(--orange); } .p-mur { background: var(--blanc); } .p-hors { background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 8px); }
.p-mitoyen { background: var(--gris-mitoyen); }
.etapes { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.etape h3 { margin: 0 0 12px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: var(--noir); align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.groupe { border: 1px solid var(--bord); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.groupe.actif { border-color: var(--orange); }
.groupe h4 { margin: 0 0 4px; font-size: 16px; }
.facade { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--bord-doux); }
.facade:first-of-type { border-top: 0; }
.facade-nom { flex: 1 1 140px; font-weight: 500; }
.facade-nom small { color: var(--texte-3); font-family: var(--mono); font-weight: 400; }
.choix { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.choix legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.choix label { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--bord); border-radius: 999px; color: var(--texte-2); font-size: 14px; cursor: pointer; }
.choix input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix input:checked + span { color: var(--noir); }
.choix label:has(input:checked) { background: var(--orange); border-color: var(--orange); color: var(--noir); font-weight: 700; }
.choix label:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.mitoyenne { color: var(--texte-3); font-size: 14px; }
.ligne-niveau { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ligne-niveau .champ { flex: 1 1 160px; }

/* ---------- Résultats ---------- */
.resultats { margin-top: 40px; display: flex; flex-direction: column; gap: 20px; }
.resultats h3 { margin: 0 0 8px; font-size: 20px; }
.rapport-entete { display: none; }
.synthese { display: flex; flex-wrap: wrap; gap: 20px; }
.synthese > .carte { flex: 1 1 340px; }
.synthese p { margin: 6px 0; }
.grand-chiffre { font-family: var(--mono); font-size: 56px; color: var(--orange); line-height: 1.1; margin: 8px 0; }
.grand-chiffre small { font-size: 20px; color: var(--texte-2); }
.tableau-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--texte-3); font-weight: 500; padding: 10px 8px; white-space: nowrap; }
td { padding: 10px 8px; border-top: 1px solid #2A2A2A; font-family: var(--mono); vertical-align: top; }
td.lib { font-family: var(--police); white-space: nowrap; }
td .fourchette { display: block; font-size: 12px; color: var(--texte-3); }
td.max { color: var(--orange); font-weight: 600; }
.methodo p { color: var(--texte-2); }
.actions { margin-top: 4px; }
.etiquette-facade { background: var(--noir); color: var(--blanc); border: 2px solid var(--orange); border-radius: 6px; padding: 2px 6px;
  font: 700 11px var(--police); white-space: nowrap; }
.etiquette-facade.nul { border-color: var(--gris-mur); }

/* ---------- Contenu ---------- */
.bande { background: var(--fond-2); border-top: 1px solid var(--bord-doux); border-bottom: 1px solid var(--bord-doux); padding: 80px 0; }
.bande h2, .soutenir h2 { margin: 0 0 32px; font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.grille-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.carte-sombre { background: #161616; border: 1px solid #2A2A2A; border-radius: var(--rayon); padding: 28px; }
.carte-sombre h3 { margin: 8px 0; font-size: 22px; }
.carte-sombre p { margin: 0; color: var(--texte-2); }
.numero { font-family: var(--mono); font-size: 40px; color: var(--orange); }
.reperes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; padding-top: 80px; padding-bottom: 80px; }
.reperes > div { display: flex; flex-direction: column; gap: 8px; color: var(--texte-2); }
.chiffre { font-family: var(--mono); font-size: 44px; color: var(--orange); }
.soutenir { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.soutenir > div { flex: 1 1 420px; }
.soutenir h2 { margin-bottom: 10px; font-size: 32px; }
.soutenir p { margin: 0; color: var(--texte-2); }

.pied { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; padding-top: 32px; padding-bottom: 32px; font-size: 13px; color: var(--texte-3); }
.pied > span:nth-child(2) { flex: 1 1 360px; }
.logo-pied { height: 32px; width: auto; display: block; }
.liens-pied { display: flex; gap: 20px; flex-wrap: wrap; }

/* Leaflet sur fond sombre */
.leaflet-container { font-family: var(--police); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-2); color: var(--blanc); }
.leaflet-popup-content { font-size: 13px; }

@media (max-width: 720px) {
  .conteneur { padding-left: 18px; padding-right: 18px; }
  .carte-carte { position: static; }
  .carte-leaflet { height: 380px; }
  .grand-chiffre { font-size: 44px; }
}

/* ---------- Impression / PDF ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .entete, .hero, .bande, .reperes, .pied, .etapes, .outil-entete, .actions, .legende-carte { display: none !important; }
  .outil { background: #fff; border: 0; padding: 0; }
  .outil-grille { display: block; order: 2; }
  .outil > .conteneur { display: flex; flex-direction: column; }
  .resultats { order: 1; margin-top: 0; }
  .carte-carte { position: static; border: 0; padding: 0; margin-bottom: 10mm; }
  .carte-leaflet { height: 90mm; }
  .carte, .carte-sombre { background: #fff; border: 1px solid #bbb; color: #000; break-inside: avoid; }
  .rapport-entete { display: flex; gap: 16px; align-items: center; background: #000; color: #fff; padding: 10px 14px; border-radius: 8px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .logo-rapport { height: 34px; }
  .petit, th, td .fourchette, .methodo p, .grand-chiffre small { color: #333; }
  td { border-color: #ccc; }
  .grand-chiffre, td.max, .surtitre { color: #B85F00; }
  a { color: #000; }
  .leaflet-control-container { display: none; }
}
