/* ——————————————————————————————————————————————————————————————————————
   Jetons repris tels quels de l'application (app/src/theme/variables.scss).
   Le site et l'app doivent rester la même marque : toute couleur ajoutée
   ici devrait d'abord exister là-bas.
   —————————————————————————————————————————————————————————————————————— */
:root {
  --orange: #f2711c;
  --orange-deep: #e35d0b;
  --orange-light: #ff9448;
  --accent: #f2711c;
  --link: #e35d0b;

  --bg: #fdf8f4;
  --bg-alt: #f7efe8;
  --surface: #ffffff;

  --ink: #241a14;
  --ink-subtle: rgba(36, 26, 20, 0.78);
  --ink-muted: rgba(36, 26, 20, 0.62);
  --ink-faint: rgba(36, 26, 20, 0.4);
  --border: rgba(36, 26, 20, 0.09);
  --border-strong: rgba(36, 26, 20, 0.16);

  --orange-soft: rgba(242, 113, 28, 0.12);

  --shadow: 0 6px 24px rgba(36, 26, 20, 0.08);
  --shadow-sm: 0 3px 14px rgba(36, 26, 20, 0.07);
  --shadow-xs: 0 2px 8px rgba(36, 26, 20, 0.05);
  --shadow-phone: 0 28px 80px rgba(36, 26, 20, 0.16);

  /* Couleurs des segments de la roue — palette --cmq-cat-* de l'app. */
  --cat-purple: #9d7ee0;
  --cat-amber: #f2a93b;
  --cat-red: #ef5350;
  --cat-orange: #f5872c;
  --cat-blue: #62a8dd;
  --cat-lime: #a4c93a;
  --cat-teal: #26a69a;
  --cat-pink: #ee5f9e;

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #ff9448;
    --link: #ff9448;

    --bg: #15100d;
    --bg-alt: #1d1713;
    --surface: #221b16;

    --ink: #ede4dc;
    --ink-subtle: rgba(237, 228, 220, 0.78);
    --ink-muted: rgba(237, 228, 220, 0.62);
    --ink-faint: rgba(237, 228, 220, 0.42);
    --border: rgba(237, 228, 220, 0.12);
    --border-strong: rgba(237, 228, 220, 0.22);

    --orange-soft: rgba(242, 113, 28, 0.2);

    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.32);
    --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.28);
    --shadow-phone: 0 28px 80px rgba(0, 0, 0, 0.44);
  }
}

:root[data-theme="dark"] {
  --accent: #ff9448;
  --link: #ff9448;

  --bg: #15100d;
  --bg-alt: #1d1713;
  --surface: #221b16;

  --ink: #ede4dc;
  --ink-subtle: rgba(237, 228, 220, 0.78);
  --ink-muted: rgba(237, 228, 220, 0.62);
  --ink-faint: rgba(237, 228, 220, 0.42);
  --border: rgba(237, 228, 220, 0.12);
  --border-strong: rgba(237, 228, 220, 0.22);

  --orange-soft: rgba(242, 113, 28, 0.2);

  --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.32);
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-phone: 0 28px 80px rgba(0, 0, 0, 0.44);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* —— Typographie ———————————————————————————————————————————————————— */

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.03em;
  text-wrap: balance;
  font-weight: 900;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.6rem, 4.2vw, 2.25rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--ink-subtle);
  max-width: var(--measure);
}

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

.small {
  font-size: 0.9rem;
}

/* —— En-tête ————————————————————————————————————————————————————————— */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding-block: 10px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: var(--shadow-xs);
}

.brand strong {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.topnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 7px 11px;
  border-radius: 999px;
}

.topnav a:hover {
  color: var(--ink);
  background: var(--bg-alt);
}

/* Bouton de thème, repris de relaisasso.fr : un seul bouton, lune en clair,
   soleil en sombre. Le libellé accessible dit l'action, pas l'état. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.theme-toggle:hover {
  background: var(--orange-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle__icon {
  width: 20px;
  height: 20px;
}

.theme-toggle__icon--sun {
  display: none;
}

.theme-toggle__icon--moon {
  display: block;
}

/* Sans JavaScript, le jeu d'icônes doit quand même suivre le thème du système. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon--sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle__icon--moon {
    display: none;
  }
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--moon {
  display: block;
}

/* —— Sections ———————————————————————————————————————————————————————— */

section {
  padding-block: clamp(56px, 9vw, 96px);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.band {
  background: var(--bg-alt);
}

/* —— Héros —————————————————————————————————————————————————————————— */

/* La maquette est bien plus haute que la colonne de texte : centrée, c'est elle
   qui vient toucher l'en-tête. D'où une marge haute calée sur sa hauteur. */
.hero {
  padding-top: clamp(48px, 8vw, 108px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Badges officiels : l'artwork Google porte ~23 % de marge interne, d'où une
   hauteur plus grande pour que les deux boutons paraissent de même taille. */
.badge {
  height: auto;
  width: auto;
}

.badge--apple {
  height: 48px;
}

.badge--google {
  height: 62px;
  margin-inline: -8px;
}

/* —— Maquettes iPhone ———————————————————————————————————————————————
   Reprises telles quelles de relaisasso.fr : cadre de 280 px (300 dans le
   bandeau), marge 10, rayon 42, écran 34, encoche 88 × 24 posée à 16 du haut. */

.phone {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.device--iphone {
  width: min(100%, 280px);
  flex-shrink: 0;
}

.device--iphone .device__frame {
  position: relative;
  width: 100%;
  padding: 10px;
  border-radius: 42px;
  background: #1a1a1a;
  box-shadow: var(--shadow-phone);
}

.device--iphone .device__island {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 2;
  width: 88px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #0d0d0d;
}

.device--iphone .device__screen {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: #000;
  aspect-ratio: 9 / 19.5;
}

.device--iphone .device__screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: top center;
}

.device--iphone-lg {
  width: min(100%, 300px);
  margin-inline: auto;
}

.phone figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-align: center;
}

/* —— Étapes ————————————————————————————————————————————————————————— */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step__num {
  counter-increment: step;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.step__num::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--accent);
  font-size: 0.95rem;
  letter-spacing: 0;
}

/* —— Écrans ————————————————————————————————————————————————————————— */

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

.screen__note {
  display: block;
  color: var(--ink-muted);
  font-size: 0.92rem;
  font-weight: 600;
  max-width: 34ch;
}

.screen__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.screen__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tab, var(--accent));
}

/* —— Bandeau vie privée ——————————————————————————————————————————— */

.privacy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.keylist {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.keylist__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
}

.keylist__row+.keylist__row {
  border-top: 1px solid var(--border);
}

.keylist__row dt {
  font-weight: 800;
  font-size: 0.95rem;
}

.keylist__row dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: right;
}

.keylist__foot {
  padding: 12px 14px 8px;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* —— Documents légaux ————————————————————————————————————————————— */

.doc {
  max-width: var(--measure);
}

.doc h3 {
  margin-top: 32px;
  margin-bottom: 8px;
}

.doc h3:first-of-type {
  margin-top: 24px;
}

.doc p,
.doc ul {
  margin-block: 0 12px;
  color: var(--ink-subtle);
}

.doc ul {
  padding-left: 22px;
}

.doc li {
  margin-bottom: 6px;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 6px;
}

.doc__date {
  font-size: 0.88rem;
  color: var(--ink-faint);
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
  margin-bottom: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

td {
  color: var(--ink-subtle);
}

/* —— Pied de page ————————————————————————————————————————————————— */

footer {
  border-top: 1px solid var(--border);
  padding-block: 36px;
  padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer__inner {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
}

.footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* —— Adaptations étroites ——————————————————————————————————————————— */

@media (max-width: 860px) {

  .hero__grid,
  .privacy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__grid>.phone {
    order: -1;
  }

  .topnav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* —— Pages de documents (confidentialité, mentions légales) ——————————— */

.doc-page {
  padding-block: clamp(32px, 6vw, 56px) clamp(56px, 9vw, 96px);
}

.doc-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 20px;
}

.backlink:hover {
  color: var(--ink);
}

.topnav a[aria-current="page"] {
  color: var(--accent);
  background: var(--orange-soft);
}

/* Sommaire du document : une liste, pas des cartes. */
.doc-toc {
  max-width: var(--measure);
  margin-block: 28px 8px;
  padding: 18px 22px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
}

.doc-toc h2 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.doc-toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.doc-toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}

.doc-toc a {
  font-weight: 700;
  font-size: 0.94rem;
  text-decoration: none;
}

.doc-toc a:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .doc-toc ol {
    columns: 1;
  }
}

/* Renvoi vers l'autre document, en fin de page. */
.doc-next {
  max-width: var(--measure);
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.doc-next a {
  font-weight: 800;
}
