/* ==========================================================================
   VaultLens — styles de la page d’accueil
   Dépend des jetons et composants définis dans base.css.
   ========================================================================== */

/* Les enfants de grille ne doivent jamais élargir la page (contenu en nowrap, code) */
.hero-grid > *, .privacy-grid > *, .results-grid > *,
.offer-grid > *, .contact-grid > * { min-width: 0; }

/* ---------- 7. Accroche ---------- */

.hero { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(3rem, 2rem + 4vw, 6rem); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-subtle);
}
.eyebrow::before { content: ""; width: 1.75rem; height: 2px; background: var(--accent); }

.hero-title {
  margin-top: 1.5rem;
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 650;
}
.hero-title span { display: block; }
.hero-title span:first-child { text-wrap: wrap; }
.hero-title .second { color: var(--text-subtle); }

.hero-grid {
  display: grid;
  gap: 3rem;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}

.hero-lead { max-width: 52ch; font-size: var(--step-1); line-height: 1.5; color: var(--text-muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }

.facts { margin-top: 2.75rem; border-top: 1px solid var(--rule); }
.facts > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.facts dt { font-weight: 650; }
.facts dd { color: var(--text-muted); }

@media (min-width: 64rem) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 4rem; align-items: start; }
}

/* Reçu : aperçu condensé d’une fiche */
.receipt {
  position: relative;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
}
.receipt-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.receipt-id { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-subtle); }
.receipt-loc { margin-top: 1rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); overflow-wrap: anywhere; }
.receipt-title { margin-top: 0.25rem; font-weight: 650; font-size: 1.0625rem; line-height: 1.35; }

.receipt-steps { margin-top: 1.25rem; list-style: none; border-top: 1px dashed var(--rule); }
.receipt-steps li {
  display: grid;
  grid-template-columns: 1.25rem 6.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.5rem;
  padding-block: 0.55rem;
  border-bottom: 1px dashed var(--rule);
}
.receipt-steps .tick { font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.receipt-steps .label { color: var(--text-muted); }
.receipt-steps code { font-size: 0.8125rem; overflow-wrap: anywhere; }
.receipt-steps code.fail { color: var(--fail); font-weight: 600; }

.receipt-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; font-size: var(--step--1); }
.receipt-foot a { font-weight: 600; }

/* ---------- 9. Comment ça marche ---------- */

.steps { display: grid; gap: 3rem; list-style: none; counter-reset: step; }
@media (min-width: 60rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .steps > li { padding-inline: 2rem; border-left: 1px solid var(--rule); }
  .steps > li:first-child { padding-left: 0; border-left: 0; }
  .steps > li:last-child { padding-right: 0; }
}

.step-num { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent); font-weight: 700; }
.step-title { margin-top: 0.5rem; font-size: var(--step-2); }
.step-text { margin-top: 0.75rem; color: var(--text-muted); }

.fig {
  height: 12.5rem;
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  background: var(--surface-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Étape 1 : lignes de code et pistes */
.fig-search { display: flex; flex-direction: column; gap: 0.7rem; }
.fig-search .bar { position: relative; display: block; height: 0.5rem; border-radius: 2px; background: var(--rule); }
.fig-search .i1 { margin-left: 1.25rem; }
.fig-search .i2 { margin-left: 2.5rem; }
.fig-search .lead { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.fig-search .lead::after {
  content: "piste ?";
  position: absolute;
  left: calc(100% + 0.6rem);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--accent);
  white-space: nowrap;
}
.w25 { width: 25%; } .w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; }
.w55 { width: 55%; } .w60 { width: 60%; } .w70 { width: 70%; }

/* Étape 2 : boucle de vérification */
.fig-verify { list-style: none; font-family: var(--font-mono); font-size: 0.8125rem; }
.fig-verify li { display: flex; align-items: baseline; gap: 0.5rem; padding-block: 0.2rem; }
.fig-verify li::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--text-subtle); }
.fig-verify b { order: 2; font-weight: 600; }
.fig-verify .ok { color: var(--accent); }
.fig-verify .ko { color: var(--fail); }
.fig-verify .verdict { margin-top: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.fig-verify .verdict::after { display: none; }

/* Étape 3 : fiche livrée */
.fig-deliver { display: flex; flex-direction: column; gap: 0.75rem; }
.fig-deliver dl { display: grid; gap: 0.5rem; }
.fig-deliver dl > div { display: grid; grid-template-columns: 6.5rem 1fr; align-items: center; gap: 0.75rem; }
.fig-deliver dt { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-subtle); }
.fig-deliver dd { height: 0.45rem; border-radius: 2px; background: var(--rule); }
.fig-deliver dd.is-fail { background: var(--fail); opacity: 0.55; }

/* ---------- 10. Fiche de bug ---------- */

.bug {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bug-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; padding: clamp(1.25rem, 1rem + 1vw, 2rem); border-bottom: 1px solid var(--rule); }
.bug-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.bug-id { margin-right: 0.25rem; font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-subtle); }
.bug-title { font-size: var(--step-2); overflow-wrap: anywhere; }
.bug-kind { color: var(--text-muted); }
.bug-loc { font-family: var(--font-mono); font-size: 0.875rem; overflow-wrap: anywhere; }

.bug-grid { display: grid; }
.bug-cell { min-width: 0; padding: clamp(1.25rem, 1rem + 1vw, 2rem); border-bottom: 1px solid var(--rule); }
.bug-cell--wide { grid-column: 1 / -1; }
.bug-cell h4 { margin-bottom: 0.9rem; }
.bug-cell p + h4 { margin-top: 1.5rem; }
.bug-cell h4 + .term + h4 { margin-top: 1.5rem; }
.bug-cell p { color: var(--text-muted); }

@media (min-width: 64rem) {
  .bug-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bug-cell:nth-child(even):not(.bug-cell--wide) { border-left: 1px solid var(--rule); }
}

.bug-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1rem clamp(1.25rem, 1rem + 1vw, 2rem);
  background: var(--surface-sunken);
  font-size: var(--step--1);
  color: var(--text-muted);
}
.bug-foot strong { color: var(--text); }

/* Blocs de code */
.code,
.term {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 4;
}
.code { padding-block: 0.9rem; }
.code code { display: block; min-width: max-content; white-space: normal; font-size: inherit; }
.code .line { display: block; min-height: 1.65em; padding-inline: 1rem 1.25rem; white-space: pre; }
.code .ln { display: inline-block; width: 2.5ch; margin-right: 1.5ch; text-align: right; color: var(--code-muted); user-select: none; }
.code .is-hit { background: var(--code-hit); box-shadow: inset 3px 0 0 var(--code-fail); }
.code .annot { color: var(--code-fail); font-style: italic; }

.term { padding: 1rem 1.1rem; white-space: pre; }
.term code { font-size: inherit; }
.term--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.term .prompt { color: var(--code-muted); user-select: none; }
.term .err { color: var(--code-fail); font-weight: 700; }
.term .dim { color: var(--code-muted); }

.tok-k { color: var(--code-key); }
.tok-n { color: var(--code-num); }
.tok-s { color: var(--code-str); }
.tok-c { color: var(--code-muted); }

/* Légende des niveaux */
.levels { margin-top: clamp(3rem, 2.5rem + 2vw, 4.5rem); }
.levels-title { font-size: var(--step-2); }
.levels-intro { margin-top: 0.75rem; max-width: 60ch; color: var(--text-muted); }
.levels-list { display: grid; margin-top: 1.75rem; border-top: 1px solid var(--rule); }
.levels-list > div { display: grid; gap: 0.6rem; padding-block: 1.1rem; border-bottom: 1px solid var(--rule); }
.levels-list dd { color: var(--text-muted); }
@media (min-width: 52rem) {
  .levels-list > div { grid-template-columns: 16rem 1fr; gap: 2rem; align-items: baseline; }
}

/* ---------- 11. Confidentialité (bandeau inversé) ---------- */

.band {
  --rule-strong: var(--band-text);
  --text-subtle: var(--band-muted);
  background: var(--band-bg);
  color: var(--band-text);
}
.band .section-lead { color: var(--band-muted); }

.privacy-grid { display: grid; gap: 3rem; }
@media (min-width: 60rem) { .privacy-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 5rem; } }

.privacy-points { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--band-rule); }
.privacy-points li { display: grid; gap: 0.35rem; padding-block: 1.25rem; border-bottom: 1px solid var(--band-rule); }
.privacy-points h3 { font-size: var(--step-1); }
.privacy-points p { color: var(--band-muted); }

.boundary { display: flex; flex-direction: column; align-items: stretch; }
.zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 2.25rem 1.5rem 1.5rem;
  border: 1.5px dashed var(--band-accent);
  border-radius: var(--radius-lg);
}
.zone-label {
  position: absolute;
  top: -0.7rem;
  left: 1rem;
  padding-inline: 0.5rem;
  background: var(--band-bg);
  color: var(--band-accent);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.node {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--band-rule);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.03);
  font-weight: 600;
}
.node small { font-family: var(--font-mono); font-size: var(--step--2); font-weight: 500; color: var(--band-muted); text-align: right; }
.node--vl { border-color: var(--band-accent); box-shadow: inset 3px 0 0 var(--band-accent); }
.node--out { border-style: dashed; color: var(--band-muted); font-weight: 500; }

.wire { position: relative; align-self: center; width: 1.5px; height: 1.75rem; background: var(--band-muted); }
.wire::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  border: 5px solid transparent;
  border-top-color: var(--band-muted);
  border-bottom-width: 0;
  transform: translateX(-50%);
}
.wire--both::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  border: 5px solid transparent;
  border-bottom-color: var(--band-muted);
  border-top-width: 0;
  transform: translateX(-50%);
}
.band-note { margin-top: 3rem; max-width: 60ch; color: var(--band-muted); font-size: 0.9375rem; }

/* ---------- 12. Résultats ---------- */

.results-grid { display: grid; gap: 1.5rem; }
@media (min-width: 52rem) { .results-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (min-width: 64rem) { .results-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }

.result { display: flex; flex-direction: column; gap: 1rem; padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.result-figure { font-size: clamp(3rem, 2rem + 4vw, 5rem); font-weight: 650; line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.result-figure small { font-size: 0.4em; font-weight: 500; letter-spacing: 0; color: var(--text-subtle); }
.result-text { font-size: var(--step-0); line-height: 1.5; color: var(--text-muted); }

.results-caveat { margin-top: 1.25rem; max-width: 62ch; color: var(--text-muted); }

/* Référence client : logo officiel sur bandeau encre de la marque (le logo a un texte blanc) */
.reference {
  margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.reference-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.5rem clamp(1.25rem, 1rem + 1.5vw, 2.5rem);
  background: var(--brand-ink);
  border-bottom: 1px solid var(--band-rule);
  color: #ecece6;
}
.reference-logo { width: min(100%, 13rem); height: auto; }
.reference-where { font-family: var(--font-mono); font-size: var(--step--1); color: #aeb2b9; }
.reference-body { display: grid; gap: 1.25rem; padding: clamp(1.25rem, 1rem + 1.5vw, 2.5rem); }
.reference-fact { max-width: 62ch; font-size: var(--step-1); line-height: 1.5; }
.reference-ask {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--rule);
}
.reference-title { font-weight: 650; }

.section-cta { margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }

/* ---------- 13. Offre et prérequis ---------- */

.offer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 60rem) { .offer-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2rem; } }

.offer-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: clamp(1.5rem, 1rem + 2vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.offer-main h3 { font-size: var(--step-3); max-width: 22ch; }
.offer-main > p:not(.kicker) { color: var(--text-muted); font-size: var(--step-1); }
.offer-main .btn { margin-top: 0.5rem; }

.offer-side { display: grid; align-content: start; gap: 1.5rem; }
.fit { padding: 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.fit h3 { font-size: var(--step-1); }
.fit ul { list-style: none; margin-top: 1rem; display: grid; gap: 0.6rem; }
.fit li { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.5rem; }
.fit li::before { font-family: var(--font-mono); font-weight: 700; }
.fit--yes li::before { content: "✓"; color: var(--accent); }
.fit--no li::before { content: "✕"; color: var(--fail); }
.honest {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.35;
}

/* ---------- 14. FAQ ---------- */

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-block: 1.25rem;
  font-size: var(--step-1);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--accent);
  transition: transform var(--dur) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq .answer { max-width: 65ch; padding-bottom: 1.5rem; color: var(--text-muted); }
.faq .answer p + p { margin-top: 0.75rem; }

@media (min-width: 52rem) {
  .faq-wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 2rem; }
}

/* ---------- 15. Contact ---------- */

.contact-grid { display: grid; gap: 3rem; }
@media (min-width: 60rem) { .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 5rem; } }

.contact-email { display: inline-block; margin-top: 0.5rem; font-size: var(--step-2); font-weight: 650; overflow-wrap: anywhere; }
.contact-aside p + p,
.contact-aside .kicker + p { margin-top: 0.5rem; }
.contact-aside .privacy-hint { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--text-muted); font-size: 0.9375rem; }

.form { display: grid; gap: 1.25rem; }
.form-row { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field input,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--text-subtle);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  transition: border-color var(--dur) var(--ease);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:hover,
.field textarea:hover { border-color: var(--text); }
.field input:focus-visible,
.field textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
/* Champ signalé à l’envoi par assets/js/main.js : bordure rouge, plus épaisse (pas la couleur seule) */
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--fail); box-shadow: inset 0 0 0 1px var(--fail); }
.field-error { font-size: 0.9375rem; font-weight: 600; color: var(--fail); }
.field-hint { font-size: var(--step--1); color: var(--text-subtle); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-status { font-size: 0.9375rem; color: var(--text-muted); }

