:root {
  --lime: #B6F23C;
  --lime-soft: #DDF99B;
  --forest: #0E2B1B;
  --sun: #FFE04A;
  --paper: #F5FBE3;
  --radius: 18px;
  --max: 1120px;
  --pad: clamp(20px, 5vw, 56px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--lime);
  color: var(--forest);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}

a { color: inherit; }

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

/* ---------- En-tête ---------- */
.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
}

.logo-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: inset 0 0 0 6px var(--lime), inset 0 0 0 11px var(--forest);
}

.top-nav { display: flex; gap: 24px; }
.top-nav a { font-weight: 500; text-decoration: none; }
.top-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Héros ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) var(--pad) clamp(56px, 9vw, 120px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 800;
  max-width: 11ch;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  max-width: 34ch;
  margin: 24px 0 32px;
}

/* ---------- Boutons stores ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 18px;
  min-height: 56px;
  background: var(--forest);
  color: var(--paper);
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.1;
  transition: transform .15s ease, background .15s ease;
}

.store svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.store small { display: block; font-size: .72rem; font-weight: 500; opacity: .8; }
.store:hover { transform: translateY(-2px); background: #17402a; }

.stores-dark .store { background: var(--lime); color: var(--forest); }
.stores-dark .store:hover { background: #c9f76a; }
.stores-dark :focus-visible { outline-color: var(--lime); }

/* ---------- Téléphone (illustration CSS) ---------- */
.hero-visual { display: grid; place-items: center; }

.phone {
  width: min(300px, 78vw);
  aspect-ratio: 9 / 18.5;
  background: var(--forest);
  border-radius: 44px;
  padding: 10px;
  transform: rotate(4deg);
  box-shadow: 14px 14px 0 var(--sun);
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes rise {
  from { transform: translateY(48px) rotate(0deg); opacity: 0; }
  to   { transform: translateY(0) rotate(4deg); opacity: 1; }
}

.phone-screen {
  height: 100%;
  background: var(--paper);
  border-radius: 34px;
  padding: 34px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ph-title { margin: 0 0 4px; font: 800 1.5rem "Bricolage Grotesque", sans-serif; }

.ph-card {
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
}
.ph-card-sun { background: var(--sun); }
.ph-card strong { font-size: 1.05rem; }
.ph-card span { font-size: .85rem; }

.ph-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 16px;
}
.ph-person i {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--lime);
  display: grid; place-items: center;
  font: 800 1rem "Bricolage Grotesque", sans-serif;
  font-style: normal;
}
.ph-person strong { display: block; font-size: .98rem; line-height: 1.2; }
.ph-person span { font-size: .8rem; opacity: .75; }

.ph-button {
  margin-top: auto;
  background: var(--forest);
  color: var(--paper);
  text-align: center;
  padding: 14px;
  border-radius: 14px;
  font-weight: 600;
}

/* ---------- Membres ---------- */
.members {
  background: var(--paper);
  padding: clamp(56px, 9vw, 112px) var(--pad);
}

.members h2,
.members-grid { max-width: var(--max); margin-left: auto; margin-right: auto; }

.members h2 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }

.members-grid {
  margin-top: clamp(28px, 5vw, 56px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
}

.members-grid article { border-top: 4px solid var(--lime); padding-top: 20px; }
.members-grid h3 { font-size: 1.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.members-grid p { margin: 0; max-width: 32ch; }

/* ---------- Restaurateurs ---------- */
.resto {
  background: var(--forest);
  color: var(--paper);
  padding: clamp(56px, 9vw, 112px) var(--pad);
}

.resto-inner { max-width: var(--max); margin: 0 auto; }
.resto h2 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; color: var(--lime); }
.resto-lead { font-size: 1.3rem; max-width: 36ch; margin: 18px 0 28px; }

.resto ul { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 16px; max-width: 52ch; }
.resto li { padding-left: 20px; border-left: 4px solid var(--sun); }
.resto li strong { color: var(--sun); }

.btn-sun {
  display: inline-block;
  background: var(--sun);
  color: var(--forest);
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s ease;
}
.btn-sun:hover { transform: translateY(-2px); }
.resto :focus-visible { outline-color: var(--sun); }

/* ---------- CTA final ---------- */
.final {
  background: var(--forest);
  color: var(--paper);
  padding: 0 var(--pad) clamp(56px, 9vw, 112px);
}
.final h2,
.final .stores { max-width: var(--max); margin-left: auto; margin-right: auto; }
.final h2 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  padding-top: clamp(48px, 8vw, 96px);
  margin-bottom: 32px;
  border-top: 1px solid rgba(245, 251, 227, .25);
}

/* ---------- Pied de page ---------- */
.foot {
  background: var(--forest);
  color: var(--paper);
  padding: 24px var(--pad) 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  justify-content: space-between;
  font-size: .95rem;
  border-top: 1px solid rgba(245, 251, 227, .25);
}
.foot p { margin: 0; }
.foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.foot a { text-underline-offset: 3px; }
.foot :focus-visible { outline-color: var(--lime); }

/* ---------- Page légale ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.legal { background: var(--paper); }

/* En-tête de page, dans la continuité du bandeau vert */
.legal-hero {
  background: var(--lime);
  padding: clamp(16px, 4vw, 48px) var(--pad) clamp(40px, 6vw, 72px);
}
.legal-hero > * { max-width: calc(var(--max) - 2 * var(--pad)); margin-left: auto; margin-right: auto; }


.legal h1 { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 800; }

.legal-meta {
  list-style: none;
  padding: 0;
  margin-top: 24px;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .9rem;
  font-weight: 500;
}
.legal-meta li {
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 16px;
}

/* Mise en page : sommaire latéral + texte */
.legal-layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) var(--pad) clamp(56px, 9vw, 112px);
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.legal-aside {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

/* Sommaire */
.legal-toc summary {
  list-style: none;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  pointer-events: none;
}
.legal-toc summary::-webkit-details-marker { display: none; }

.legal-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }

.legal-toc a {
  display: grid;
  grid-template-columns: 1.75em 1fr;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .9rem;
  line-height: 1.35;
  text-decoration: none;
  transition: background .15s ease;
}
.toc-num { font-weight: 600; opacity: .6; }
.legal-toc a:hover { background: var(--lime-soft); }
.legal-toc a[aria-current] { background: var(--forest); color: var(--paper); }
.legal-toc a[aria-current] .toc-num { opacity: 1; color: var(--lime); }

/* Texte */
.legal-content { max-width: 70ch; min-width: 0; }

.legal-content > section + section { margin-top: clamp(48px, 7vw, 80px); }

.legal-content p,
.legal-content li,
.legal-content dd { color: #2C4436; line-height: 1.7; }

.legal-content p { margin: 0 0 16px; }
.legal-content a { color: var(--forest); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal-content a:hover { text-decoration-thickness: 2px; }

.legal h2 {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(14, 43, 27, .15);
  scroll-margin-top: 24px;
}

.legal-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.75em;
  height: 1.75em;
  margin-top: -.2em;
  border-radius: 12px;
  background: var(--lime);
  font-size: .8em;
}

.legal h3 {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 36px 0 12px;
  padding-left: 14px;
  border-left: 4px solid var(--lime);
}
.legal h2 + h3 { margin-top: 0; }

.legal h4 {
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 28px 0 8px;
}

.legal-content ul { list-style: none; margin: 0 0 20px; padding: 0; }
.legal-content li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.legal-content li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--forest);
  opacity: .55;
}

.legal-content strong { color: var(--forest); font-weight: 600; }

/* Encadré « L'essentiel » */
.legal-summary {
  background: var(--lime-soft);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px);
}
.legal-summary h2 { border-bottom: 0; padding-bottom: 0; margin-bottom: 12px; }

.essentials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 24px 0 0;
}
.essentials > div {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
}
.essentials dt { font-weight: 600; line-height: 1.3; }
.essentials dd { margin: 6px 0 0; font-size: .95rem; line-height: 1.55; }
.essentials .essentials-key { background: var(--forest); }
.essentials .essentials-key dt { color: var(--lime); }
.essentials .essentials-key dd { color: var(--paper); font-weight: 600; }

/* Tableaux */
.table-wrap {
  overflow-x: auto;
  margin: 8px 0 24px;
  background: #fff;
  border: 1px solid rgba(14, 43, 27, .12);
  border-radius: 14px;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  line-height: 1.5;
}
.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  color: #2C4436;
}
.legal thead th {
  background: var(--forest);
  color: var(--paper);
  font-weight: 600;
  font-size: .85rem;
}
.legal tbody tr + tr > * { border-top: 1px solid rgba(14, 43, 27, .1); }
.legal tbody th { color: var(--forest); font-weight: 600; width: 32%; }

/* Listes de définitions (destinataires, cookies, glossaire, annexe C) */
.legal-dl {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  margin: 8px 0 24px;
}
.legal-dl dt,
.legal-dl dd {
  padding: 14px 0;
  border-top: 1px solid rgba(14, 43, 27, .12);
}
.legal-dl dt { font-weight: 600; padding-right: 24px; line-height: 1.45; }
.legal-dl dd { margin: 0; }

/* Champs restant à compléter */
mark.todo {
  background: var(--sun);
  color: var(--forest);
  padding: 2px 6px;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Page à une colonne (sans sommaire) */
.legal-layout-single { grid-template-columns: minmax(0, 1fr); }

/* Étapes numérotées */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 24px 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.legal-content .steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 64px;
  background: #fff;
  border-radius: 14px;
}
.legal-content .steps li::before {
  content: counter(step);
  top: 14px;
  left: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  color: var(--forest);
  opacity: 1;
  font: 800 1rem "Bricolage Grotesque", sans-serif;
}

.btn-forest {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 14px 26px;
  border-radius: 14px;
  background: var(--forest);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease;
}
.legal-content .btn-forest { color: var(--paper); }
.btn-forest:hover { transform: translateY(-2px); }

.steps-cta { margin: 8px 0 20px; }
.steps-note { margin: 0; }

/* Bouton haut de page */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  box-shadow: 0 6px 20px rgba(14, 43, 27, .25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.to-top svg { width: 24px; height: 24px; fill: currentColor; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .legal-aside { position: static; max-height: none; overflow: visible; padding: 0; }
  .legal-content { max-width: none; }

  .legal-toc {
    background: #fff;
    border: 1px solid rgba(14, 43, 27, .12);
    border-radius: 14px;
  }
  .legal-toc summary {
    pointer-events: auto;
    cursor: pointer;
    margin: 0;
    min-height: 52px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .legal-toc summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
    transition: transform .15s ease;
  }
  .legal-toc[open] summary::after { transform: rotate(-135deg); }
  .legal-toc nav { padding: 0 8px 12px; }
  .legal-toc a { padding: 10px; font-size: .95rem; }
}

@media (max-width: 640px) {
  /* Tableaux affichés en cartes empilées */
  .table-wrap { overflow: visible; }
  .legal table,
  .legal tbody,
  .legal tr,
  .legal th,
  .legal td { display: block; width: auto; }
  .legal thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .legal tbody tr { padding: 14px 16px; }
  .legal tbody tr + tr > * { border-top: 0; }
  .legal tbody tr + tr { border-top: 1px solid rgba(14, 43, 27, .12); }
  .legal tbody th { padding: 0 0 8px; font-size: 1rem; }
  .legal td { padding: 4px 0; }
  .legal td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--forest);
    opacity: .7;
  }

  .legal-dl { grid-template-columns: 1fr; }
  .legal-dl dd { border-top: 0; padding-top: 0; }
  .legal-dl dt { padding-bottom: 6px; }

  .legal h2 { gap: 12px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: 2; margin-top: 16px; }
  .members-grid { grid-template-columns: 1fr; }
  .top-nav { display: none; }
}

@media (max-width: 480px) {
  .store { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phone { animation: none; }
  .store, .btn-sun, .btn-forest, .to-top, .legal-toc a, .legal-toc summary::after { transition: none; }
}
