/* css/sedidiag.css
 * Landing SEDIDIAG — identité propre, même famille que SEDIPEC :
 * navy profond + accents aqua/cyan (eau) + ambre (batardeau).
 * Mobile-first, animations transform/opacity uniquement,
 * tout est neutralisé sous prefers-reduced-motion.
 */

:root {
  --navy: #1A2E4A;
  --navy-deep: #0F1D32;
  --blue: #2978B5;
  --blue-light: #3A8FD4;
  --cyan: #5BC2E7;
  --amber: #F2A33C;
  --green: #00845A;
  --pale: #E9F1FA;
  --txt: #E6EEF8;
  --txt-mid: #C6D4E6;
  --txt-low: #B7C6DA;
  --glass: rgba(255, 255, 255, .055);
  --glass-strong: rgba(255, 255, 255, .09);
  --glass-border: rgba(255, 255, 255, .12);
  --radius: 16px;
  --radius-sm: 14px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--txt);
  background:
    radial-gradient(1100px 600px at 85% -5%, rgba(58, 143, 212, .14), transparent 60%),
    radial-gradient(900px 700px at 10% 35%, rgba(91, 194, 231, .07), transparent 55%),
    linear-gradient(180deg, #0F1D32 0%, #16263E 55%, #0F1D32 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
body.sd-modal-open { overflow: hidden; }

a { color: var(--cyan); }
b { font-weight: 800; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Focus visible explicite sur tous les CTA / liens (le global couvre déjà,
   on force ici contre d'éventuels resets locaux). */
.sd-btn:focus-visible,
.sd-nav-links a:focus-visible,
.sd-chip-barnier:focus-visible,
.sd-fab:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- */
/* Verre + révélation au scroll                                      */
/* ---------------------------------------------------------------- */
.sd-glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.22, .8, .3, 1), transform .7s cubic-bezier(.22, .8, .3, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- */
/* Boutons                                                           */
/* ---------------------------------------------------------------- */
.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  appearance: none;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .1px;
  padding: 15px 26px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
}
.sd-btn:active { transform: translateY(1px); }

.sd-btn-primary {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff;
  box-shadow: 0 8px 28px rgba(58, 143, 212, .38), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.sd-btn-primary:hover {
  background: linear-gradient(135deg, #54A0DD, var(--blue-light));
  box-shadow: 0 12px 36px rgba(58, 143, 212, .5), inset 0 1px 0 rgba(255, 255, 255, .22);
  transform: translateY(-2px);
}

.sd-btn-ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--pale);
  border: 1px solid rgba(255, 255, 255, .22);
}
.sd-btn-ghost:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .4);
  transform: translateY(-2px);
}

.sd-btn-small { font-size: 13.5px; padding: 9px 16px; border-radius: 11px;
  background: linear-gradient(135deg, var(--blue-light), var(--blue)); color: #fff;
  box-shadow: 0 4px 14px rgba(58, 143, 212, .35); }
.sd-btn-small:hover { transform: translateY(-1px); }

/* CTA nav « Tester mon adresse » : masqué tant que le hero est visible.
   La classe .sd-cta-auto est posée par main.js (IntersectionObserver) —
   sans JS / sans IO, le bouton reste visible (dégradation douce). */
.sd-cta-auto {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
}
.sd-cta-auto.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .35s ease, transform .35s ease;
}

/* CTA flottant mobile : apparaît après le premier scroll (même observer) */
.sd-fab { display: none; }
@media (max-width: 719px) {
  .sd-fab {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--blue-light), var(--blue));
    border-radius: 99px;
    padding: 14px 24px;
    box-shadow: 0 10px 30px rgba(8, 16, 30, .55), 0 4px 14px rgba(58, 143, 212, .4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
  }
  .sd-fab.is-shown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity .35s ease, transform .35s ease;
  }
  /* Quand le CTA flottant est visible, le badge démo remonte au-dessus */
  .sd-fab.is-shown ~ .demo-expert-badge {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}
.sd-btn-card { width: 100%; margin-top: auto; }
.sd-btn-xl { font-size: clamp(16px, 2.2vw, 19px); padding: 18px 38px; }

/* ---------------------------------------------------------------- */
/* Nav                                                               */
/* ---------------------------------------------------------------- */
.sd-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background .35s ease, box-shadow .35s ease;
}
.sd-nav.is-scrolled {
  background: rgba(15, 29, 50, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(4, 10, 20, .45);
}
.sd-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 22px;
}
.sd-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .6px;
  color: #fff;
  text-decoration: none;
}
.sd-wordmark b { color: var(--cyan); font-weight: 800; }
.sd-picto { width: 24px; height: 28px; color: #fff; flex: 0 0 auto; }
.sd-nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.sd-nav-links a {
  color: var(--txt-mid);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color .2s ease;
}
.sd-nav-links a:hover { color: #fff; }

/* ---------------------------------------------------------------- */
/* Hero                                                              */
/* ---------------------------------------------------------------- */
.sd-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sd-hero-content {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin: 0 auto;
  /* Le padding-bas RÉSERVE la hauteur de la scène (46vh, min 300px) + une
     marge : le contenu (dont la pastille Barnier) ne peut plus chevaucher
     les bâtiments — sur petit écran le hero s'allonge au lieu d'empiéter. */
  padding: clamp(110px, 17vh, 190px) 22px calc(max(46vh, 300px) + 28px);
  text-align: center;
}
.sd-kicker {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 18px;
}
.sd-headline {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -1.8px;
  color: #fff;
  text-wrap: balance;
}
.sd-headline .aqua {
  background: linear-gradient(100deg, var(--cyan), var(--blue-light) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sd-sub {
  max-width: 620px;
  margin: 22px auto 0;
  font-size: clamp(15.5px, 1.9vw, 18px);
  color: var(--txt-mid);
}
.sd-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

/* ---- Preuves sous les CTA : ligne de confiance + chip Fonds Barnier ---- */
.sd-hero-proof {
  /* Une seule rangée centrée sur desktop (sources · pastille), repli en
     colonne naturel sur mobile via flex-wrap. */
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 18px;
  margin-top: 22px;
}
.sd-trust {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  letter-spacing: .2px;
  color: var(--txt-low);
}
.sd-trust-ico {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--cyan);
  opacity: .85;
}
.sd-chip-barnier {
  /* Fond vert PLEIN + texte blanc : la version translucide manquait de
     contraste sur le navy et se perdait devant la scène animée. */
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--green, #00845A);
  border: 1px solid rgba(143, 230, 195, .45);
  border-radius: 99px;
  padding: 7px 16px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 132, 90, .35);
  transition: background .2s ease, border-color .2s ease, transform .18s ease, box-shadow .2s ease;
}
.sd-chip-barnier:hover {
  background: #00996A;
  border-color: rgba(143, 230, 195, .75);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 132, 90, .5);
}

/* Lien tertiaire sous la ligne de preuves : porte d'entrée discrète vers
   l'auto-diagnostic gratuit (le chiffrage est désormais le CTA principal). */
.sd-hero-tertiary { margin-top: 16px; font-size: 13px; }
.sd-hero-tertiary a {
  color: var(--txt-low);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(183, 198, 218, .35);
  padding-bottom: 1px;
  transition: color .2s ease, border-color .2s ease;
}
.sd-hero-tertiary a:hover { color: var(--cyan); border-color: rgba(91, 194, 231, .65); }

/* ---- Scène animée ---- */
.sd-scene {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46vh;
  min-height: 300px;
  z-index: 1;
  pointer-events: none;
}
.sd-scene [data-depth] { position: absolute; inset: 0; will-change: transform; }

/* Nuages */
.sd-cloud {
  position: absolute;
  width: 240px;
  fill: rgba(233, 241, 250, .035);
  animation: sd-drift 18s ease-in-out infinite alternate;
}
.sd-cloud-a { top: -16%; left: 6%; width: 280px; }
.sd-cloud-b { top: -28%; right: 10%; width: 220px; animation-duration: 26s; animation-delay: -8s; }
.sd-cloud-c { top: -6%; left: 52%; width: 180px; fill: rgba(233, 241, 250, .025); animation-duration: 32s; animation-delay: -15s; }
@keyframes sd-drift {
  from { transform: translate3d(-26px, 0, 0); }
  to   { transform: translate3d(26px, 0, 0); }
}

/* Pluie */
.sd-rain { overflow: hidden; }
.sd-rain i {
  position: absolute;
  top: -22%;
  left: var(--x);
  width: 1.5px;
  height: 64px;
  background: linear-gradient(to bottom, transparent, rgba(91, 194, 231, .32));
  transform: rotate(13deg);
  animation: sd-fall var(--t) linear infinite;
  animation-delay: var(--d);
}
@keyframes sd-fall {
  from { transform: translate3d(0, -10%, 0) rotate(13deg); opacity: 0; }
  12%  { opacity: 1; }
  85%  { opacity: 1; }
  to   { transform: translate3d(-40px, 52vh, 0) rotate(13deg); opacity: 0; }
}

/* Skyline */
.sd-skyline { color: #16263E; }
.sd-skyline svg {
  position: absolute;
  left: 0; right: 0; bottom: 26px;
  width: 100%;
  height: 62%;
  opacity: .9;
}

/* Rue protégée : école, maison, commerce, mairie, hôpital, entrepôt + batardeaux */
.sd-house-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(12px, 1.6vw, 20px);
}
.sd-building { position: relative; display: flex; align-items: flex-end; }
.sd-house {
  width: clamp(190px, 18vw, 232px);
  height: auto;
  /* la maison est surélevée : le batardeau reste visible, l'eau vient lécher
     sa moitié basse sans jamais atteindre le seuil de la porte */
  margin-bottom: 24px;
  filter: drop-shadow(0 -6px 40px rgba(8, 16, 30, .6));
}
.sd-shop {
  width: clamp(132px, 12.7vw, 162px);
  height: auto;
  /* un peu plus bas que la maison : l'eau lèche davantage son batardeau */
  margin-bottom: 16px;
  filter: drop-shadow(0 -6px 36px rgba(8, 16, 30, .6));
}
.sd-ecole-svg {
  width: clamp(104px, 10vw, 124px);
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 -6px 32px rgba(8, 16, 30, .55));
}
.sd-mairie-svg {
  /* légèrement plus haute : point d'ancrage visuel de la rue */
  width: clamp(150px, 14.7vw, 188px);
  height: auto;
  margin-bottom: 22px;
  filter: drop-shadow(0 -6px 38px rgba(8, 16, 30, .6));
}
.sd-hopital-svg {
  width: clamp(126px, 12.2vw, 156px);
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 -6px 34px rgba(8, 16, 30, .55));
}
.sd-entrepot-svg {
  /* plus bas et plus large : l'eau lèche franchement son batardeau */
  width: clamp(150px, 15vw, 188px);
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 -6px 32px rgba(8, 16, 30, .55));
}
.sd-window { animation: sd-flicker 4.5s ease-in-out infinite; }
.sd-window-2 { animation-delay: -2.2s; }
.sd-window-3 { animation-delay: -1.1s; }
.sd-window-4 { animation-delay: -3.1s; }
.sd-window-5 { animation-delay: -.6s; }
.sd-window-6 { animation-delay: -1.8s; }
/* Drapeau de la mairie : léger flottement */
.sd-flag {
  transform-box: fill-box;
  transform-origin: left center;
  animation: sd-flag-wave 3.4s ease-in-out infinite;
}
@keyframes sd-flag-wave {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50%      { transform: skewY(2.5deg) scaleX(.93); }
}
@keyframes sd-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: .78; }
}
.sd-batardeau {
  animation: sd-glow 2.6s ease-in-out infinite;
}
/* Lueurs décalées pour que la rue ne pulse pas d'un seul bloc */
.sd-ecole .sd-batardeau    { animation-delay: -.7s; }
.sd-building-shop .sd-batardeau { animation-delay: -1.1s; }
.sd-mairie .sd-batardeau   { animation-delay: -1.5s; }
.sd-hopital .sd-batardeau  { animation-delay: -1.9s; }
.sd-entrepot .sd-batardeau { animation-delay: -.4s; }
@keyframes sd-glow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(242, 163, 60, .55)) drop-shadow(0 0 2px rgba(91, 194, 231, .4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(242, 163, 60, .95)) drop-shadow(0 0 5px rgba(91, 194, 231, .7)); }
}
/* ---- Contraste protégé / inondé ---- */
/* Les 4 bâtiments non protégés (école, commerce, hôpital, entrepôt) subissent
   la crue : pas de batardeau installé, fenêtres qui s'éteignent (délais
   décalés par bâtiment après l'arrivée de la vague), façade légèrement
   assombrie/désaturée, fine lame d'eau semi-transparente en pied de façade.
   Pure CSS : keyframes + delays, état final persistant (forwards). */
.sd-flooded .sd-batardeau { display: none; }
.sd-ecole         { --flood-d: 2.4s; --flood-base: 18px; }
.sd-building-shop { --flood-d: 3.4s; --flood-base: 16px; }
.sd-hopital       { --flood-d: 2.9s; --flood-base: 18px; }
.sd-entrepot      { --flood-d: 4s;   --flood-base: 12px; }
.sd-flooded {
  animation: sd-flood-tint 2.8s ease-in-out forwards;
  animation-delay: calc(var(--flood-d, 2.5s) + .8s);
}
@keyframes sd-flood-tint {
  to { filter: brightness(.82) saturate(.66); }
}
/* Fenêtres : de l'ambre à l'éteint, avec un dernier sursaut avant la coupure */
.sd-flooded .sd-window   { animation: sd-window-off 2.6s ease-in-out forwards; animation-delay: var(--flood-d, 2.5s); }
.sd-flooded .sd-window-2 { animation-delay: calc(var(--flood-d, 2.5s) + .35s); }
.sd-flooded .sd-window-3 { animation-delay: calc(var(--flood-d, 2.5s) + .7s); }
.sd-flooded .sd-window-4 { animation-delay: calc(var(--flood-d, 2.5s) + .5s); }
.sd-flooded .sd-window-5 { animation-delay: calc(var(--flood-d, 2.5s) + .9s); }
.sd-flooded .sd-window-6 { animation-delay: calc(var(--flood-d, 2.5s) + 1.15s); }
@keyframes sd-window-off {
  0%   { opacity: 1; }
  45%  { opacity: .3; }
  60%  { opacity: .75; }
  100% { opacity: .14; }
}
/* L'eau « entre » : fine surcouche en pied de façade */
.sd-flooded::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: var(--flood-base, 14px);
  height: 22px;
  background: linear-gradient(180deg, rgba(91, 194, 231, 0), rgba(91, 194, 231, .22) 40%, rgba(58, 143, 212, .38));
  border-radius: 3px 3px 0 0;
  opacity: 0;
  animation: sd-flood-rise 3.2s ease forwards;
  animation-delay: calc(var(--flood-d, 2.5s) + 1.2s);
}
@keyframes sd-flood-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.sd-protected {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #07140A;
  background: linear-gradient(135deg, #5BE7B0, #2FBF8F);
  border-radius: 99px;
  padding: 5px 12px;
  box-shadow: 0 4px 18px rgba(47, 191, 143, .45);
  animation: sd-bob 3.4s ease-in-out infinite;
  white-space: nowrap;
}
.sd-protected svg { width: 12px; height: 12px; }
.sd-mairie .sd-protected { animation-delay: -1.7s; }
@keyframes sd-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -5px); }
}

/* Vagues — l'eau bute contre le batardeau, le seuil reste au sec */
.sd-wave-wrap { overflow: visible; }
.sd-wave {
  position: absolute;
  left: 0; right: 0; bottom: 0;
}
.sd-wave-back  { height: 96px; color: rgba(41, 120, 181, .35); animation: sd-bob-wave 7s ease-in-out infinite; }
.sd-wave-mid   { height: 82px; color: rgba(58, 143, 212, .6);  animation: sd-bob-wave 5.6s ease-in-out infinite reverse; }
.sd-wave-front { height: 70px; color: rgba(91, 194, 231, .9);  animation: sd-bob-wave 4.6s ease-in-out infinite; }
@keyframes sd-bob-wave {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -4px, 0); }
}
.sd-wave-track {
  position: absolute;
  left: 0; bottom: 0;
  width: 200%;
  height: 100%;
  animation: sd-flow 22s linear infinite;
}
.sd-wave-mid .sd-wave-track { animation: sd-flow-rev 15s linear infinite; }
.sd-wave-front .sd-wave-track { animation-duration: 10s; }
.sd-wave-track svg { width: 100%; height: 100%; display: block; }
@keyframes sd-flow {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes sd-flow-rev {
  from { transform: translate3d(-50%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* Hero hors viewport : toutes les animations de la scène sont mises en pause
   (classe posée par main.js via la même IntersectionObserver que le CTA nav). */
.sd-hero--paused .sd-scene *,
.sd-hero--paused .sd-flooded::after,
.sd-hero--paused .sd-scroll-hint {
  animation-play-state: paused !important;
}

/* Indice scroll */
.sd-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 4;
  color: rgba(233, 241, 250, .75);
  animation: sd-hint 2.2s ease-in-out infinite;
}
.sd-scroll-hint svg { width: 26px; height: 26px; }
@keyframes sd-hint {
  0%, 100% { transform: translate(-50%, 0); opacity: .75; }
  50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ---------------------------------------------------------------- */
/* Sections                                                          */
/* ---------------------------------------------------------------- */
.sd-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 120px) 22px 0;
  text-align: center;
}
.sd-section-title {
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  margin-bottom: 14px;
  text-wrap: balance;
}
.sd-section-lead { color: var(--txt-mid); font-size: 16px; margin-bottom: 28px; }

/* ---- Séparateur vague entre sections (statique, faible contraste) ---- */
.sd-divider {
  height: clamp(36px, 5vw, 64px);
  margin-top: clamp(54px, 8vw, 90px);
  color: rgba(91, 194, 231, .05);
  overflow: hidden;
}
.sd-divider svg { width: 100%; height: 100%; display: block; }

/* ---- Stats ---- */
.sd-stats { max-width: 1180px; margin: 0 auto; padding: clamp(54px, 8vw, 90px) 22px 0; }
.sd-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
/* Cartes alignées : grille étirée (hauteurs égales), chiffre toujours sur
   UNE ligne, filet aqua sous le chiffre, labels qui démarrent sur la même
   ligne de base d'une carte à l'autre. */
.sd-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 22px 26px;
  text-align: center;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.sd-stat:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 194, 231, .35);
  box-shadow: 0 14px 40px rgba(4, 10, 20, .45);
}
.sd-stat-num {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.15;
  color: var(--cyan);
  white-space: nowrap;
}
.sd-stat-num::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(91, 194, 231, .9), rgba(91, 194, 231, .12));
}
.sd-stat-num sup { font-size: .55em; }
.sd-stat-label { margin-top: 10px; font-size: 14.5px; color: var(--txt-mid); }

/* ---- Cartes formules ---- */
.sd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 38px;
  text-align: left;
}
.sd-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 26px;
  transition: transform .25s ease, box-shadow .3s ease, border-color .3s ease;
  transform-style: preserve-3d;
}
.sd-card:hover {
  border-color: rgba(91, 194, 231, .35);
  box-shadow: 0 22px 60px rgba(4, 10, 20, .5);
}
/* Carte ① mise en avant : produit d'appel (liseré aqua/vert + halo doux). */
.sd-card-featured {
  border-color: rgba(91, 194, 231, .45);
  background:
    linear-gradient(180deg, rgba(91, 194, 231, .09), rgba(0, 132, 90, .05)),
    var(--glass);
  box-shadow:
    0 0 0 1px rgba(91, 194, 231, .14),
    0 0 36px rgba(91, 194, 231, .14),
    0 18px 50px rgba(4, 10, 20, .45);
}
.sd-card-featured:hover {
  border-color: rgba(91, 194, 231, .65);
  box-shadow:
    0 0 0 1px rgba(91, 194, 231, .22),
    0 0 44px rgba(91, 194, 231, .2),
    0 22px 60px rgba(4, 10, 20, .5);
}
.sd-card h3 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; color: #fff; }
.sd-card p { font-size: 14.5px; color: var(--txt-mid); flex-grow: 0; }
/* Le CTA est épinglé en bas de carte (margin-top:auto) : les 3 boutons
   partagent la même ligne de base quelle que soit la longueur du texte
   (le gap de 12px de la carte garantit l'écart minimal au-dessus). */
.sd-card .sd-btn-card { margin-top: auto; }
.sd-card h3 { text-wrap: balance; }
.sd-card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sd-card-sub { font-size: 13px; color: var(--txt-low); }
.sd-card-sub a { color: var(--cyan); font-weight: 600; text-decoration: none; }
.sd-card-sub a:hover { text-decoration: underline; }

.sd-num {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(58, 143, 212, .4);
}

.sd-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 4px 12px;
}
.sd-badge-green { background: var(--green); color: #fff; }
.sd-badge-grey  { background: rgba(255, 255, 255, .12); color: var(--txt-mid); }
.sd-badge-amber { background: var(--amber); color: #271703; }
.sd-badge-featured {
  background: linear-gradient(135deg, var(--cyan), var(--blue-light));
  color: #07111F;
  box-shadow: 0 4px 14px rgba(91, 194, 231, .35);
}

/* ---- Pour qui ? ---- */
.sd-publics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 38px;
  text-align: left;
}
@media (max-width: 1000px) { .sd-publics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px)  { .sd-publics { grid-template-columns: 1fr; } }
.sd-public {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  transition: transform .25s ease, box-shadow .3s ease, border-color .3s ease;
  transform-style: preserve-3d;
}
.sd-public:hover {
  border-color: rgba(91, 194, 231, .35);
  box-shadow: 0 18px 48px rgba(4, 10, 20, .5);
}
.sd-public-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(91, 194, 231, .12);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sd-public-icon svg { width: 22px; height: 22px; }
.sd-public h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; color: #fff; }
.sd-public p { font-size: 13.5px; color: var(--txt-mid); }

/* ---- Timeline ---- */
.sd-timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 26px;
  margin-top: 44px;
  position: relative;
  text-align: center;
  counter-reset: step;
}
.sd-step { position: relative; padding-top: 4px; }
.sd-step .sd-num { width: 44px; height: 44px; font-size: 17px; margin-bottom: 14px; }
.sd-step h3 { font-size: 16.5px; font-weight: 800; color: #fff; margin-bottom: 6px; text-wrap: balance; }
.sd-step p { font-size: 13.5px; color: var(--txt-mid); max-width: 240px; margin: 0 auto; }
/* connecteur entre étapes (masqué quand la grille passe en colonne) —
   3 étapes = 3 colonnes (sinon la 4e colonne vide décentre le parcours) ;
   le trait est centré sur la pastille : padding-top 4px + 44px / 2 - 1px = 25px */
@media (min-width: 900px) {
  .sd-timeline { grid-template-columns: repeat(3, 1fr); max-width: 920px; margin-left: auto; margin-right: auto; }
  .sd-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 25px;
    left: calc(50% + 34px);
    width: calc(100% - 68px);
    height: 2px;
    background: linear-gradient(90deg, rgba(91, 194, 231, .45), rgba(91, 194, 231, .08));
  }
}

/* ---- Sources ---- */
/* Ligne différenciante : « interrogées en direct » (accent cyan discret). */
.sd-sources-live {
  display: inline-block;
  margin: 14px auto 0;
  padding: 10px 18px;
  font-size: 14.5px;
  color: var(--pale);
  background: rgba(91, 194, 231, .10);
  border: 1px solid rgba(91, 194, 231, .28);
  border-radius: 99px;
}
.sd-sources-live b { color: var(--cyan); }

/* 5 cartes sources : 5 colonnes desktop → 2 → 1 en responsive. */
.sd-sources {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 30px 0;
  text-align: left;
}
@media (min-width: 560px) { .sd-sources { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .sd-sources { grid-template-columns: repeat(5, 1fr); } }
.sd-source {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 14px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.sd-source:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 194, 231, .35);
  box-shadow: 0 14px 40px rgba(4, 10, 20, .45);
}
/* En-tête uniforme sur les 5 cartes : nom en haut, badge « interrogée en
   direct » juste dessous (jamais à côté, jamais coupé). */
.sd-source-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.sd-source-wordmark {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .6px;
  color: #fff;
}
.sd-source-live {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cyan);
  background: rgba(91, 194, 231, .12);
  border: 1px solid rgba(91, 194, 231, .3);
  border-radius: 99px;
  padding: 3px 8px;
}
.sd-source-org {
  font-size: 10px;
  font-variant: small-caps;
  letter-spacing: .8px;
  color: var(--txt-low);
  line-height: 1.4;
}
.sd-source-desc { font-size: 13px; color: var(--txt-mid); flex: 1 1 auto; }
/* Détail replié dans un <details> natif par carte (rien n'est supprimé) */
.sd-source-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cyan);
}
.sd-source-details summary:hover { text-decoration: underline; }
.sd-source-details[open] summary { margin-bottom: 6px; }
.sd-source-details .sd-source-org { display: block; margin-bottom: 4px; }
.sd-source-licence {
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--txt-low);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
}
.sd-source-link { font-size: 12.5px; font-weight: 700; color: var(--cyan); text-decoration: none; }
.sd-source-link:hover { text-decoration: underline; }
.sd-vigicrues {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}
.sd-vigicrues-icon {
  flex: 0 0 auto;
  width: 50px; height: 50px;
  border-radius: 14px;
  background: rgba(91, 194, 231, .12);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sd-vigicrues-icon svg { width: 28px; height: 28px; }
.sd-vigicrues-text { flex: 1 1 320px; }
.sd-vigicrues-text h3 { font-size: 16.5px; font-weight: 800; color: #fff; }
.sd-vigicrues-text p { font-size: 13.5px; color: var(--txt-mid); margin-top: 4px; }

/* ---- Aides ---- */
.sd-aides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 36px;
  text-align: left;
}
.sd-aide {
  padding: 24px 24px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.sd-aide:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 194, 231, .35);
  box-shadow: 0 14px 40px rgba(4, 10, 20, .45);
}
.sd-aide h3 { font-size: 17px; font-weight: 800; color: var(--cyan); margin-bottom: 8px; }
.sd-aide p { font-size: 14px; color: var(--txt-mid); }
.sd-aide b { color: var(--pale); }
.sd-footnote { margin-top: 20px; font-size: 12.5px; color: var(--txt-low); }

/* ---- Partenaires ---- */
.sd-partner {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(70px, 10vw, 110px) 22px 0;
  text-align: center;
}
.sd-partner-title { font-size: clamp(20px, 2.8vw, 26px); font-weight: 800; color: #fff; letter-spacing: -.4px; }
.sd-partner-line { margin-top: 10px; font-size: 14.5px; color: var(--txt-mid); }

/* ---- CTA final ---- */
.sd-final {
  max-width: 1180px;
  margin: clamp(70px, 10vw, 110px) auto 0;
  padding: clamp(60px, 8vw, 90px) 22px;
  text-align: center;
  background:
    radial-gradient(620px 280px at 50% 110%, rgba(58, 143, 212, .25), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015));
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}
.sd-final-title {
  font-size: clamp(28px, 4.6vw, 44px);
  font-weight: 800;
  letter-spacing: -1.2px;
  color: #fff;
  margin-bottom: 28px;
  text-wrap: balance;
}
.sd-final-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
}
@media (max-width: 560px) {
  .sd-final-ctas .sd-btn { width: 100%; }
}

/* ---- Footer ---- */
.sd-footer {
  text-align: center;
  padding: 44px 22px 54px;
  font-size: 13.5px;
  color: var(--txt-mid);
}
.sd-footer a { color: var(--cyan); text-decoration: none; }
.sd-footer a:hover { text-decoration: underline; }
.sd-footer-mention { margin-top: 8px; font-size: 12px; color: var(--txt-low); }

/* ---------------------------------------------------------------- */
/* Modal                                                             */
/* ---------------------------------------------------------------- */
.sd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7, 14, 26, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}
.sd-modal-backdrop[hidden] { display: none; }
.sd-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: linear-gradient(180deg, #1C314F, #15263F);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
  padding: 30px 28px;
  animation: sd-modal-in .28s cubic-bezier(.22, .8, .3, 1);
}
@keyframes sd-modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.sd-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  color: var(--txt-mid);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease;
}
.sd-modal-close:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.sd-modal-close svg { width: 18px; height: 18px; }
.sd-modal-title { font-size: 21px; font-weight: 800; letter-spacing: -.4px; color: #fff; padding-right: 36px; }
.sd-modal-badge { margin-top: 10px; }
.sd-modal-note { margin-top: 8px; font-size: 13px; color: var(--txt-mid); }
.sd-modal-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #8FE6C3;
  background: rgba(0, 132, 90, .14);
  border: 1px solid rgba(47, 191, 143, .3);
  border-radius: 10px;
}
.sd-modal-attach svg { width: 15px; height: 15px; flex: 0 0 auto; }
.sd-modal-hello {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
}
.sd-modal-hello[hidden] { display: none; }

#sd-modal-form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.sd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sd-field { display: flex; flex-direction: column; gap: 6px; }
.sd-field > span { font-size: 13px; font-weight: 700; color: var(--txt-mid); }
.sd-field em { font-style: normal; font-weight: 500; color: var(--txt-low); }
.sd-input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--txt);
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 11px;
  padding: 12px 13px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sd-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(91, 194, 231, .18);
}
.sd-input[aria-invalid="true"] { border-color: #FF8787; }
textarea.sd-input { resize: vertical; min-height: 74px; }

.field-error {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #FF9D9D;
}
.field-error[hidden] { display: none; }

.sd-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--txt-mid);
  cursor: pointer;
}
.sd-check input { margin-top: 3px; accent-color: var(--blue-light); width: 16px; height: 16px; flex: 0 0 auto; }

.sd-modal-success { text-align: center; padding: 22px 4px 6px; }
.sd-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(0, 132, 90, .18);
  border: 1px solid rgba(47, 191, 143, .4);
  color: #5BE7B0;
  margin-bottom: 16px;
}
.sd-success-icon svg { width: 26px; height: 26px; }
.sd-modal-success p { font-size: 15px; color: var(--pale); margin-bottom: 20px; }

/* ---------------------------------------------------------------- */
/* Badge démo — accès à l'outil expert                               */
/* DEMO ONLY — retirer avec le bloc HTML correspondant               */
/* ---------------------------------------------------------------- */
.demo-expert-badge {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 60;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--amber);
  text-decoration: none;
  background: rgba(15, 29, 50, .85);
  border: 1.5px dashed rgba(242, 163, 60, .55);
  border-radius: 99px;
  padding: 7px 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .18s ease, border-color .2s ease, color .2s ease;
}
.demo-expert-badge:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
  color: #FFC169;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */
/* La rue se vide progressivement quand l'écran rétrécit */
@media (max-width: 1100px) {
  .sd-entrepot { display: none; }
}
@media (max-width: 900px) {
  .sd-hopital { display: none; }
}
@media (max-width: 760px) {
  .sd-nav-links { display: none; }
  .sd-nav-inner { gap: 12px; justify-content: space-between; }
  .sd-scene { height: 38vh; min-height: 240px; }
  .sd-hero-ctas .sd-btn { width: 100%; }
  .sd-form-row { grid-template-columns: 1fr; }
  .sd-protected { font-size: 9.5px; padding: 4px 10px; }
}
@media (max-width: 700px) {
  .sd-ecole { display: none; }
}
@media (max-width: 560px) {
  .sd-mairie { display: none; }
}

/* Très petits écrans : maison + commerce restent côte à côte sans déborder */
@media (max-width: 430px) {
  .sd-house-wrap { gap: 12px; }
  .sd-house { width: 184px; }
  .sd-shop { width: 124px; }
}

/* ---------------------------------------------------------------- */
/* Mouvement réduit : tout est coupé                                 */
/* ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Pluie, vagues, halos de batardeau, fenêtres, nuages… : tout est coupé. */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .sd-scene [data-depth] { transform: none !important; }
  /* Pas de lift au survol des cartes (stats, aides, sources) */
  .sd-stat:hover, .sd-aide:hover, .sd-source:hover { transform: none; }
  /* Le contraste protégé/inondé reste lisible en statique (état final). */
  .sd-flooded { filter: brightness(.82) saturate(.66); }
  .sd-flooded .sd-window { opacity: .14; }
  .sd-flooded::after { opacity: 1; }
}
