/* Toutabri design system : tokens et composants */
:root {
  /* Couleur */
  --bleu: #005fa9;
  --bleu-fonce: #004a85;
  --bleu-vif: #1776c1;
  --ciel: #e4f1f7;
  --ciel-fort: #78bcd8;
  --ciel-texte: #d5e9f4;
  --sable: #f2f0ed;
  --sable-fort: #dcd8d2;
  --encre: #22282f;
  --texte: #3c3c3b;
  --texte-doux: #5c6168;
  --blanc: #fff;
  --erreur: #a8201a;
  --succes: #1b6e12;

  /* Typographie */
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --corps: "Jost", "Helvetica Neue", Arial, sans-serif;
  --t-xs: 0.875rem;
  --t-s: 1rem;
  --t-m: 1.125rem;
  --t-l: 1.375rem;
  --t-xl: clamp(1.75rem, 1.4rem + 1.3vw, 2.5rem);
  --t-2xl: clamp(2.125rem, 1.6rem + 2vw, 3.25rem);

  /* Espacement (base 8) */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 24px;
  --e-6: 32px;
  --e-7: 48px;
  --e-8: 64px;
  --e-9: 96px;
  --e-10: 128px;

  /* Rayons */
  --r-s: 4px;
  --r-m: 10px;
  --r-l: 20px;
  --r-pilule: 29px;

  /* Ombres */
  --ombre-panneau: 0 18px 44px -12px rgb(0 32 66 / 45%);

  /* Mouvement */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --page: min(1312px, calc(100vw - 2 * var(--gouttiere)));
  --gouttiere: clamp(16px, 4vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--bleu) var(--sable); }
body {
  margin: 0;
  font-family: var(--corps);
  font-size: var(--t-s);
  line-height: 1.55;
  color: var(--texte);
  background: var(--blanc);
  overflow-x: clip;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ol, ul, figure, blockquote, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
h1, h2, h3 { font-family: var(--display); color: var(--encre); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-l); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
::selection { background: var(--bleu); color: var(--blanc); }
.sur-bleu ::selection { background: var(--blanc); color: var(--bleu); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; border-radius: 4px; }
.sur-bleu :focus-visible, .sur-encre :focus-visible { outline-color: var(--blanc); }
.page { width: var(--page); margin-inline: auto; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chiffres { font-variant-numeric: tabular-nums; }
.lien-evitement { position: absolute; left: 16px; top: -64px; z-index: 50; background: var(--encre); color: var(--blanc); padding: 8px 16px; border-radius: var(--r-s); }
.lien-evitement:focus { top: 8px; }

/* Bouton */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 10px 24px;
  font-family: var(--display); font-weight: 500; font-size: var(--t-s); line-height: 1.2;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--encre); border-radius: var(--r-pilule);
  background: transparent; color: var(--encre);
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn svg { width: 16px; height: 16px; flex: none; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:hover { background: var(--encre); color: var(--blanc); }
.btn-plein { background: var(--bleu); border-color: var(--bleu); color: var(--blanc); font-weight: 700; }
.btn-plein:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); }
.btn-clair { border-color: var(--blanc); color: var(--blanc); }
.btn-clair:hover { background: var(--blanc); color: var(--bleu); }
.btn-blanc { background: var(--blanc); border-color: var(--blanc); color: var(--bleu); font-weight: 700; }
.btn-blanc:hover { background: var(--ciel); border-color: var(--ciel); color: var(--bleu-fonce); }
.btn-discret { border-color: transparent; padding-inline: 8px; color: var(--texte-doux); }
.btn-discret:hover { background: var(--sable); color: var(--encre); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }

/* Puce de choix */
.puces { display: flex; flex-wrap: wrap; gap: var(--e-2); }
.puce { position: relative; }
.puce input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.puce span {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px;
  font-size: var(--t-s); line-height: 1.2; color: var(--encre);
  background: var(--sable); border: 1px solid var(--sable); border-radius: var(--r-l);
  transition: background-color .15s, border-color .15s, color .15s;
}
.puce input:hover + span { border-color: var(--bleu); }
.puce input:checked + span { background: var(--bleu); border-color: var(--bleu); color: var(--blanc); }
.puce input:focus-visible + span { outline: 3px solid var(--bleu); outline-offset: 2px; }

/* Champ */
.champ { display: grid; gap: 4px; }
.champ label, .legende { font-weight: 500; color: var(--encre); font-size: var(--t-s); line-height: 1.3; }
.legende { display: block; margin-bottom: var(--e-2); }
.champ input[type="text"], .champ input[type="tel"], .champ input[type="email"] {
  width: 100%; min-height: 44px; padding: 8px 14px;
  font: inherit; color: var(--encre); caret-color: var(--bleu);
  background: var(--sable); border: 1px solid transparent; border-radius: var(--r-m);
}
.champ input::placeholder { color: var(--texte-doux); }
.champ input:hover { border-color: var(--texte-doux); }
.champ input:focus { outline: 3px solid var(--bleu); outline-offset: 0; background: var(--blanc); }
.champ[data-erreur] input { border-color: var(--erreur); background: #fbeeed; }
.champ .erreur { display: none; color: var(--erreur); font-size: var(--t-xs); line-height: 1.3; }
.champ[data-erreur] .erreur { display: block; }

/* Curseur coté */
.cote { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px var(--e-3); }
.cote label { font-weight: 500; color: var(--encre); line-height: 1.2; }
.cote-valeur { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--display); font-weight: 700; color: var(--bleu); font-size: var(--t-m); }
.cote-valeur input {
  width: 3.6em; min-height: 32px; padding: 0 4px; text-align: right;
  font: inherit; color: inherit; background: var(--sable); border: 1px solid transparent; border-radius: var(--r-s);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.cote-valeur input::-webkit-outer-spin-button, .cote-valeur input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.cote input[type="range"] { grid-column: 1 / -1; width: 100%; height: 28px; margin: 0; background: transparent; cursor: ew-resize; appearance: none; -webkit-appearance: none; }
.cote input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--bleu) var(--p, 50%), var(--sable-fort) var(--p, 50%)); }
.cote input[type="range"]::-moz-range-track { height: 3px; background: var(--sable-fort); }
.cote input[type="range"]::-moz-range-progress { height: 3px; background: var(--bleu); }
.cote input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; background: var(--blanc); border: 3px solid var(--bleu); border-radius: 50%; }
.cote input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; background: var(--blanc); border: 3px solid var(--bleu); border-radius: 50%; }
.cote .aide { grid-column: 1 / -1; color: var(--texte-doux); font-size: var(--t-xs); line-height: 1.3; }

/* Coche */
.coche { display: flex; gap: 10px; align-items: flex-start; line-height: 1.3; cursor: pointer; color: var(--encre); }
.coche input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--bleu); }
