/* ═══════════════════════════════════════════════════════════════════════
   VINGT MILLE — Composants (design system « Lagon »)
   Dépend de tokens.css. Préfixe : .vm-
   Documentation et règles d'usage : design-system/index.html
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--vm-font-body);
  font-size: var(--vm-text-m);
  line-height: var(--vm-leading-base);
  color: var(--vm-text);
  background: var(--vm-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 {
  font-family: var(--vm-font-display);
  font-weight: var(--vm-weight-regular);
  line-height: var(--vm-leading-tight);
  color: var(--vm-encre);
  margin: 0 0 var(--vm-space-4);
  text-wrap: balance;
}
h1 { font-size: var(--vm-text-3xl); letter-spacing: -0.01em; }
h2 { font-size: var(--vm-text-2xl); }
h3 { font-size: var(--vm-text-xl); }
h4 { font-size: var(--vm-text-m); font-weight: var(--vm-weight-bold); margin: 0 0 var(--vm-space-2); }
p  { margin: 0 0 var(--vm-space-4); color: var(--vm-text-soft); }
p strong, li strong { color: var(--vm-text); }
:focus-visible {
  outline: 3px solid var(--vm-focus);
  outline-offset: 2px;
  border-radius: var(--vm-radius-s);
}
::selection { background: var(--vm-eau-200); color: var(--vm-encre); }

/* ── Mise en page ──────────────────────────────────────────────────────── */
.vm-container { max-width: var(--vm-container); margin-inline: auto; padding-inline: var(--vm-gutter); }
.vm-container--text { max-width: var(--vm-container-text); }
.vm-section { padding-block: var(--vm-space-9); position: relative; }
.vm-section--alt { background: var(--vm-bg-alt); }
.vm-grid { display: grid; gap: var(--vm-space-5); }
@media (min-width: 48rem) {
  .vm-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .vm-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .vm-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Liens ─────────────────────────────────────────────────────────────── */
.vm-link {
  color: var(--vm-link);
  font-weight: var(--vm-weight-semibold);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--vm-eau-200);
  transition: text-decoration-color var(--vm-dur-fast) var(--vm-ease);
}
.vm-link:hover { text-decoration-color: var(--vm-lagon-500); }

/* ── Boutons ───────────────────────────────────────────────────────────── */
/* Cible tactile ≥ 44px garantie. Un seul bouton primaire par vue. */
.vm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--vm-space-2);
  min-height: 44px;
  padding: 0.7em 1.5em;
  border: 2px solid transparent;
  border-radius: var(--vm-radius-m);
  font: var(--vm-weight-bold) var(--vm-text-m) var(--vm-font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--vm-dur-fast) var(--vm-ease-spring),
              box-shadow var(--vm-dur-fast) var(--vm-ease),
              background-color var(--vm-dur-fast) var(--vm-ease);
}
.vm-btn:hover { transform: translateY(-2px); }
.vm-btn:active { transform: translateY(0); }
.vm-btn--primary { background: var(--vm-cta); color: var(--vm-cta-ink); box-shadow: var(--vm-shadow-s); }
.vm-btn--primary:hover { background: var(--vm-corail-300); box-shadow: var(--vm-shadow-m); }
.vm-btn--secondary { background: transparent; color: var(--vm-lagon-700); border-color: var(--vm-lagon-500); }
.vm-btn--secondary:hover { background: var(--vm-eau-050); }
.vm-btn--ghost { background: transparent; color: var(--vm-lagon-700); }
.vm-btn--ghost:hover { background: var(--vm-eau-050); transform: none; }
.vm-btn--l { font-size: var(--vm-text-l); padding: 0.8em 1.9em; border-radius: var(--vm-radius-l); }
.vm-btn[disabled], .vm-btn[aria-disabled="true"] {
  opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.vm-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--vm-space-1);
  padding: 0.25em 0.85em;
  border-radius: var(--vm-radius-full);
  font-size: var(--vm-text-xs);
  font-weight: var(--vm-weight-bold);
  letter-spacing: 0.02em;
  background: var(--vm-eau-100); color: var(--vm-lagon-900);
}
.vm-badge--corail { background: var(--vm-corail-100); color: var(--vm-corail-700); }
.vm-badge--soleil { background: var(--vm-soleil-100); color: var(--vm-soleil-ink); }
.vm-badge--ok     { background: var(--vm-ok-bg); color: var(--vm-ok-ink); }
.vm-badge--alerte { background: var(--vm-alerte-bg); color: var(--vm-alerte-ink); }
.vm-badge--erreur { background: var(--vm-erreur-bg); color: var(--vm-erreur-ink); }

/* ── Cartes ────────────────────────────────────────────────────────────── */
.vm-card {
  background: var(--vm-surface);
  border: 1px solid var(--vm-border-soft);
  border-radius: var(--vm-radius-l);
  padding: var(--vm-space-6);
  box-shadow: var(--vm-shadow-s);
  transition: transform var(--vm-dur-base) var(--vm-ease), box-shadow var(--vm-dur-base) var(--vm-ease);
}
.vm-card--lift:hover { transform: translateY(-4px); box-shadow: var(--vm-shadow-m); }
.vm-card__icon {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--vm-radius-m);
  background: var(--vm-eau-100);
  margin-bottom: var(--vm-space-4);
  font-size: 1.6rem;
}
.vm-card--pricing { display: flex; flex-direction: column; gap: var(--vm-space-3); }
.vm-card--featured { border: 2px solid var(--vm-lagon-500); box-shadow: var(--vm-shadow-m); position: relative; }
.vm-price { font-family: var(--vm-font-display); font-size: var(--vm-text-2xl); color: var(--vm-encre); }
.vm-price small { font-family: var(--vm-font-body); font-size: var(--vm-text-s); color: var(--vm-text-soft); font-weight: var(--vm-weight-semibold); }
.vm-card--pricing ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.vm-card--pricing li {
  padding: var(--vm-space-2) 0 var(--vm-space-2) 1.8em;
  position: relative;
  color: var(--vm-text-soft);
  border-bottom: 1px dashed var(--vm-border-soft);
  font-size: var(--vm-text-s);
}
.vm-card--pricing li::before { content: "✓"; position: absolute; left: 0.2em; color: var(--vm-lagon-700); font-weight: var(--vm-weight-bold); }
.vm-card--pricing li.is-off { opacity: 0.5; }
.vm-card--pricing li.is-off::before { content: "—"; }

/* ── Bascule (mensuel / annuel, segmented control) ────────────────────── */
.vm-toggle {
  display: inline-flex;
  background: var(--vm-eau-100);
  border-radius: var(--vm-radius-full);
  padding: 4px;
  gap: 2px;
}
.vm-toggle button {
  min-height: 40px;
  padding: 0.35em 1.3em;
  border: 0;
  border-radius: var(--vm-radius-full);
  background: transparent;
  font: var(--vm-weight-bold) var(--vm-text-s) var(--vm-font-body);
  color: var(--vm-lagon-900);
  cursor: pointer;
  transition: background-color var(--vm-dur-fast) var(--vm-ease), box-shadow var(--vm-dur-fast) var(--vm-ease);
}
.vm-toggle button[aria-pressed="true"] { background: var(--vm-surface); box-shadow: var(--vm-shadow-s); color: var(--vm-encre); }

/* ── Formulaires ───────────────────────────────────────────────────────── */
.vm-field { display: grid; gap: var(--vm-space-2); margin-bottom: var(--vm-space-5); }
.vm-field > label { font-weight: var(--vm-weight-bold); color: var(--vm-encre); }
.vm-input, .vm-select, .vm-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6em 1em;
  border: 2px solid var(--vm-border);
  border-radius: var(--vm-radius-s);
  background: var(--vm-surface);
  font: var(--vm-text-m) var(--vm-font-body);
  color: var(--vm-encre);
  transition: border-color var(--vm-dur-fast) var(--vm-ease);
}
.vm-textarea { min-height: 120px; resize: vertical; }
.vm-input::placeholder, .vm-textarea::placeholder { color: var(--vm-encre-faint); }
.vm-input:hover, .vm-select:hover, .vm-textarea:hover { border-color: var(--vm-eau-200); }
.vm-input:focus-visible, .vm-select:focus-visible, .vm-textarea:focus-visible {
  outline: none; border-color: var(--vm-lagon-500); box-shadow: var(--vm-ring);
}
.vm-field__hint { font-size: var(--vm-text-xs); color: var(--vm-text-soft); }
.vm-field--error .vm-input, .vm-field--error .vm-select, .vm-field--error .vm-textarea { border-color: var(--vm-erreur-ink); }
.vm-field__error { font-size: var(--vm-text-xs); font-weight: var(--vm-weight-bold); color: var(--vm-erreur-ink); }
.vm-check {
  display: flex; align-items: flex-start; gap: var(--vm-space-3);
  padding-block: var(--vm-space-1); cursor: pointer; color: var(--vm-text-soft);
}
.vm-check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--vm-lagon-700); cursor: pointer; }

/* ── Alertes ───────────────────────────────────────────────────────────── */
.vm-alert {
  display: flex; gap: var(--vm-space-3); align-items: flex-start;
  padding: var(--vm-space-4) var(--vm-space-5);
  border-radius: var(--vm-radius-m);
  font-size: var(--vm-text-s);
  background: var(--vm-eau-050); color: var(--vm-lagon-900);
  border: 1px solid var(--vm-eau-200);
}
.vm-alert--ok     { background: var(--vm-ok-bg);     color: var(--vm-ok-ink);     border-color: transparent; }
.vm-alert--alerte { background: var(--vm-alerte-bg); color: var(--vm-alerte-ink); border-color: transparent; }
.vm-alert--erreur { background: var(--vm-erreur-bg); color: var(--vm-erreur-ink); border-color: transparent; }

/* ── Tableaux ──────────────────────────────────────────────────────────── */
.vm-table { width: 100%; border-collapse: collapse; font-size: var(--vm-text-s); }
.vm-table th {
  text-align: left; padding: var(--vm-space-3) var(--vm-space-4);
  font-size: var(--vm-text-xs); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--vm-text-soft); border-bottom: 2px solid var(--vm-border);
}
.vm-table td { padding: var(--vm-space-3) var(--vm-space-4); border-bottom: 1px solid var(--vm-border-soft); color: var(--vm-text-soft); }
.vm-table td:first-child { color: var(--vm-text); font-weight: var(--vm-weight-semibold); }
.vm-table tr:hover td { background: var(--vm-eau-050); }

/* ── Navigation (en-tête) ──────────────────────────────────────────────── */
.vm-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--vm-ecume) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vm-border-soft);
}
.vm-nav__inner { display: flex; align-items: center; gap: var(--vm-space-5); min-height: 72px; }
.vm-nav__logo { display: flex; align-items: center; }
.vm-nav__logo img { height: 40px; width: auto; }
.vm-nav__links { display: none; margin-left: auto; align-items: center; gap: var(--vm-space-2); }
.vm-nav__links a {
  padding: var(--vm-space-2) var(--vm-space-3);
  border-radius: var(--vm-radius-s);
  color: var(--vm-encre);
  font-weight: var(--vm-weight-semibold);
  text-decoration: none;
  transition: background-color var(--vm-dur-fast) var(--vm-ease);
}
.vm-nav__links a:hover { background: var(--vm-eau-100); }
.vm-nav__burger {
  margin-left: auto;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--vm-radius-s);
  background: transparent; cursor: pointer;
  font-size: 1.5rem; color: var(--vm-encre);
}
@media (min-width: 48rem) {
  .vm-nav__links { display: flex; }
  .vm-nav__burger { display: none; }
}
.vm-nav__mobile { display: grid; gap: var(--vm-space-1); padding: var(--vm-space-3) var(--vm-gutter) var(--vm-space-5); }
.vm-nav__mobile a {
  padding: var(--vm-space-3); border-radius: var(--vm-radius-s);
  color: var(--vm-encre); font-weight: var(--vm-weight-semibold); text-decoration: none;
}
.vm-nav__mobile a:hover { background: var(--vm-eau-100); }
.vm-nav__mobile[hidden] { display: none; }

/* ── Pied de page ──────────────────────────────────────────────────────── */
.vm-footer { background: var(--vm-lagon-900); color: var(--vm-eau-100); padding-block: var(--vm-space-8) var(--vm-space-6); }
.vm-footer a { color: var(--vm-eau-200); text-decoration: none; }
.vm-footer a:hover { color: #fff; text-decoration: underline; }
.vm-footer__cols { display: grid; gap: var(--vm-space-6); }
@media (min-width: 48rem) { .vm-footer__cols { grid-template-columns: 2fr 1fr 1fr; } }
.vm-footer__legal { margin-top: var(--vm-space-7); padding-top: var(--vm-space-5); border-top: 1px solid rgba(220,241,244,0.2); font-size: var(--vm-text-xs); color: var(--vm-eau-200); }

/* ── FAQ (accordéon natif) ─────────────────────────────────────────────── */
.vm-faq {
  border: 1px solid var(--vm-border-soft);
  border-radius: var(--vm-radius-m);
  background: var(--vm-surface);
  margin-bottom: var(--vm-space-3);
}
.vm-faq summary {
  list-style: none;
  display: flex; align-items: center; gap: var(--vm-space-3);
  padding: var(--vm-space-4) var(--vm-space-5);
  min-height: 44px;
  font-weight: var(--vm-weight-bold);
  color: var(--vm-encre);
  cursor: pointer;
  border-radius: var(--vm-radius-m);
}
.vm-faq summary::-webkit-details-marker { display: none; }
.vm-faq summary::before {
  content: "+";
  font-family: var(--vm-font-mono);
  color: var(--vm-lagon-700);
  font-size: 1.2em;
  width: 1em;
  transition: rotate var(--vm-dur-fast) var(--vm-ease);
}
.vm-faq[open] summary::before { rotate: 45deg; }
.vm-faq__body { padding: 0 var(--vm-space-5) var(--vm-space-5) calc(var(--vm-space-5) + 1em + var(--vm-space-3)); }
.vm-faq__body p { font-size: var(--vm-text-s); margin-bottom: var(--vm-space-2); }

/* ── Signature « profondeur » ──────────────────────────────────────────── */
/* Jauge fixe : profondeur = progression de lecture. Décorative (aria-hidden). */
.vm-depth {
  position: fixed; right: 20px; top: 50%; translate: 0 -50%;
  z-index: 40;
  display: none;
  flex-direction: column; align-items: center; gap: var(--vm-space-2);
  font-family: var(--vm-font-mono); font-size: 0.75rem; color: var(--vm-lagon-700);
}
@media (min-width: 64rem) { .vm-depth { display: flex; } }
.vm-depth__value {
  background: var(--vm-surface);
  border: 1px solid var(--vm-border-soft);
  border-radius: var(--vm-radius-full);
  padding: 4px 12px;
  box-shadow: var(--vm-shadow-s);
  white-space: nowrap;
}
.vm-depth__track { width: 5px; height: 180px; border-radius: 3px; background: var(--vm-eau-100); overflow: hidden; }
.vm-depth__fill { width: 100%; height: 0%; background: linear-gradient(180deg, var(--vm-lagon-300), var(--vm-lagon-700)); border-radius: 3px; }

/* Marqueur de palier en tête de section */
.vm-palier {
  display: inline-flex; align-items: center; gap: var(--vm-space-3);
  font-family: var(--vm-font-mono); font-size: var(--vm-text-xs);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--vm-lagon-700);
  margin-bottom: var(--vm-space-4);
}
.vm-palier::before { content: ""; width: 36px; height: 2px; border-radius: 1px; background: var(--vm-lagon-300); }

/* Séparateur vague entre sections (SVG inline dans un conteneur) */
.vm-wave { display: block; width: 100%; height: 56px; margin-block: -1px; }

/* Bulles décoratives (aria-hidden, désactivées si reduced-motion) */
.vm-bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.vm-bubble {
  position: absolute; bottom: -40px;
  border-radius: 50%;
  border: 2px solid var(--vm-eau-200);
  opacity: 0.7;
  animation: vm-rise linear infinite;
}
@keyframes vm-rise { to { translate: 8px -110vh; } }

/* ── Révélation au scroll ──────────────────────────────────────────────── */
/* Scroll-driven animations (2026) avec repli IntersectionObserver (.in via JS) */
.vm-reveal { opacity: 0; translate: 0 22px; }
@supports (animation-timeline: view()) {
  .vm-reveal {
    opacity: 1; translate: none;
    animation: vm-reveal both var(--vm-ease);
    animation-timeline: view();
    animation-range: entry 0% entry 38%;
  }
}
.vm-reveal.in { opacity: 1; translate: 0 0; transition: opacity var(--vm-dur-slow) var(--vm-ease), translate var(--vm-dur-slow) var(--vm-ease); }
@keyframes vm-reveal { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .vm-reveal { opacity: 1; translate: none; animation: none; } }
