/* ============================================================================
   KIT DE PRODUCTION — Design system codé (source unique de vérité)
   Système de création de sites · WCAG 2.2 AA · mobile-first · zéro dépendance
   ----------------------------------------------------------------------------
   SOMMAIRE
   1. Tokens (variables)        6. Layout & utilitaires
   2. Reset & bases             7. Sections (hero, bénéfices, etc.)
   3. Accessibilité             8. États & responsive
   4. Boutons                   9. Préférences utilisateur
   5. Composants (form, card, accordéon, header, footer…)
   ----------------------------------------------------------------------------
   USAGE : <link rel="stylesheet" href="kit.css">
   Personnaliser une marque = surcharger les tokens (§1) dans un fichier à part.
   ============================================================================ */

/* ---- 1. TOKENS ----------------------------------------------------------- */
:root {
  /* Couleurs de marque (contrastes AA vérifiés sur fond clair) */
  --c-primary: #1d4ed8;
  --c-primary-dark: #1739a8;
  --c-primary-light: #eff6ff;
  --c-accent: #d97706;          /* réservé aux CTA */
  --c-accent-dark: #b45309;

  /* Neutres */
  --c-ink: #0f172a;             /* titres / texte fort */
  --c-body: #334155;            /* texte courant */
  --c-muted: #64748b;           /* texte tertiaire (AA sur blanc) */
  --c-line: #e2e8f0;            /* bordures */
  --c-bg: #ffffff;
  --c-bg-alt: #f1f5f9;
  --c-surface: #ffffff;        /* fond des cartes/composants (clé du dark mode & des thèmes) */
  --c-surface-glass: rgba(255,255,255,.9); /* en-tête translucide */
  --c-bg-dark: #0f172a;

  /* Sémantiques */
  --c-success: #15803d;
  --c-warning: #b45309;
  --c-danger: #b91c1c;

  /* Espacement (échelle 4 / 8 px) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.25rem;
  --s-6: 1.5rem; --s-8: 2rem; --s-10: 2.5rem; --s-12: 3rem; --s-16: 4rem; --s-24: 6rem;

  /* Typo */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font);
  --fs-body: 1.0625rem;          /* 17px */

  /* Forme */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 10px 30px -12px rgba(15,23,42,.25);
  --shadow-lg: 0 24px 48px -16px rgba(15,23,42,.30);

  /* Layout */
  --maxw: 1120px;
  --maxw-narrow: 760px;
}

/* ---- 2. RESET & BASES ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--c-body);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--c-ink); line-height: 1.2; margin: 0 0 var(--s-4); }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.2em; }
strong, b { color: var(--c-ink); font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-8) 0; }

/* ---- 3. ACCESSIBILITÉ ---------------------------------------------------- */
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: var(--s-4); top: -100px;
  background: var(--c-ink); color: #fff; padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm); z-index: 100; transition: top .2s; text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }
.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;
}

/* ---- 4. BOUTONS ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-weight: 700; text-decoration: none; cursor: pointer; text-align: center;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: var(--s-3) var(--s-6); font-size: 1rem; line-height: 1.2;
  min-height: 44px; /* cible tactile */
  transition: transform .08s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-accent); color: #fff; box-shadow: 0 6px 18px -6px rgba(217,119,6,.6); }
.btn-primary:hover { background: var(--c-accent-dark); color: #fff; }
.btn-secondary { background: var(--c-primary); color: #fff; }
.btn-secondary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-primary); border-color: var(--c-line); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-lg { padding: var(--s-4) var(--s-8); font-size: 1.0625rem; }
.btn-sm { padding: var(--s-2) var(--s-4); font-size: .95rem; min-height: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---- 5. COMPOSANTS ------------------------------------------------------- */

/* Formulaires */
.field { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.field label { font-weight: 600; color: var(--c-ink); }
.field .req { color: var(--c-accent); }
.field input, .field textarea, .field select {
  font: inherit; width: 100%; padding: var(--s-3) var(--s-4);
  border: 2px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-ink);
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { border-color: var(--c-primary); outline-offset: 0; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.field-error { color: var(--c-danger); font-size: .9rem; font-weight: 600; }
.field-hint { color: var(--c-muted); font-size: .9rem; }
.form-note { display: flex; align-items: center; justify-content: center; gap: var(--s-2); color: var(--c-muted); font-size: .9rem; margin: var(--s-2) 0 0; }
.honeypot { position: absolute; left: -5000px; } /* anti-spam */

/* Cartes */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-8); box-shadow: var(--shadow-sm); }
.card-hover { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* Badges & puces */
.badge { display: inline-flex; align-items: center; gap: .4em; font-size: .8rem; font-weight: 700; padding: .25em .7em; border-radius: var(--radius-pill); background: var(--c-bg-alt); color: var(--c-muted); }
.badge-primary { background: var(--c-primary-light); color: var(--c-primary); }
.badge-accent { background: #fff7ed; color: var(--c-accent-dark); }
.eyebrow { color: var(--c-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; margin-bottom: var(--s-3); }

/* Accordéon / FAQ (natif <details>, sans JS) */
.faq { display: grid; gap: var(--s-3); }
.faq details { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: var(--s-4) var(--s-6); }
.faq summary { font-weight: 700; color: var(--c-ink); cursor: pointer; list-style: none; padding-right: var(--s-6); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: -2px; font-size: 1.4rem; color: var(--c-primary); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: var(--s-3) 0 0; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--c-surface-glass); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--c-line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-3); }
.logo { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; }
.logo-text { font-weight: 800; font-size: 1.3rem; color: var(--c-ink); letter-spacing: -.02em; }
.logo-text-light { color: #fff; }
.main-nav { display: flex; align-items: center; gap: var(--s-6); }
.main-nav a { color: var(--c-body); text-decoration: none; font-weight: 600; }
.main-nav a:hover { color: var(--c-primary); }

/* Pied de page */
.site-footer { background: var(--c-bg-dark); color: #cbd5e1; padding: var(--s-12) 0 var(--s-8); margin-top: var(--s-8); }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--s-6); justify-content: space-between; align-items: flex-start; }
.footer-tag { color: #94a3b8; margin: var(--s-2) 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--s-6); }
.footer-nav a { color: #cbd5e1; text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-legal { color: #64748b; font-size: .85rem; margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid #1e293b; }

/* ---- 6. LAYOUT & UTILITAIRES -------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-6); }
.narrow { max-width: var(--maxw-narrow); margin-left: auto; margin-right: auto; }
.section { padding: var(--s-16) 0; }
.section-sm { padding: var(--s-12) 0; }
.section-alt { background: var(--c-bg-alt); }
.section-dark { background: var(--c-bg-dark); color: #cbd5e1; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-intro { font-size: 1.1rem; color: var(--c-body); }

/* Helpers */
.center { text-align: center; }
.muted { color: var(--c-muted); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; color: var(--c-body); max-width: 56ch; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: var(--s-4); }

/* Grilles auto-responsive */
.grid { display: grid; gap: var(--s-6); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---- 7. SECTIONS --------------------------------------------------------- */

/* Hero */
.hero { padding: var(--s-12) 0 var(--s-16); background: linear-gradient(180deg, var(--c-bg-alt), var(--c-bg)); }
.hero-grid { display: grid; gap: var(--s-12); align-items: center; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-6) 0 var(--s-4); }
.hero-reassure { display: flex; align-items: center; gap: var(--s-2); color: var(--c-success); font-weight: 600; font-size: .95rem; }
.hero-reassure svg { flex: none; }
.hero-visual { position: relative; min-height: 280px; display: grid; place-items: center; }

/* Bande de confiance */
.trust { padding: var(--s-8) 0; border-block: 1px solid var(--c-line); background: var(--c-bg); }
.trust-label { text-align: center; color: var(--c-muted); font-size: .9rem; margin-bottom: var(--s-4); }
.trust-logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4) var(--s-8); }
.trust-logos li { color: var(--c-muted); font-weight: 700; opacity: .8; }

/* Liste de douleurs / points */
.feature-list { list-style: none; margin: var(--s-6) 0; padding: 0; display: grid; gap: var(--s-3); }
.feature-list li { display: flex; gap: var(--s-3); align-items: flex-start; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: var(--s-4); }

/* Bénéfices */
.benefit { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-8); box-shadow: var(--shadow-sm); }
.benefit-icon { font-size: 1.8rem; width: 56px; height: 56px; display: grid; place-items: center; background: var(--c-bg-alt); border-radius: var(--radius-sm); margin-bottom: var(--s-4); }
.benefit p { margin: 0; }

/* Étapes */
.steps { list-style: none; margin: var(--s-8) 0; padding: 0; display: grid; gap: var(--s-6); counter-reset: step; }
.step { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-8); }
.step-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-primary); color: #fff; font-weight: 800; font-size: 1.2rem; margin-bottom: var(--s-4); }
.step p { margin: 0; }

/* Témoignages */
.testimonial { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-8); margin: 0; }
.stars { color: var(--c-accent); letter-spacing: 2px; margin-bottom: var(--s-3); }
.testimonial blockquote { margin: 0 0 var(--s-4); font-size: 1.05rem; color: var(--c-ink); }
.testimonial figcaption { color: var(--c-muted); font-weight: 600; }

/* Tarifs / formules */
.pricing { display: grid; gap: var(--s-6); }
.plan { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-8); display: flex; flex-direction: column; }
.plan.is-featured { border-color: var(--c-primary); border-width: 2px; box-shadow: var(--shadow); position: relative; }
.plan-price { font-size: 2.4rem; font-weight: 800; color: var(--c-ink); margin: var(--s-2) 0; }
.plan-price small { font-size: 1rem; font-weight: 600; color: var(--c-muted); }
.plan ul { list-style: none; padding: 0; margin: var(--s-4) 0; display: grid; gap: var(--s-2); }
.plan li { display: flex; gap: var(--s-2); align-items: flex-start; }
.plan li::before { content: "✓"; color: var(--c-success); font-weight: 800; }
.plan .btn { margin-top: auto; }

/* Garantie */
.guarantee { text-align: center; background: var(--c-surface); border: 2px solid var(--c-line); border-radius: var(--radius); padding: var(--s-12); }
.guarantee-badge { width: 84px; height: 84px; border-radius: 50%; background: var(--c-success); color: #fff; font-weight: 800; font-size: 1.5rem; display: grid; place-items: center; margin: 0 auto var(--s-6); }
.guarantee p { margin: 0 auto; max-width: 52ch; }

/* CTA final */
.cta-final { background: linear-gradient(180deg, var(--c-primary-light), var(--c-bg)); }
.cta-band { background: var(--c-primary); color: #fff; border-radius: var(--radius); padding: var(--s-12); text-align: center; }
.cta-band h2 { color: #fff; }

/* CTA collant mobile (pattern DTC : Gymshark & co — voir audit-sites-reference)
   Barre d'action persistante en bas d'écran sur mobile. Masquée sur desktop. */
.sticky-cta { display: none; }
@media (max-width: 767px) {
  .sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; align-items: center; gap: var(--s-3);
    background: var(--c-surface); border-top: 1px solid var(--c-line);
    box-shadow: 0 -8px 24px -12px rgba(15,23,42,.25);
    padding: var(--s-3) var(--s-4);
  }
  .sticky-cta .sticky-info { flex: 1; min-width: 0; }
  .sticky-cta .sticky-info strong { display: block; color: var(--c-ink); font-size: .95rem; }
  .sticky-cta .sticky-info small { color: var(--c-muted); }
  .sticky-cta .btn { flex: none; }
  /* Évite que la barre masque le contenu / le footer */
  body.has-sticky-cta { padding-bottom: 76px; }
}

/* ---- 8. ÉTATS & RESPONSIVE ---------------------------------------------- */
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
}
@media (min-width: 1024px) {
  .hero-grid.has-visual { grid-template-columns: 1.1fr .9fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---- 9. PRÉFÉRENCES UTILISATEUR ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- 10. DARK MODE & VARIANTES DE SECTIONS ------------------------------ */
/* Dark mode : activer via <html data-theme="dark"> (toggle = theme-toggle.js)
   ou automatiquement selon la préférence système (bloc @media plus bas). */
[data-theme="dark"] {
  --c-ink: #f1f5f9; --c-body: #cbd5e1; --c-muted: #94a3b8;
  --c-line: #1e293b; --c-bg: #0b1220; --c-bg-alt: #111c30;
  --c-surface: #1e293b; --c-surface-glass: rgba(15,23,42,.85);
  --c-primary-light: #15233f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
}
[data-theme="dark"] .badge-accent { background: #3a2a12; }
[data-theme="dark"] .badge-primary { background: #15233f; }

/* Dark mode automatique (si aucun data-theme posé manuellement) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --c-ink: #f1f5f9; --c-body: #cbd5e1; --c-muted: #94a3b8;
    --c-line: #1e293b; --c-bg: #0b1220; --c-bg-alt: #111c30;
    --c-surface: #1e293b; --c-surface-glass: rgba(15,23,42,.85);
    --c-primary-light: #15233f;
  }
}

/* Bouton de bascule de thème (optionnel) */
.theme-toggle { background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-ink);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; font-size: 1.1rem; }

/* Variantes de hero */
.hero-centered { text-align: center; }
.hero-centered .lead, .hero-centered .hero-cta { margin-left: auto; margin-right: auto; }
.hero-centered .hero-cta { justify-content: center; }
.hero-image { position: relative; color: #fff; }
.hero-image::before { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(15,23,42,.55), rgba(15,23,42,.75)); z-index:0; }
.hero-image > .container { position: relative; z-index: 1; }
.hero-image h1, .hero-image .lead { color: #fff; }

/* Variante section bordée / encadré */
.section-bordered { border-block: 1px solid var(--c-line); }
.callout { background: var(--c-primary-light); border-left: 4px solid var(--c-primary); border-radius: var(--radius-sm); padding: var(--s-6); }

/* Variante grille bénéfices « ligne » (icône à gauche) */
.benefit-row { display: flex; gap: var(--s-4); text-align: left; }
.benefit-row .benefit-icon { margin-bottom: 0; flex: none; }
