/* Site vitrine IT Service : feuille de style unique, sans dépendance.
   Les couleurs reprennent la charte des portails
   (saas-factory/frontends/libs/ui/tokens/src/theme.css). */

:root {
  --bg: #f1f0ee;
  --surface: #ffffff;
  --fg: #0c0a09;
  --muted: #6b6560;
  --border: #e7e5e4;
  --brand: #ca181b;
  --brand-hover: #a91417;
  --brand-soft: #fbeaea;
  --on-brand: #ffffff;
  --success: #15803d;
  --warning: #b45309;
  --radius: 0.625rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px rgb(0 0 0 / 0.06);
  --font: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --width: 70rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --surface: #262626;
    --fg: #fafafa;
    --muted: #a3a3a3;
    --border: #3a3a3a;
    /* Le rouge du logo, le même qu'en clair (demande de Cédric). */
    --brand: #ca181b;
    --brand-hover: #a91417;
    --brand-soft: #3a1516;
    --on-brand: #ffffff;
    --success: #4ade80;
    --warning: #fbbf24;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.75rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1rem;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -999rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  padding: 0.5rem 1rem;
}

/* En-tête */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
}

.logo img {
  width: 2.1rem;
  height: 2.1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
}

.nav a:not(.button):hover,
.nav a[aria-current="page"] {
  color: var(--brand);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
  }

  .nav .button {
    margin-top: 0.5rem;
    text-align: center;
  }
}

/* Boutons */

.button {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}

.button:hover {
  background: var(--brand-hover);
}

.button.is-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--fg);
}

.button.is-outline:hover {
  background: var(--fg);
  color: var(--bg);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Sections */

section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

/* L'en-tête d'une section occupe la même largeur que ce qui le suit. */
.section-head {
  margin-bottom: 2.5rem;
}

.section-head .lead {
  max-width: none;
}

.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 40rem;
}

.muted {
  color: var(--muted);
}

/* Ligne de précision sous les boutons de l'accroche, ou sous une grille. */
.hero-note {
  margin-top: 1.25rem;
}

.section-note {
  margin-top: 2rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}

/* Bandeau d'accueil */

.hero {
  padding: 5rem 0 4.5rem;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
}

/* Grilles et cartes */

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

/* Le nombre de colonnes est choisi d'après le nombre de cartes, pour que la
   dernière ligne soit toujours pleine : is-two pour 2 ou 4 cartes, is-three
   pour 3 ou 6, is-four pour 4 cartes courtes (2 × 2 sur écran moyen). */

@media (min-width: 700px) {
  .grid.is-two,
  .grid.is-four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 700px) and (max-width: 999px) {
  .grid.is-three {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .grid.is-three {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid.is-four {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.section-alt .card {
  background: var(--bg);
  box-shadow: none;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

/* Icône nue : le trait rouge seul, sans pastille. */

.icon.is-plain {
  display: block;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  margin-bottom: 0.9rem;
}

.icon.is-plain svg {
  display: block;
  width: 2rem;
  height: 2rem;
  stroke-width: 1.75;
}

/* Carte à icône nue : l'icône et le titre sur une même ligne, centrés en
   hauteur l'un par rapport à l'autre ; le texte dessous, sur toute la largeur. */

.card:has(> .icon.is-plain) {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.75rem;
  row-gap: 0.9rem;
  align-items: center;
  align-content: start;
}

.card:has(> .icon.is-plain) > .icon,
.card:has(> .icon.is-plain) > h3 {
  margin: 0;
}

.card:has(> .icon.is-plain) > p {
  grid-column: 1 / -1;
}

/* Carte en ligne : l'icône à gauche, centrée en hauteur, le texte à droite.
   S'emploie dans une grille sans variante (une carte par ligne). */

.card.is-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.card.is-row .icon {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0;
}

.card.is-row .icon svg {
  width: 1.7rem;
  height: 1.7rem;
}

.card.is-row h3 {
  margin-bottom: 0.3rem;
}

.card.is-row p {
  margin: 0;
}

.card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s;
}

.card-link:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
}

/* En-tête de carte : l'icône et le titre sur une même ligne, centrés en hauteur. */

.card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.card-head .icon,
.card-head h3 {
  margin: 0;
}

.card-head .icon {
  flex: none;
}

/* La fonction unique du produit, en une ligne sous son titre. */
.card-function {
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.card-link .more {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--brand);
  font-weight: 700;
}

.icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 1rem;
}

.icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Étapes numérotées */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

/* En ligne, la liste porte trois étapes ; au-delà, prendre la frise. */
@media (min-width: 700px) {
  .steps:not(.is-timeline) {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* En ligne, chaque étape est centrée : la pastille, le titre et le texte. */
.steps:not(.is-timeline) li {
  text-align: center;
}

.steps:not(.is-timeline) li::before {
  left: 50%;
  transform: translateX(-50%);
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 3.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 900;
}

.steps h3 {
  font-size: 1.1rem;
}

.steps p {
  color: var(--muted);
  margin: 0;
}

/* Variante : frise verticale, les numéros reliés par un trait */

.steps.is-timeline {
  grid-template-columns: 1fr;
  gap: 0;
}

.steps.is-timeline li {
  padding: 0.25rem 0 2.25rem 4rem;
}

.steps.is-timeline li:last-child {
  padding-bottom: 0;
}

.steps.is-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.2rem - 1px);
  top: 2.9rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

/* Variante : une icône blanche dans la pastille à la place du numéro. */

.steps.has-icons li::before {
  content: "";
}

.step-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  color: var(--on-brand);
}

.step-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Listes à coches */

.checks {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.checks li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.45rem;
  width: 0.9rem;
  height: 0.5rem;
  border-left: 2.5px solid var(--brand);
  border-bottom: 2.5px solid var(--brand);
  transform: rotate(-45deg);
}

/* Maquette d'écran (illustration en HTML) */

.mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 0.92rem;
}

.mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.mock-body {
  padding: 0.5rem 1.1rem 1.1rem;
}

.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.mock-row:last-child {
  border-bottom: 0;
}

.mock-row small {
  display: block;
  color: var(--muted);
}

.state {
  flex: none;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.state.is-done {
  color: var(--success);
}

.state.is-waiting {
  color: var(--warning);
}

.state.is-idle {
  color: var(--muted);
}

.meter {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-top: 0.9rem;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.code {
  margin: 0;
  padding: 1rem 1.1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

/* Schéma des échanges : les entrées à gauche, le traitement au centre (roue qui
   tourne), les sorties à droite. En colonne sur petit écran. */

.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.flow-title {
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.flow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.flow-list li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.flow-list small {
  display: block;
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--muted);
}

.flow-list svg,
.flow-gear svg {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-list svg {
  flex: none;
  width: 1.7rem;
  height: 1.7rem;
}

/* La roue et ses flèches sont au milieu de la hauteur des listes : la légende
   est posée hors flux sous la roue, et la marge compense le titre des colonnes. */
.flow-engine {
  position: relative;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-items: center;
  column-gap: 0.75rem;
  margin-top: 2.2rem;
}

.flow-gear {
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: var(--brand-soft);
  border: 2px solid var(--brand);
}

.flow-gear svg {
  width: 3.6rem;
  height: 3.6rem;
  stroke-width: 1.4;
  animation: flow-spin 9s linear infinite;
}

.flow-caption {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  transform: translateX(-50%);
  width: 9rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

/* Flèche : un trait et sa pointe, vers la droite. */
.flow-arrow {
  position: relative;
  width: 2.75rem;
  height: 2px;
  background: var(--brand);
}

.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid var(--brand);
  border-right: 2px solid var(--brand);
  transform: translateY(-50%) rotate(45deg);
}

@keyframes flow-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 899px) {
  .flow {
    grid-template-columns: 1fr;
  }

  .flow-engine {
    grid-template-columns: 1fr;
    row-gap: 0.9rem;
    margin-top: 0;
  }

  .flow-caption {
    position: static;
    transform: none;
    width: auto;
  }

  /* La flèche pointe vers le bas. */
  .flow-arrow {
    width: 2px;
    height: 2rem;
  }

  .flow-arrow::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -1px;
    transform: translateX(-50%) rotate(135deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-gear svg {
    animation: none;
  }
}

/* Schéma des échanges entre deux acteurs : une colonne chacun, une ligne par
   aller ou retour (flèche au centre), les étapes du service en pastille centrée. */

.exchange {
  display: grid;
  gap: 1.25rem;
}

.exchange-row {
  display: grid;
  grid-template-columns: 1fr 11rem 1fr;
  gap: 1.25rem;
  align-items: center;
}

.exchange-actor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.exchange svg {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.exchange svg.is-spinning {
  animation: flow-spin 9s linear infinite;
}

.exchange-card {
  align-self: stretch;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.exchange-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.exchange-card p {
  margin: 0;
  color: var(--muted);
}

.exchange-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

/* Flèche de retour : la même, retournée. */
.flow-arrow.is-back {
  transform: rotate(180deg);
}

.exchange-step {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 44rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand-soft);
}

.exchange-step strong {
  margin-right: 0.35rem;
}

@media (min-width: 900px) {
  .exchange-link .flow-arrow {
    width: 100%;
  }
}

@media (max-width: 899px) {
  .exchange-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Sans colonnes, l'en-tête des acteurs n'a plus de sens : chaque carte dit qui agit. */
  .exchange-row.is-head {
    display: none;
  }

  .exchange-step {
    border-radius: var(--radius);
  }
}

@media (prefers-reduced-motion: reduce) {
  .exchange svg.is-spinning {
    animation: none;
  }
}

/* Section en deux colonnes : le texte à gauche, une illustration à droite. */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 899px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* Maquette de l'outil de relecture : la page à gauche, les valeurs à droite. */

.review {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
}

.review-page {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.scan-line,
.scan-row i {
  display: block;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--border);
}

.scan-line.is-title {
  width: 60%;
  height: 0.8rem;
  margin-bottom: 0.4rem;
}

.scan-line.is-short {
  width: 45%;
}

.scan-line.is-total {
  width: 35%;
  align-self: flex-end;
  margin-top: 0.4rem;
}

.scan-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.4rem;
  padding: 0.35rem;
  border: 2px solid transparent;
  border-radius: 6px;
}

.scan-row.is-flagged {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.review-values {
  padding: 0.4rem 1.1rem 1.1rem;
}

.mock-row.is-flagged small {
  color: var(--brand);
}

.review-input {
  flex: none;
  min-width: 3.5rem;
  padding: 0.2rem 0.6rem;
  border: 2px solid var(--brand);
  border-radius: 6px;
  font-weight: 700;
  text-align: right;
}

.review-button {
  display: block;
  width: fit-content;
  margin: 0.9rem 0 0 auto;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Défilement horizontal de quelques vues, piloté par site.js (classe is-ready).
   Sans JS, la première vue seule est visible. */

.slider {
  min-width: 0;
  overflow: hidden;
}

.slider-track {
  display: flex;
  align-items: center;
  transition: transform 0.7s ease;
}

.slider-slide {
  flex: 0 0 100%;
  min-width: 0;
  /* La marge laisse la place à l'ombre de la carte, que le cadre couperait. */
  padding: 0.5rem 0.75rem 1.75rem;
}

.slider-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.slider.is-ready .slider-controls {
  display: flex;
}

.slider-dots {
  display: flex;
  gap: 0.5rem;
}

.slider-nav {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.slider-nav:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.slider-nav svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.slider-dots button {
  width: 1.75rem;
  height: 0.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
}

.slider-dots button[aria-current="true"] {
  background: var(--brand);
}

@media (prefers-reduced-motion: reduce) {
  .slider-track {
    transition: none;
  }
}

/* Carte coupée en diagonale (du coin bas gauche au coin haut droit) : le document
   reçu occupe le triangle du haut, les données extraites celui du bas. */

.scan-split {
  position: relative;
  height: 26rem;
  overflow: hidden;
}

/* Les deux couches occupent toute la carte : les données dessous, le document
   dessus, dont seule la moitié du haut est gardée. */

.scan-split .code {
  position: absolute;
  inset: 0;
  padding: 1rem 1.1rem;
  font-size: 0.72rem;
  line-height: 1.6;
  overflow: hidden;
}

/* Le document : une feuille claire, quel que soit le thème. */
.scan-paper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.3rem 1.4rem;
  background: #f4f2ee;
  color: #292524;
  font-size: 0.74rem;
  line-height: 1.45;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.scan-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.scan-head span:last-child {
  text-align: right;
}

.scan-paper strong {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.scan-grid {
  display: grid;
  grid-template-columns: 1.1fr 2.2fr 0.7fr 0.8fr 1fr;
  gap: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #d6d3d1;
  margin-top: -0.45rem;
}

.scan-grid.is-head {
  margin-top: 0.2rem;
  font-weight: 700;
  border-bottom-color: #78716c;
}

.scan-grid span:nth-child(n + 3) {
  text-align: right;
}

.scan-totals {
  align-self: flex-end;
  display: grid;
  gap: 0.2rem;
  width: 45%;
}

.scan-totals span {
  display: flex;
  justify-content: space-between;
}

.scan-totals i {
  font-style: normal;
}

/* Le trait de coupe : un tracé vectoriel, donc lissé à toutes les tailles. */
.scan-cut {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
}

.scan-cut line {
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linecap: round;
}

@media (max-width: 480px) {
  .scan-split {
    height: 22rem;
  }

  .scan-split .code {
    font-size: 0.6rem;
  }

  .scan-paper {
    font-size: 0.62rem;
    padding: 1rem;
  }
}

/* Questions fréquentes */

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

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

.faq summary::after {
  content: "+";
  color: var(--brand);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

/* La question prend toute la largeur ; la réponse garde une ligne lisible. */
.faq details p {
  max-width: 52rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
}

/* Appel à l'action final */

.cta {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 1.25rem;
  padding: 3rem 2rem;
  text-align: center;
}

.cta p {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  opacity: 0.92;
}

.cta .button {
  background: var(--on-brand);
  color: var(--brand);
}

.cta .button:hover {
  background: #f1f0ee;
}

/* Pied de page */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.site-footer a:hover {
  color: var(--fg);
}

/* Page de texte (mentions légales) */

.prose {
  max-width: 44rem;
}

.prose h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
}

.todo {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Apparition au défilement (posée par site.js, donc sans JS tout reste visible) */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card-link:hover {
    transform: none;
  }
}
