:root {
  --bg: #f4f9ff;
  --bg-soft: #eaf5ff;
  --card: #ffffff;
  --text: #07376a;
  --text-deep: #052c55;
  --muted: #61758c;
  --blue: #078bea;
  --blue-dark: #006ed0;
  --blue-deep: #064174;
  --teal: #18c6bc;
  --teal-dark: #09aaa1;
  --border: #d8e8f6;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(5, 65, 116, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(24,198,188,.14), transparent 34%),
    linear-gradient(180deg, #ffffff 0, var(--bg) 420px);
  color: var(--text-deep);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.93);
  border-bottom: 1px solid rgba(216,232,246,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; min-width: 190px; }
.brand-logo { display: block; width: 190px; height: auto; }
.header-copy { text-align: right; line-height: 1.2; }
.header-copy strong { display: block; color: var(--blue-deep); font-size: 1rem; }
.header-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: .9rem; }

.hero { padding: 72px 0 50px; text-align: center; }
.eyebrow {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 7px 12px;
  border: 1px solid rgba(7,139,234,.18);
  border-radius: 999px;
  background: rgba(7,139,234,.07);
  color: var(--blue-dark);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .13em;
}
h1 {
  margin: 0;
  color: var(--blue-deep);
  font-size: clamp(2.35rem, 6.5vw, 4.35rem);
  line-height: .98;
  letter-spacing: -.04em;
}
.lead {
  margin: 20px auto 30px;
  max-width: 650px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
}
.counter {
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 auto 28px;
  padding: 14px 22px;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(5,65,116,.06);
}
.counter strong { color: var(--teal-dark); font-size: 2.25rem; line-height: 1; }
.counter span { color: var(--muted); }

.request-card {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 30px;
  text-align: left;
  box-shadow: var(--shadow);
}
.request-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.request-card label { display: block; margin: 15px 0 8px; color: var(--blue-deep); font-weight: 800; }
.request-card input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  color: var(--text-deep);
  padding: 0 15px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.request-card input:focus {
  background: #fff;
  border-color: rgba(7,139,234,.55);
  box-shadow: 0 0 0 4px rgba(7,139,234,.10);
}
.geo-button, .primary-button {
  width: 100%;
  min-height: 55px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.geo-button {
  margin-top: 20px;
  background: linear-gradient(180deg, #eaf9f8, #e5f6f5);
  color: #087f79;
  border: 1px solid rgba(24,198,188,.24);
}
.primary-button {
  margin-top: 13px;
  background: linear-gradient(135deg, var(--blue) 0%, #087fe1 52%, var(--teal) 140%);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 11px 24px rgba(7,139,234,.24);
}
.geo-button:hover, .primary-button:hover { transform: translateY(-1px); }
.primary-button:hover { background: linear-gradient(135deg, var(--blue-dark), var(--blue), var(--teal)); }
.privacy-note, .geo-status { margin: 11px 2px 0; color: var(--muted); font-size: .87rem; line-height: 1.5; }
.notice { margin: 0 0 20px; padding: 13px 15px; border-radius: 12px; text-align: left; border: 1px solid transparent; }
.notice.success { background: #e9fbf6; color: #087268; border-color: #c7efe5; }
.notice.info { background: #edf7ff; color: #075d9d; border-color: #d2e9fb; }
.notice.error { background: #fff0ef; color: var(--danger); border-color: #ffd6d1; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.info-section { padding: 12px 0 70px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-3 article {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 34px rgba(5,65,116,.05);
}
.grid-3 article::after {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  right: -28px;
  bottom: -30px;
  background: rgba(24,198,188,.10);
}
.grid-3 strong { display: block; color: var(--blue-deep); font-size: 1.08rem; }
.grid-3 span { display: block; color: var(--muted); margin-top: 7px; line-height: 1.48; }

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 30px 0;
}
.footer-inner { text-align: center; }
.footer-inner p { margin: 6px auto; }
.small { color: var(--muted); font-size: .88rem; max-width: 800px; }

@media (max-width: 720px) {
  .header-inner { min-height: 72px; }
  .brand { min-width: 0; }
  .brand-logo { width: 156px; }
  .header-copy span { display: none; }
  .header-copy strong { font-size: .86rem; }
  .hero { padding-top: 48px; }
  .grid-3 { grid-template-columns: 1fr; }
  .request-card { padding: 22px; border-radius: 22px; }
  .counter { width: 100%; }
}

@media (max-width: 430px) {
  .header-copy { display: none; }
  .header-inner { justify-content: center; }
  .brand-logo { width: 165px; }
  .hero { padding-top: 38px; }
}

/* --- Carte nationale --- */
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.header-map-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  background: #eef8ff; border: 1px solid rgba(7,139,234,.18);
  color: var(--blue-dark); font-weight: 850; white-space: nowrap;
}
.header-map-link:hover { background: #e4f4ff; }

.map-teaser-section { padding: 15px 0 36px; }
.map-teaser {
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  padding: 30px; border-radius: 24px; border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(7,139,234,.07), rgba(24,198,188,.08));
}
.map-teaser .eyebrow { margin-bottom: 10px; }
.map-teaser h2 { margin: 0; color: var(--blue-deep); font-size: clamp(1.45rem, 3vw, 2.05rem); }
.map-teaser p:not(.eyebrow) { margin: 10px 0 0; max-width: 720px; color: var(--muted); line-height: 1.55; }
.map-cta {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 20px; border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff;
  font-weight: 900; box-shadow: 0 10px 22px rgba(7,139,234,.18);
}

.map-hero { padding: 58px 0 70px; text-align: center; }
.map-hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.8rem); }
.map-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px; align-items: stretch; margin-top: 34px; text-align: left;
}
.map-card {
  position: relative; min-height: 660px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 26px; background: #f7fbfe;
  box-shadow: var(--shadow);
}
.france-map { width: 100%; height: 660px; background: linear-gradient(180deg, #f9fcff, #eef7fb); }
.map-loading {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  z-index: 500; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.94);
  color: var(--muted); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(5,65,116,.08);
}
.map-loading[hidden] { display: none; }
.map-panel {
  display: flex; flex-direction: column; padding: 25px;
  border: 1px solid var(--border); border-radius: 26px; background: #fff;
  box-shadow: 0 14px 38px rgba(5,65,116,.07);
}
.map-panel-kicker { color: var(--muted); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.map-total { margin-top: 11px; color: var(--teal-dark); font-size: 3.05rem; line-height: 1; }
.map-total-label { margin-top: 5px; color: var(--muted); }
.map-selection {
  display: flex; flex-direction: column; gap: 7px; margin-top: 28px; padding: 18px;
  border-radius: 16px; background: var(--bg-soft); border: 1px solid var(--border);
}
.map-selection strong { color: var(--blue-deep); font-size: 1.05rem; }
.map-selection span { color: var(--muted); line-height: 1.48; }
.map-selection b { color: var(--teal-dark); }
.map-legend { display: grid; gap: 9px; margin-top: auto; padding-top: 28px; }
.map-legend span { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .86rem; }
.map-legend i { width: 20px; height: 14px; border-radius: 4px; border: 1px solid rgba(5,65,116,.08); }
.level-0 { background: #e7f1f8; }.level-1 { background: #8de2dc; }.level-2 { background: #25c8bf; }.level-3 { background: #12aeb2; }.level-4 { background: #087f8c; }
.map-method-note { margin: 18px auto 0; max-width: 930px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.wheredoc-tooltip { border: 1px solid var(--border) !important; border-radius: 10px !important; box-shadow: 0 8px 24px rgba(5,65,116,.12) !important; color: var(--text-deep) !important; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; }

@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-panel { min-height: 260px; }
  .map-legend { margin-top: 22px; grid-template-columns: repeat(5, auto); gap: 8px; }
  .map-teaser { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .header-actions { gap: 8px; }
  .header-map-link { min-height: 38px; padding: 0 12px; font-size: .84rem; }
  .map-card, .france-map { min-height: 520px; height: 520px; }
  .map-hero { padding-top: 42px; }
  .map-legend { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 430px) {
  .header-copy { display: none; }
  .header-inner { justify-content: space-between; }
  .brand-logo { width: 148px; }
  .map-card, .france-map { min-height: 460px; height: 460px; }
  .map-teaser { padding: 22px; }
  .map-cta { width: 100%; text-align: center; }
}

/* --- Pages de détail et juridiques --- */
.footer-links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 18px;margin-bottom:14px}.footer-links a{color:var(--blue-dark);font-weight:750;font-size:.9rem}.footer-links a:hover{text-decoration:underline}.content-page{padding:58px 0 72px}.content-page h1{font-size:clamp(2.1rem,5vw,3.65rem)}.content-page h2{margin:34px 0 10px;color:var(--blue-deep);font-size:1.3rem}.legal p{color:var(--muted);line-height:1.72}.legal a{color:var(--blue-dark);text-decoration:underline}.legal code{background:#eef7ff;padding:2px 6px;border-radius:6px}.breadcrumb{margin:20px 0}.breadcrumb a,.detail-link{display:inline-flex;color:var(--blue-dark);font-weight:850}.detail-link{margin-top:12px}.data-card{overflow:hidden;border:1px solid var(--border);border-radius:22px;background:#fff;box-shadow:var(--shadow)}.data-row{display:grid;grid-template-columns:minmax(0,1fr) 130px 120px;gap:14px;align-items:center;padding:16px 20px;border-bottom:1px solid var(--border)}.data-row:last-child{border-bottom:0}.data-row:not(.data-head):hover{background:#f5fbff}.data-head{background:var(--bg-soft);color:var(--muted);font-size:.82rem;font-weight:900;text-transform:uppercase;letter-spacing:.04em}.count-pill{justify-self:start;min-width:42px;text-align:center;padding:6px 10px;border-radius:999px;background:#e8faf8;color:var(--teal-dark);font-weight:900}.empty-state{padding:28px;border:1px solid var(--border);border-radius:20px;background:#fff;color:var(--muted)}.local-stat{display:flex;flex-direction:column;gap:9px;margin:30px 0;padding:28px;border:1px solid var(--border);border-radius:24px;background:#fff;box-shadow:var(--shadow);text-align:center}.local-stat strong{font-size:3.4rem;color:var(--teal-dark);line-height:1}.local-stat span{color:var(--muted);line-height:1.5}
@media(max-width:620px){.data-row{grid-template-columns:minmax(0,1fr) 86px 70px;padding:14px 12px;gap:8px;font-size:.9rem}.data-head{font-size:.7rem}.footer-links{gap:8px 12px}}

/* --- Recherche directe + lightbox de secours --- */
.request-card-simple { text-align: center; }
.main-search-button { margin-top: 0; min-height: 62px; font-size: 1.04rem; }
.main-search-button:disabled { cursor: wait; opacity: .82; transform: none; }
.request-card-simple .privacy-note { max-width: 620px; margin-left: auto; margin-right: auto; }
.request-card-simple .geo-status { min-height: 1.35em; text-align: center; font-weight: 750; color: var(--teal-dark); }

.location-modal[hidden] { display: none; }
.location-modal { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 20px; }
.location-modal-backdrop { position: absolute; inset: 0; background: rgba(3, 28, 52, .58); backdrop-filter: blur(4px); }
.location-modal-dialog {
  position: relative; z-index: 1; width: min(100%, 520px); max-height: calc(100vh - 40px); overflow: auto;
  padding: 32px; border-radius: 24px; background: #fff; border: 1px solid var(--border);
  box-shadow: 0 28px 80px rgba(3, 28, 52, .28); text-align: left;
}
.location-modal-dialog h2 { margin: 5px 42px 8px 0; color: var(--blue-deep); font-size: 1.55rem; }
.location-modal-dialog p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.location-modal-dialog label { display: block; margin: 14px 0 8px; color: var(--blue-deep); font-weight: 800; }
.location-modal-dialog input {
  width: 100%; height: 54px; padding: 0 15px; border: 1px solid var(--border); border-radius: 14px;
  background: #fbfdff; color: var(--text-deep); font-size: 1rem; outline: none;
}
.location-modal-dialog input:focus { background: #fff; border-color: rgba(7,139,234,.55); box-shadow: 0 0 0 4px rgba(7,139,234,.10); }
.location-modal-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: #f6fbff; color: var(--blue-deep); cursor: pointer;
  font-size: 1.8rem; line-height: 1; display: grid; place-items: center;
}
.location-modal-close:hover { background: #eaf6ff; }
.location-modal-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #eaf9f8; font-size: 1.5rem; }
.modal-submit-button { margin-top: 22px; }
body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .location-modal { padding: 12px; }
  .location-modal-dialog { padding: 25px 20px 22px; border-radius: 20px; }
  .main-search-button { min-height: 58px; font-size: .95rem; }
}

/* --- Confirmation de localisation --- */
.location-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.secondary-button { min-height: 54px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--blue-deep); font-weight: 900; cursor: pointer; }
.secondary-button:hover { background: #f2f9ff; }
@media (max-width: 520px) { .location-confirm-actions { grid-template-columns: 1fr; } }
