/* ─────────────────────────────────────────────────────────────────────────
   WG Audit — charte premium épurée (réf. A24 / Aman / Apple)
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --cream: #f0ede8;
  --ink: #0a0a0a;
  --ink-soft: #3a3733;
  --line: rgba(10, 10, 10, 0.14);
  --line-cream: rgba(240, 237, 232, 0.22);

  --band-red: #c0392b;
  --band-orange: #d68a2e;
  --band-green: #3e7d5a;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 40rem;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ── Header / footer ─────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.brand-logo { display: block; height: 30px; width: auto; }
.brand-wordmark {
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
}
.header-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--pad);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-align: center;
}

/* ── Écrans ──────────────────────────────────────────────────────────── */
.screen { padding-block: clamp(2.5rem, 9vw, 5rem); }
.screen[hidden] { display: none; }

/* Sections "héros" inversées pour le drame */
.hero { background: var(--ink); color: var(--cream); }
.hero .eyebrow,
.hero .header-eyebrow { color: rgba(240, 237, 232, 0.62); }

/* ── Typographie ─────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
}
.display em { font-style: italic; }
.lede {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  line-height: 1.5;
  color: inherit;
  opacity: 0.86;
  margin: 0 0 2.4rem;
  max-width: 34rem;
}

/* ── Formulaire ──────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field .req { color: var(--band-orange); }
.field .opt { opacity: 0.5; text-transform: none; letter-spacing: 0; }

input,
select {
  font-family: var(--sans);
  font-size: 1.02rem;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--line-cream);
  border-radius: 0;
  padding: 0.85rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}
select { appearance: none; cursor: pointer; }
input::placeholder { color: rgba(240, 237, 232, 0.4); }
input:focus,
select:focus {
  outline: none;
  border-color: var(--cream);
  background: rgba(240, 237, 232, 0.05);
}
.field-error {
  margin: 0;
  min-height: 1rem;
  font-size: 0.85rem;
  color: #f3b4ab;
}
.field-hint {
  margin: 0;
  min-height: 1rem;
  font-size: 0.85rem;
  color: rgba(240, 237, 232, 0.62);
}
.form-foot {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.55;
  margin: 0.4rem 0 0;
}

/* ── Boutons ─────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.95rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cream); color: var(--ink); }
.hero .btn-primary,
.screen:not(.hero) .btn-primary { background: var(--ink); color: var(--cream); }
.hero .btn-primary { background: var(--cream); color: var(--ink); }
/* Cartes/zones à fond noir : le primaire DOIT rester crème (sinon noir/noir). */
#screen-result .hero-card .btn-primary,
#screen-result .sticky-cta .btn-primary { background: var(--cream); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}
.btn-text {
  background: none;
  border: none;
  padding: 0.6rem 0;
  color: inherit;
  opacity: 0.7;
  font-weight: 500;
}
.btn-text:hover { opacity: 1; }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ── Accessibilité : contenu réservé aux lecteurs d'écran ─────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Chargement (L13 : séquence de vérifications) ─────────────────────── */
.loading-wrap { padding-block: clamp(2rem, 10vh, 5rem); }
.loading-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  margin: 0.3rem 0 1.6rem;
}

/* Liste des étapes, alignée à gauche, largeur lisible et centrée. */
.audit-steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.audit-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  line-height: 1.35;
  /* Apparition douce de chaque ligne (désactivée en reduced-motion). */
  animation: wg-step-in 0.4s ease both;
}
.audit-step .step-label { color: rgba(240, 237, 232, 0.92); }
/* Étape en cours : libellé légèrement atténué jusqu'à validation. */
.audit-step[data-state='active'] .step-label { color: rgba(240, 237, 232, 0.7); }

/* Pastille d'état : spinner (en cours) -> coche verte WG (terminé). */
.step-mark {
  position: relative;
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
}
.step-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(240, 237, 232, 0.22);
  border-top-color: var(--cream);
}
.audit-step[data-state='active'] .step-mark::before {
  animation: wg-spin 0.8s linear infinite;
}
.audit-step[data-state='done'] .step-mark {
  background: var(--band-green);
}
.audit-step[data-state='done'] .step-mark::before { display: none; }
.audit-step[data-state='done'] .step-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 47%;
  width: 0.3rem;
  height: 0.58rem;
  border: solid var(--cream);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}

/* Message secondaire discret sous les étapes. */
.loading-secondary {
  max-width: 30rem;
  margin: 1.8rem auto 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(240, 237, 232, 0.58);
}

@keyframes wg-spin { to { transform: rotate(360deg); } }
@keyframes wg-step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Résultat ────────────────────────────────────────────────────────── */
.result-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.08;
  margin: 0 0 1.5rem;
}
.result-meta { margin: -0.5rem 0 1.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.meta-line {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  word-break: break-word;
}
.meta-note {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  opacity: 0.75;
  font-style: italic;
}

.partial-banner {
  border: 1px solid var(--line);
  border-left: 3px solid var(--band-orange);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
  background: rgba(214, 138, 46, 0.06);
}

/* ── Écran résultat (Sprint 1 CRO) — mobile-first ── */
.result-screen { padding: 0 0 6rem; } /* place pour le sticky CTA mobile */

.result-hero { padding: clamp(1.4rem, 5vw, 3rem) 0 clamp(1.6rem, 6vw, 2.4rem); text-align: center; }
.result-hero .result-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  line-height: 1.08;
  margin: 0.35rem 0 0.35rem;
}
.mini-fiche { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.02em; opacity: 0.88; margin: 0; }
.mini-fiche-address { font-family: var(--mono); font-size: 0.72rem; opacity: 0.5; margin: 0.2rem 0 0; word-break: break-word; }
.mini-fiche:empty, .mini-fiche-address:empty { display: none; }

.hero-score { display: flex; align-items: baseline; justify-content: center; gap: 0.1rem; margin-top: clamp(0.6rem, 3vw, 1.1rem); }
.score-value {
  font-family: var(--serif);
  font-size: clamp(4.4rem, 24vw, 8rem);
  line-height: 0.88;
  font-variant-numeric: tabular-nums;
  color: var(--cream); /* score géant crème, élément dominant */
}
.score-max { font-family: var(--mono); font-size: 1.3rem; opacity: 0.45; }
.score-band {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0.55rem 0 0;
}
.score-band[data-band='red'] { color: #e79b90; }
.score-band[data-band='orange'] { color: #e8b878; }
.score-band[data-band='green'] { color: #7bbd9b; }
.score-provisional {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.5);
  margin: 0.35rem 0 0;
}
.score-provisional[hidden] { display: none; }

.verdict {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 4.6vw, 1.6rem);
  line-height: 1.25;
  margin: 0.95rem auto 0;
  max-width: 30rem;
}

.frein {
  border: 1px solid var(--line-cream);
  border-left: 3px solid rgba(240, 237, 232, 0.3);
  text-align: left;
  padding: 0.9rem 1.1rem;
  margin: 1.35rem auto 0;
  max-width: 34rem;
  background: rgba(240, 237, 232, 0.05);
}
.frein-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
  color: rgba(240, 237, 232, 0.7);
}
/* Pastille de sévérité (remplace l'emoji rouge hardcodé). */
.frein-eyebrow::before {
  content: '';
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  margin-right: 0.5em;
  vertical-align: middle;
  background: currentColor;
}
/* Couleur/label suivent la sévérité réelle. */
.frein[data-severity='critique'] { border-left-color: var(--band-red); background: rgba(192, 57, 43, 0.12); }
.frein[data-severity='critique'] .frein-eyebrow { color: #e79b90; }
.frein[data-severity='important'] { border-left-color: var(--band-orange); background: rgba(214, 138, 46, 0.1); }
.frein[data-severity='important'] .frein-eyebrow { color: #e8b878; }
.frein[data-severity='mineur'] { border-left-color: rgba(240, 237, 232, 0.3); background: rgba(240, 237, 232, 0.05); }
.frein[data-severity='mineur'] .frein-eyebrow { color: rgba(240, 237, 232, 0.6); }
.frein-title { font-family: var(--serif); font-weight: 400; font-size: 1.18rem; line-height: 1.18; margin: 0 0 0.35rem; }
.frein-loss { font-size: 0.92rem; line-height: 1.42; opacity: 0.86; margin: 0; }

.result-body { padding-top: clamp(2rem, 7vw, 3rem); }

/* Sous-scores */
.subscores { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 3rem; }
.site-scope {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}
.site-scope-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.site-scope-url { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-soft); word-break: break-all; opacity: 0.85; }
.subscore-scope { font-weight: 400; font-size: 0.85rem; opacity: 0.6; }
.subscore-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.55rem; }
.subscore-label { font-weight: 600; font-size: 1.02rem; }
.subscore-points { font-family: var(--mono); font-size: 0.95rem; }
.subscore-points b { font-weight: 700; }
.subscore-points .sub-max { opacity: 0.5; }
.bar { height: 8px; background: rgba(10, 10, 10, 0.08); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0; /* surchargé en inline (valeur finale, toujours correcte sans JS) */
  border-radius: 999px;
  background: var(--bar-color, var(--ink));
  transform-origin: left center;
}
/* Valeurs réelles par sous-signal — ROUGE uniquement si déficient. */
.metrics { list-style: none; margin: 0.8rem 0 0; padding: 0; display: flex; flex-direction: column; }
.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.metric:last-child { border-bottom: none; }
.metric-label { opacity: 0.7; }
.metric-value { font-family: var(--mono); font-weight: 500; white-space: nowrap; }
.metric-red .metric-value { color: var(--band-red); font-weight: 700; }
.metric-orange .metric-value { color: var(--band-orange); }
.metric-green .metric-value { color: var(--band-green); }
/* Non mesuré : gris neutre, jamais d'alarme. */
.metric-unmeasured .metric-value { color: var(--ink-soft); font-weight: 500; opacity: 0.6; }
.metric-unmeasured .metric-label { opacity: 0.5; }

.perf-note {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  border-left: 2px solid var(--line);
  padding-left: 0.8rem;
  margin: -1.5rem 0 3rem;
}

/* Recommandations */
.section-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}
.reco-list { list-style: none; counter-reset: reco; margin: 0 0 3rem; padding: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.reco {
  border: 1px solid var(--line);
  padding: 1.25rem 1.35rem;
  display: grid;
  gap: 0.5rem;
}
.reco-top { display: flex; align-items: center; gap: 0.7rem; }
.sev {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.sev-critique { color: var(--band-red); }
.sev-important { color: var(--band-orange); }
.sev-mineur { color: var(--ink-soft); }
.reco-title { font-family: var(--serif); font-size: 1.4rem; line-height: 1.15; margin: 0; }
.reco-body { margin: 0; font-size: 0.98rem; opacity: 0.85; }

/* CTA */
.hero-card { background: var(--ink); color: var(--cream); padding: clamp(1.75rem, 6vw, 2.75rem); }
.cta-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0 0 0.5rem; }
.cta-lede { opacity: 0.86; margin: 0 0 0.5rem; font-size: 1.02rem; }
.cta-proof { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.05em; opacity: 0.62; margin: 0 0 1.4rem; }
.cta-buttons { display: flex; flex-direction: column; gap: 0.8rem; }
.cta-note { font-family: var(--mono); font-size: 0.8rem; opacity: 0.8; margin: 1.1rem 0 0; }
#restart-btn { margin-top: 2rem; }

.error-wrap { text-align: center; }
.error-wrap .btn-primary { margin-top: 1rem; }
.error-wrap .btn-text { display: block; margin: 1rem auto 0; }

/* ── CTA sticky (mobile uniquement) ──────────────────────────────────── */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem var(--pad);
  padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0));
  background: rgba(10, 10, 10, 0.96);
  border-top: 1px solid var(--line-cream);
}
.sticky-cta[hidden] { display: none; }
.sticky-cta .btn-primary { flex: 1; padding: 0.85rem 1rem; }
.sticky-cta .btn-text { color: var(--cream); white-space: nowrap; opacity: 0.85; padding: 0.6rem 0.4rem; }

/* ── Desktop ─────────────────────────────────────────────────────────── */
@media (min-width: 720px) {
  .cta-buttons { flex-direction: row; }
  .cta-buttons .btn { flex: 1; }
  .sticky-cta { display: none !important; } /* CTA classique dans le flux */
  .result-screen { padding-bottom: 0; }
}

/* ── Portes de conversion (lead / Cal) ───────────────────────────────── */
.lead-panel,
.call-panel { margin-top: 1.6rem; border-top: 1px solid var(--line-cream); padding-top: 1.6rem; }
/* Ligne de valeur de l'audit complet (réseaux sociaux inclus). Sobre, premium. */
.lead-intro {
  margin: 0 0 1.3rem;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.82;
}
.lead-form .field label { color: var(--cream); }
.consent-row { display: flex; gap: 0.7rem; align-items: flex-start; margin-top: 0.3rem; }
.consent-row input { width: auto; margin-top: 0.25rem; flex: 0 0 auto; accent-color: var(--cream); }
.consent-row label {
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  opacity: 0.92;
}
.consent-row a,
.lead-panel a,
.call-panel a { color: inherit; }
.lead-success {
  font-size: 0.98rem;
  border: 1px solid var(--line-cream);
  border-left: 3px solid var(--band-green);
  padding: 0.85rem 1rem;
  margin: 0;
}
.cal-inline { min-height: 480px; background: var(--cream); border-radius: 8px; overflow: hidden; }

/* Honeypot anti-bot : hors écran, invisible et hors tabulation. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer a { color: inherit; }
.legal p { margin: 0.5rem 0; }
.legal .section-title { margin-top: 2rem; }

/* ── Animations d'arrivée (Sprint 2) — uniquement sous .animate, transform/
   opacity seulement (pas de jank). Sans .animate (ou reduced-motion) : état
   final immédiat. ──────────────────────────────────────────────────────── */
@keyframes wg-bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wg-reco-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wg-hero-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wg-frein-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.animate .result-hero { animation: wg-hero-in 0.5s ease-out both; }
.animate .frein { animation: wg-frein-in 0.45s ease-out 0.15s both; }
/* Barres : remplissage en cascade (delay posé inline par catégorie). */
.animate .bar-fill { animation: wg-bar-fill 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
/* Recos : fondu + léger slide-up en cascade (delay inline par carte). */
.animate .reco { animation: wg-reco-in 0.5s ease-out both; }

/* ── Sans JavaScript : message clair (pas d'écran vide trompeur). ──────── */
.noscript-banner {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1rem;
  text-align: center;
  padding: 1rem var(--pad);
  border-bottom: 1px solid var(--line-cream);
}

/* ── Accessibilité : mouvement réduit — ZÉRO animation résiduelle. ─────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
