/* Branché — feuille partagée (landing + pages légales).
   Couleurs : docs/design/tokens.json. Polices chargées dans le HTML (Google Fonts). */

:root {
  --ink: #0F1A17;
  --ink-muted: #4B5753;
  --surface: #FFFFFF;
  --surface-alt: #F1F4F3;
  --border: #DDE4E2;
  --map-ground: #E6ECEA;
  --accent: #0B7A55;
  --accent-pressed: #075C40;
  --accent-soft: #E3F2EC;
  --on-accent: #FFFFFF;
  --accent-text: #0B7A55;
  --busy: #B45309;
  --offline: #5B6662;
  --night-bg: #0F1A17;
  --night-card: #1A2622;
  --night-muted: #A9B8B3;
  --charge: #3DDC97;
  --danger: #B42318;
  --focus: #0B7A55;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;
  --touch: 44px;
  --gutter: 20px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EEF3F1;
    --ink-muted: #A9B8B3;
    --surface: #0F1A17;
    --surface-alt: #1A2622;
    --border: #2A3833;
    --map-ground: #1A2622;
    --accent: #3DDC97;
    --accent-pressed: #2FC584;
    --accent-soft: #163A2D;
    --on-accent: #0F1A17;
    --accent-text: #3DDC97;
    --focus: #3DDC97;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 20;
  background: var(--ink); color: var(--surface);
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1120px; margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; min-height: var(--touch); flex: none;
  color: var(--ink); text-decoration: none;
}
/* Logo jamais compressé par la navigation : largeur fixée par le rapport 214/48. */
.brand svg { height: 32px; width: 143px; }
.brand .brand__mark { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: var(--touch);
  padding: 0 12px; border-radius: var(--r-sm);
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.site-nav a:not(.btn):hover { background: var(--surface-alt); }
.site-nav a { white-space: nowrap; }
.site-nav .lang-short { display: none; }
@media (max-width: 639px) { .site-nav a.nav-optional { display: none; } }
@media (max-width: 479px) {
  .site-header__inner { gap: 4px; padding-left: 16px; padding-right: 16px; }
  .site-nav { gap: 0; min-width: 0; }
  .site-nav a:not(.btn) { padding: 0 10px; font-size: 0.9375rem; }
  .site-nav .btn-small { padding: 0 12px; }
  .brand svg { height: 28px; width: 125px; }
}
@media (max-width: 379px) {
  .site-nav .lang-long { display: none; }
  .site-nav .lang-short { display: inline; }
  .site-nav a.lang-switch { min-width: var(--touch); justify-content: center; padding: 0 8px; }
}

/* ---------- Mise en page ---------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
}
@media (min-width: 768px) { .page { padding-top: 56px; padding-bottom: 96px; } }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Prose (pages légales) ---------- */
.prose { color: var(--ink); font-size: 1rem; line-height: 1.7; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1em; }
.prose h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.5rem); margin-bottom: 0.4em; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { font-size: 1.1875rem; margin-top: 1.8em; }
.prose h4 { font-size: 1rem; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose p, .prose li { color: var(--ink); }
.prose .lead { font-size: 1.125rem; color: var(--ink-muted); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--ink-muted); }
.prose strong { font-weight: 600; }
.prose a { font-weight: 500; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose blockquote {
  margin-left: 0; padding: 12px 16px;
  border-left: 4px solid var(--accent); background: var(--surface-alt);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em; background: var(--surface-alt); padding: 0.1em 0.35em; border-radius: 6px;
}
.prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-md); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.prose .table-wrap table { border: 0; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; background: var(--surface-alt); }
.prose tr:last-child td { border-bottom: 0; }
.prose .updated { color: var(--ink-muted); font-size: 0.9375rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border-radius: var(--r-lg); border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-pressed); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--ink-muted); }
.btn[aria-disabled="true"], .btn:disabled {
  cursor: not-allowed; background: var(--surface-alt); border-color: var(--border); color: var(--ink-muted);
}
.btn-small { min-height: var(--touch); padding: 0 16px; border-radius: var(--r-md); font-size: 0.9375rem; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-text);
  font: 600 0.8125rem/1.3 var(--font-body);
  letter-spacing: 0.01em;
}
@media (prefers-color-scheme: light) { .badge { color: var(--accent-pressed); } }
.badge-neutral { background: var(--surface-alt); color: var(--ink-muted); }

/* ---------- Landing ---------- */
.hero { padding: 32px 0 48px; }
.hero__grid { display: grid; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.4vw, 3.75rem); letter-spacing: -0.025em; }
.hero h1 span { color: var(--accent-text); display: block; }
.hero__lead { margin-top: 18px; font-size: 1.125rem; line-height: 1.6; color: var(--ink-muted); max-width: 34em; }
.hero__actions { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.hero__stores { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__note { margin-top: 14px; font-size: 0.875rem; color: var(--ink-muted); }
@media (min-width: 560px) {
  .hero__actions { align-items: flex-start; }
  /* Libellés des magasins sur une seule ligne (les boutons passent à la ligne entre eux). */
  .hero__stores .btn-store { white-space: nowrap; }
}
@media (min-width: 960px) {
  .hero { padding: 72px 0 96px; }
  .hero__grid { grid-template-columns: 1.1fr 0.9fr; gap: 56px; }
}

.section { padding: 56px 0; border-top: 1px solid var(--border); }
@media (min-width: 768px) { .section { padding: 88px 0; } }
.section__head { max-width: 640px; }
.section__head h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
.section__head p { margin-top: 12px; color: var(--ink-muted); font-size: 1.0625rem; }
.section--alt { background: var(--surface-alt); }

.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px;
}
.step__num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent);
  font: 700 1.125rem/1 var(--font-display);
}
.step h3 { margin-top: 18px; font-size: 1.25rem; }
.step p { margin-top: 8px; color: var(--ink-muted); }

.honest { display: grid; gap: 24px; }
.honest__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px; display: grid; gap: 14px;
}
.honest__card p { color: var(--ink); font-size: 1.0625rem; }
.honest__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.honest__list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-muted); }
.honest__list svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--accent-text); }
@media (min-width: 960px) { .honest { grid-template-columns: 0.9fr 1.1fr; align-items: start; gap: 48px; } }

.ops { display: grid; gap: 20px; align-items: center; }
.ops p { color: var(--ink-muted); font-size: 1.0625rem; margin-top: 12px; }
@media (min-width: 768px) { .ops { grid-template-columns: 1fr auto; gap: 40px; } }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 48px; font-size: 0.9375rem; color: var(--ink-muted); }
.site-footer__inner { display: grid; gap: 20px; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 8px; margin-left: -8px; color: var(--ink); font-weight: 500; }
.site-footer .attrib { max-width: 60ch; }
.site-footer .attrib a { color: var(--ink-muted); }
@media (min-width: 768px) { .site-footer__inner { grid-template-columns: auto 1fr; align-items: start; gap: 40px; } .site-footer nav ul { justify-content: flex-end; } }

/* ---------- Maquette téléphone (HTML/CSS) ---------- */
.mock { justify-self: center; width: min(100%, 340px); }
.phone {
  position: relative; aspect-ratio: 9 / 19; width: 100%;
  border-radius: 46px; padding: 10px;
  background: #0F1A17;
  box-shadow: 0 1px 0 1px #2A3833 inset, 0 30px 60px -20px rgba(15, 26, 23, .35);
}
.phone__screen {
  position: relative; height: 100%; overflow: hidden; border-radius: 37px;
  background: #E6ECEA; color: #0F1A17; font-family: var(--font-body);
}
.phone__notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #0F1A17; z-index: 4; }

/* carte stylisée */
.map { position: absolute; inset: 0; }
.map__block { position: absolute; background: #DDE4E2; border-radius: 10px; }
.map__park { position: absolute; background: #CFE3D9; border-radius: 18px; }
.map__road { position: absolute; background: #FFFFFF; border-radius: 6px; transform-origin: center; }
.map__water { position: absolute; background: #CFDDE4; border-radius: 40px; }
.map__me {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #2563EB; border: 3px solid #FFFFFF; box-shadow: 0 0 0 8px rgba(37, 99, 235, .18);
}

/* Bornes de la maquette : mêmes codes que la carte de l'app (tokens.json, map.*) — pastille et puissance en kW. */
.dot { position: absolute; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; background: #0B7A55; border: 2.5px solid #FFFFFF; }
.dot span {
  position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
  font: 700 10.5px/1 var(--font-body); color: #0F1A17; white-space: nowrap;
  text-shadow: 0 0 2px #FFFFFF, 0 0 2px #FFFFFF, 0 0 3px #FFFFFF;
}
.dot--fast { width: 20px; height: 20px; background: #075C40; }
.dot--fast span { top: 19px; }
.dot--sel { width: 22px; height: 22px; box-shadow: 0 0 0 4px #0B7A55; z-index: 2; }
.dot--sel span { top: 24px; }

.mock__search {
  position: absolute; top: 46px; left: 14px; right: 14px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px; border-radius: 14px;
  background: #FFFFFF; color: #4B5753; font-size: 12.5px; font-weight: 500;
  box-shadow: 0 2px 10px rgba(15, 26, 23, .12);
}
.mock__search svg { width: 16px; height: 16px; flex: none; color: #4B5753; }
.mock__chips { position: absolute; top: 96px; left: 14px; right: 0; z-index: 3; display: flex; gap: 6px; overflow: hidden; }
.mock__chip { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: #FFFFFF; border: 1px solid #C9D3D0; font-size: 11px; font-weight: 600; color: #0F1A17; }
.mock__chip svg { width: 11px; height: 11px; }
.mock__chip--on { background: #E3F2EC; border: 2px solid #0B7A55; color: #075C40; padding: 5px 9px; }

.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3;
  background: #FFFFFF; border-radius: 28px; padding: 10px 16px 16px;
  box-shadow: 0 -4px 24px rgba(15, 26, 23, .14);
}
.sheet__grab { width: 36px; height: 4px; border-radius: 4px; background: #DDE4E2; margin: 0 auto 10px; }
.sheet__title { font: 700 16px/1.2 var(--font-display); margin: 0; }
.sheet__meta { margin-top: 3px; font-size: 11.5px; color: #4B5753; }
.sheet__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.sheet__stats div { background: #F1F4F3; border-radius: 10px; padding: 6px 8px; font: 700 13px/1.2 var(--font-display); color: #0F1A17; }
.sheet__stats small { display: block; font: 600 9.5px/1.3 var(--font-body); color: #4B5753; }
.sheet__cta {
  margin-top: 10px; display: flex; align-items: center; justify-content: center;
  height: 44px; border-radius: 14px; background: #0B7A55; color: #FFFFFF;
  font: 700 14px/1 var(--font-body);
}
.sheet__alt { margin-top: 8px; text-align: center; font-size: 11px; font-weight: 600; color: #0B7A55; }
.mock__caption { margin-top: 14px; text-align: center; font-size: 0.8125rem; color: var(--ink-muted); }

/* Bandeau « brouillon » des pages légales */
.draft {
  border: 1px solid #F2C38B;
  background: #FEF3E2;
  color: #7A3E06;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 500;
  margin: 0 0 24px;
}
@media (prefers-color-scheme: dark) {
  .draft { background: #3A2610; border-color: #7A4A14; color: #F8D9B0; }
}

/* Sélecteur de langue (FR / EN) */
.site-nav .lang-switch { font-weight: 600; }

/* Proposition de langue (selon navigator.language), jamais de redirection automatique */
.lang-suggest { background: var(--accent-soft); border-bottom: 1px solid var(--border); }
.lang-suggest__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.lang-suggest p { font-weight: 600; color: var(--ink); }
.lang-suggest__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-suggest[hidden] { display: none; }
