/* Page d'accueil du site : claire et épurée */
:root {
  --fond: #F6F8FA;
  --carte-fond: #FFFFFF;
  --nuit: #0B1E2D;
  --encre: #0B1E2D;
  --doux: #5D7385;
  --trait: #E2E8EE;
  --ok: #1B76B3;
  --leger: #F08C00;
  --fort: #D32F2F;
  --chiffres: 'Barlow Condensed', 'Barlow', 'Arial Narrow', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #0B1E2D; --carte-fond: #10283A; --encre: #E6EEF4; --doux: #93A9BA; --trait: #22384A; color-scheme: dark; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font-family: 'Barlow', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--leger); outline-offset: 3px; }
svg { stroke-linecap: round; stroke-linejoin: round; }

/* ----- En-tête ----- */
.haut {
  max-width: 1100px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--chiffres); font-size: 1.6rem; font-weight: 700; }
.marque img { border-radius: 9px; }
.lien-carte { font-weight: 600; text-decoration: none; color: var(--doux); }
.lien-carte:hover { color: var(--encre); }

/* ----- Le haut de page ----- */
.hero {
  max-width: 1100px; margin: 0 auto; padding: 28px 22px 8px;
  display: grid; gap: 22px;
  grid-template-areas: "texte" "apercu" "actions";
}
.texte { grid-area: texte; }
.apercu { grid-area: apercu; }
.actions { grid-area: actions; }
h1 { margin: 0; font-size: clamp(2.1rem, 8vw, 3.6rem); font-weight: 700; line-height: 1.05; letter-spacing: -.015em; max-width: 14ch; }
.sous { margin: 14px 0 0; font-size: 1.1rem; line-height: 1.55; color: var(--doux); max-width: 38ch; }

.apercu { position: relative; }
.vitrine {
  height: clamp(220px, 58vw, 420px); border-radius: 20px; overflow: hidden;
  background: #e6edf2; border: 1px solid var(--trait);
}
.vitrine .leaflet-control-container { display: none; }
@media (prefers-color-scheme: dark) { .vitrine .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92); } }
.badge-direct {
  position: absolute; left: 12px; top: 12px; z-index: 500; margin: 0;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--carte-fond); color: var(--encre); border-radius: 10px; padding: 7px 11px;
  font-size: .95rem; box-shadow: 0 2px 10px rgba(11,30,45,.12);
}
.badge-direct strong { font-family: var(--chiffres); font-size: 1.15rem; }
.point-direct { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.point-direct::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); animation: pulsation 2s ease-out infinite; }
@keyframes pulsation { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

/* Les mini trains de l'aperçu (même dessin que sur la carte) */
.leaflet-div-icon.mini-train { background: none; border: none; }
.mini-train span {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 20px; border-radius: 10px; border: 2px solid #fff;
  color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.mini-train svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.3; }
.mini-train .ok { background: var(--ok); }
.mini-train .leger { background: var(--leger); color: #0B1E2D; }
.mini-train .fort { background: var(--fort); }
.mini-train .prevu { background: #fff; color: #6F8597; border-style: dashed; border-color: #6F8597; }

.actions { display: grid; gap: 10px; }
.bouton {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 22px; border-radius: 14px;
  font: inherit; font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.bouton svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.principal { background: var(--nuit); color: #fff; border: 0; }
.principal:hover { background: #14324A; }
.secondaire { background: transparent; color: var(--encre); border: 1.5px solid var(--trait); }
.secondaire:hover { border-color: var(--doux); }
@media (prefers-color-scheme: dark) {
  .principal { background: #fff; color: var(--nuit); }
  .principal:hover { background: #E6EEF4; }
}
.aide-installation { padding: 14px 16px; border-radius: 14px; background: var(--carte-fond); border: 1px solid var(--trait); font-size: .95rem; line-height: 1.5; }
.aide-installation p { margin: 0 0 6px; }
.aide-installation ol { margin: 0; padding-left: 20px; }

/* Ordinateur : texte et boutons à gauche, aperçu à droite */
@media (min-width: 860px) {
  .hero {
    padding-top: 56px; column-gap: 48px; align-items: center;
    grid-template-columns: 1fr 1.15fr;
    grid-template-areas: "texte apercu" "actions apercu";
  }
  .texte { align-self: end; }
  .actions { align-self: start; max-width: 340px; }
  .vitrine { height: 440px; }
}

/* ----- Les atouts ----- */
.atouts {
  max-width: 1100px; margin: 0 auto; padding: 48px 22px 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px 40px;
}
.atouts article { border-top: 1.5px solid var(--trait); padding-top: 18px; }
.atouts svg { width: 26px; height: 26px; fill: none; stroke: var(--ok); stroke-width: 2; }
.atouts h2 { margin: 12px 0 6px; font-size: 1.2rem; line-height: 1.25; }
.atouts p { margin: 0; color: var(--doux); line-height: 1.55; }

.pied {
  max-width: 1100px; margin: 0 auto; padding: 22px 22px calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--trait); color: var(--doux); font-size: .88rem; line-height: 1.5;
}
.pied p { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) { .point-direct::after { animation: none; } }

/* ----- Pages de texte (mentions légales, confidentialité) ----- */
.page-texte main { max-width: 720px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top, 0px)) 24px 64px; line-height: 1.6; }
.page-texte h1 { font-size: clamp(2.4rem, 8vw, 3.6rem); margin: 18px 0 24px; line-height: 1; }
.page-texte h2 { font-size: 1.2rem; margin: 32px 0 8px; }
.page-texte p, .page-texte li { color: var(--doux); max-width: 65ch; }
.page-texte mark { background: #FBE7B0; color: #0B1E2D; padding: 0 4px; border-radius: 4px; }
.retour-site { color: var(--doux); text-decoration: none; }
.retour-site:hover { color: var(--encre); }
.pied a { color: var(--doux); }

/* ----- Choix de la langue ----- */
.langues { display: flex; justify-content: center; gap: 6px; margin: 16px 0 0; }
.langues button {
  padding: 5px 11px; border: 1.5px solid var(--trait); border-radius: 999px; background: none;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--doux); cursor: pointer;
}
.langues button[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--fond); }

/* Badge « Bêta » à côté du nom */
.badge-beta {
  display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 6px; vertical-align: middle;
  font-family: var(--chiffres, inherit); font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #0B1E2D; background: #9CC8EA; line-height: 1.4;
}
