:root {
  --accent: #0E9F73;
  --accent-soft: #0E9F731A;
  --accent-border: #0E9F7355;
  --accent-light: #5AD6A9;
  --font-sora: 'Sora';
  --font-instrument: 'Instrument Sans';
}

/* ==========================================================================
   KeyMed — landing PASS/LAS
   Design tokens et styles repris à l'identique du prototype de référence
   (landing-keymed.dc.html). Les valeurs sont finales (handoff hifi).
   ========================================================================== */

:root {
  /* Couleurs — voir README « Design Tokens » */
  --navy: #0b2545;
  --accent: #0e9f73;
  --accent-soft: #0e9f731a; /* accent à 10 % */
  --accent-border: #0e9f7355; /* accent à 33 % */
  --accent-light: #5ad6a9;

  --bg: #f6f8fa;
  --card: #ffffff;

  --text: #122033;
  --text-2: #3a4a5e;
  --text-muted: #8593a5;
  --text-on-dark: #c7d3e3;
  --price-old: #8fa0b5;

  --border: #e3e9f0;
  --border-input: #c9d3df;

  --page-max: 680px;
  /* Marge latérale du contenu. Partagée par le hero et les sections pour
     qu'ils s'alignent quelle que soit la largeur. */
  --gutter: 24px;

  --font-heading: var(--font-sora), sans-serif;
  --font-body: var(--font-instrument), sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy);
}

a:hover {
  color: #0fa47a;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Reveal au scroll (IntersectionObserver, threshold 0.12, joué une seule fois)
   La classe `js` est posée par un script inline dans <head> : sans JS, aucune
   section n'est masquée.
   -------------------------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js [data-reveal]:not(.is-visible) {
  opacity: 0;
}

.js [data-reveal].is-visible {
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js [data-reveal]:not(.is-visible),
  .js [data-reveal].is-visible {
    opacity: 1;
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Structure
   -------------------------------------------------------------------------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-bottom: 96px; /* réserve pour la barre CTA sticky */
}

/* Pages sans barre sticky (/merci) : pas de réserve à prévoir. */
.page--standalone {
  padding-bottom: 24px;
}

.section {
  padding: 56px var(--gutter) 8px;
  scroll-margin-top: 24px;
}

.section--guarantee {
  padding: 48px var(--gutter) 8px;
}

.section--final {
  padding: 56px var(--gutter) 64px;
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack--8 {
  gap: 8px;
}
.stack--10 {
  gap: 10px;
}
.stack--12 {
  gap: 12px;
}
.stack--14 {
  gap: 14px;
}
.stack--16 {
  gap: 16px;
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
  text-wrap: pretty;
}

.eyebrow + .h2 {
  margin-top: 10px;
}

.lede {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 14px 0 0;
  text-wrap: pretty;
}

.note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 0;
}

/* Seule la mention sous le formulaire est interlignée (cf. prototype). */
.lead .note {
  line-height: 1.5;
}

.note--xs {
  font-size: 12px;
  margin: 10px 0 0;
}

/* --------------------------------------------------------------------------
   Boutons / CTA
   -------------------------------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, filter 0.18s ease;
}

/* Plein accent (CTA « hard ») */
.btn--primary {
  background: var(--accent);
  color: #ffffff;
  font-size: 17px;
  padding: 16px 24px;
}

.btn--primary:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

.btn--primary-lg {
  padding: 17px 24px;
}

.btn--primary-sm {
  font-size: 16px;
  padding: 15px 20px;
  border-radius: 12px;
}

/* Outline blanc sur fond sombre (CTA « soft » du hero) */
.btn--ghost {
  background: transparent;
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  padding: 15px 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.btn--ghost:hover {
  color: #ffffff;
  border-color: #ffffff;
}

/* Outline bleu profond (CTA « soft » sur fond clair) */
.btn--outline {
  background: transparent;
  color: var(--navy);
  font-size: 16px;
  padding: 15px 24px;
  border: 1.5px solid var(--navy);
}

.btn--outline:hover {
  background: var(--navy);
  color: #ffffff;
}

.btn--outline-sm {
  font-size: 15px;
  padding: 13px 20px;
  border-radius: 12px;
}

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */

.hero {
  background: var(--navy);
  color: #ffffff;
  padding: 56px var(--gutter) 48px;
  border-radius: 0 0 28px 28px;
}

/* Le hero est hors de `.page` pour que son fond aille d'un bord à l'autre ;
   ce conteneur réaligne son contenu sur la colonne de lecture. */
.hero__inner {
  max-width: calc(var(--page-max) - 2 * var(--gutter));
  margin: 0 auto;
}

.hero__badge {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.15;
  font-weight: 800;
  margin: 22px 0 0;
  text-wrap: pretty;
}

.hero__subtitle {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-on-dark);
  margin: 18px 0 0;
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

/* Aperçu de fiche sous les CTA — deux pages réelles du poly UE3, inclinées.
   Les images sont dans public/fiches/ (voir components/Hero.tsx). */

.hero__peek {
  position: relative;
  height: 214px;
  margin-top: 26px;
}

.peek-card {
  position: absolute;
  width: 150px;
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.peek-card__img {
  display: block;
  width: 100%;
  height: auto;
}

.peek-card--back {
  top: 16px;
  left: 50%;
  transform: translateX(-92%) rotate(-7deg);
  opacity: 0.9;
}

.peek-card--front {
  top: 4px;
  left: 50%;
  transform: translateX(-8%) rotate(5deg);
}

/*
  Entrée du hero : les éléments apparaissent en cascade au chargement, avec la
  même animation `rise` que le reveal au scroll. 100 % CSS (aucun JS), et
  `both` masque chaque élément avant son tour sans le cacher aux robots.
  Toute la règle est sous `no-preference` : en mouvement réduit, le hero
  s'affiche directement, sans état intermédiaire.
*/
@media (prefers-reduced-motion: no-preference) {
  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__actions > *,
  .hero__peek {
    animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .hero__title {
    animation-delay: 0.08s;
  }

  .hero__subtitle {
    animation-delay: 0.16s;
  }

  .hero__actions > *:nth-child(1) {
    animation-delay: 0.24s;
  }

  .hero__actions > *:nth-child(2) {
    animation-delay: 0.3s;
  }

  /* Les fiches ferment la cascade, une fois les CTA posés. */
  .hero__peek {
    animation-delay: 0.38s;
  }
}

/* --------------------------------------------------------------------------
   2. Agitation
   -------------------------------------------------------------------------- */

.pain-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
}

.punchline {
  font-size: 17px;
  line-height: 1.55;
  margin: 24px 0 0;
  font-weight: 600;
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   3. Le pont
   -------------------------------------------------------------------------- */

.benefit {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.benefit__check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

.benefit__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   4. Mécanisme — 3 piliers
   -------------------------------------------------------------------------- */

.pillar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.pillar__index {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.pillar__title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  margin: 8px 0 0;
}

.pillar__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 10px 0 0;
}

/* --------------------------------------------------------------------------
   5. Preuve sociale
   -------------------------------------------------------------------------- */

.stats {
  background: var(--navy);
  border-radius: 20px;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  text-align: center;
}

.stats__value {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
}

.stats__value--accent {
  color: var(--accent-light);
}

.stats__label {
  font-size: 13px;
  color: var(--text-on-dark);
  line-height: 1.4;
  margin-top: 4px;
}

.testimonials {
  margin-top: 20px;
}

.testimonial {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.testimonial__quote {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

.testimonial__author {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.testimonial__meta {
  font-weight: 500;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. Appartenance — deux pages réelles du poly UE3
   (images dans public/fiches/, voir components/Belonging.tsx)
   -------------------------------------------------------------------------- */

.mockups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.mockup {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(11, 37, 69, 0.12);
}

.mockup__img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   7. Offre — value stack
   -------------------------------------------------------------------------- */

.pack {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.pack--featured {
  background: var(--navy);
  border: none;
  color: #ffffff;
  position: relative;
}

.pack__badge {
  margin: 0;
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
}

.pack__name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.pack--featured .pack__name {
  margin-top: 6px;
}

.pack__pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 0;
}

.pack__price {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
}

.pack__price-old {
  font-size: 17px;
  color: var(--price-old);
  text-decoration: line-through;
}

.pack__features {
  margin: 14px 0 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
}

.pack--featured .pack__features {
  color: var(--text-on-dark);
}

.pack .btn {
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   8. Renversement du risque
   -------------------------------------------------------------------------- */

.guarantee {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 28px 24px;
}

.guarantee__row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.guarantee__row + .guarantee__row {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--accent-border);
}

.guarantee__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-heading);
}

.guarantee__title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.guarantee__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 10px 0 0;
}

/* --------------------------------------------------------------------------
   9. Aimant à prospects
   -------------------------------------------------------------------------- */

.lead {
  background: var(--card);
  border: 2px solid var(--navy);
  border-radius: 22px;
  padding: 32px 24px;
}

.lead__title {
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
}

.lead__body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 12px 0 0;
  text-wrap: pretty;
}

.lead__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.lead__input {
  font-family: inherit;
  font-size: 16px;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-input);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.lead__input::placeholder {
  color: var(--text-muted);
}

.lead__input:focus {
  border-color: var(--navy);
  background: #ffffff;
}

/* Pot de miel anti-spam : hors écran, jamais annoncé, jamais tabulable. */
.lead__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead__submit:disabled {
  opacity: 0.7;
  cursor: progress;
  filter: none;
}

.lead__success {
  margin: 22px 0 0;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.lead__error {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #c0392b;
}

/* --------------------------------------------------------------------------
   10. FAQ
   -------------------------------------------------------------------------- */

.faq__title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}

.faq-item summary {
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 12px 0 0;
}

/* --------------------------------------------------------------------------
   11. CTA final
   -------------------------------------------------------------------------- */

.final-cta {
  background: var(--navy);
  color: #ffffff;
  border-radius: 24px;
  padding: 44px 28px;
  text-align: center;
}

.final-cta__title {
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0;
  text-wrap: pretty;
}

.final-cta__body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-on-dark);
  margin: 16px 0 0;
  text-wrap: pretty;
}

.final-cta .btn {
  margin-top: 26px;
}

/* --------------------------------------------------------------------------
   Barre CTA sticky
   -------------------------------------------------------------------------- */

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
}

.sticky-cta__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.sticky-cta .btn {
  width: auto;
  font-size: 14px;
  padding: 14px 8px;
  border-radius: 12px;
}

.sticky-cta__soft {
  flex: 1;
}

.sticky-cta__hard {
  flex: 1.4;
}

/* ==========================================================================
   ORDINATEUR — à partir de 1000 px
   Le handoff décrit une colonne unique de 680 px, pensée mobile. Telle quelle
   sur un grand écran, la page ressemble à une maquette de téléphone posée sur
   du gris. Ici : fond du hero d'un bord à l'autre, contenu sur deux colonnes,
   et les séries de trois cartes passent côte à côte. Les blocs de texte
   restent étroits — au-delà de ~65 caractères la lecture décroche.
   ========================================================================== */

@media (min-width: 1000px) {
  :root {
    --page-max: 1080px;
    --gutter: 40px;
  }

  .page {
    padding-bottom: 48px; /* plus de barre sticky à compenser */
  }

  .section {
    padding-top: 84px;
  }

  .section--guarantee {
    padding-top: 72px;
  }

  .section--final {
    padding-top: 84px;
    padding-bottom: 96px;
  }

  /* Largeur de lecture. Attention au `ch` : il vaut la largeur du « 0 » dans
     la police de l'élément, donc 62ch sur un titre de 26 px fait ~1000 px et
     ne borne rien. Les titres sont donc bornés en pixels, le corps en ch. */
  .h2,
  .faq__title {
    max-width: 640px;
  }

  .lede,
  .punchline,
  .note,
  .benefit__text {
    max-width: 62ch;
  }

  /* --- Hero ------------------------------------------------------------- */

  .hero {
    padding-top: 76px;
    padding-bottom: 68px;
    border-radius: 0 0 40px 40px;
  }

  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    /* Rangées déclarées explicitement : sans elles, le `1 / -1` de l'aperçu
       retomberait sur la première ligne et n'occuperait qu'une rangée.
       Une par élément de la colonne de gauche : badge, titre, sous-titre, CTA. */
    grid-template-rows: repeat(4, auto);
    column-gap: 56px;
    align-items: center;
  }

  .hero__badge,
  .hero__title,
  .hero__subtitle,
  .hero__actions {
    grid-column: 1;
  }

  .hero__badge {
    justify-self: start;
  }

  .hero__title {
    font-size: 46px;
    max-width: 15ch;
  }

  .hero__subtitle {
    max-width: 46ch;
  }

  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
  }

  .hero__actions .btn {
    width: auto;
    min-width: 232px;
  }

  /* L'aperçu de fiche occupe la colonne de droite sur toute la hauteur. */
  .hero__peek {
    grid-column: 2;
    grid-row: 1 / -1;
    height: 320px;
    margin-top: 0;
  }

  .peek-card {
    width: 200px;
    border-radius: 12px;
  }

  .peek-card--back {
    top: 24px;
  }

  .peek-card--front {
    top: 6px;
  }

  /* --- Séries de trois cartes ------------------------------------------- */

  .cols-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  /* Les packs ont des listes de longueurs différentes : on colle les CTA en
     bas de carte pour qu'ils s'alignent. */
  .packs .pack {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .packs .pack .btn {
    margin-top: auto;
    padding-top: 15px;
  }

  .packs .pack__features {
    margin-bottom: 22px;
  }

  /* --- Blocs qui restent étroits ---------------------------------------- */

  .guarantee,
  .lead,
  .faq-item,
  .final-cta {
    max-width: 820px;
  }

  /* Deux pages de poly côte à côte : au-delà, elles écrasent la section. */
  .mockups {
    max-width: 620px;
  }

  .final-cta {
    margin: 0 auto;
    padding: 60px 48px;
  }

  .final-cta__title {
    font-size: 34px;
    max-width: 22ch;
    margin-left: auto;
    margin-right: auto;
  }

  .final-cta__body {
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
  }

  /* CTA hors hero : un bouton de 1080 px de large n'a pas de sens. */
  .section > .btn,
  .final-cta .btn,
  .lead__submit {
    max-width: 340px;
  }

  .final-cta .btn {
    margin-left: auto;
    margin-right: auto;
  }

  .lead__form {
    max-width: 520px;
  }

  /* --- Barre sticky : motif mobile ------------------------------------- */

  .sticky-cta {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Accessibilité
   -------------------------------------------------------------------------- */

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