/*
 * Odolim — site vitrine.
 *
 * The palette is the app's own: #0E1A30 is its splash background, #16233F and
 * #0A1122 the two stops of its icon gradient. Green and red are verdicts, never
 * decoration, and both are darkened from the app's iOS-derived values because
 * #1E8E3E only reaches 3.7:1 on this ground — short of AA.
 *
 * One raised surface (the instrument panel), one movement (the odometer drums).
 * Everything else sits on the ground, separated by hairlines.
 */

/* -------------------------------------------------------------------------- */
/* Fonts — self-hosted, latin subset, variable weight. No external request.    */
/* Overpass descends from Highway Gothic; its mono sibling has fixed-pitch     */
/* digits, which is how a mechanical drum works: one column per digit.         */
/* -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Overpass';
  src: url('../fonts/overpass-latin.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Overpass Mono';
  src: url('../fonts/overpass-mono-latin.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------------- */
/* Tokens                                                                      */
/* -------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Neutrals, drawn from the subject: night dashboard, asphalt, contract paper. */
  --nuit: #0e1a30;
  --cadran: #ffffff;
  --papier: #f2f0eb;
  --bitume: #4a5163;
  --gravier: #cfccc4;
  --panneau: #0a5ee0;

  /* The odometer housing is a physical object: black drums, pale digits, in
     both colour schemes. It does not follow the theme. */
  --housing: #0e1a30;
  --housing-ink: #f6f8fb;
  --housing-ink-dim: #8d97ab;

  /* Status. Doubled by a sign and a word everywhere they appear. */
  --sous: #14722f;
  --sous-fond: rgba(52, 199, 89, 0.14);
  --dessus: #c01b2f;
  --dessus-fond: rgba(255, 59, 48, 0.12);

  /* Type scale. */
  --t-odo: clamp(3.25rem, 12.5vw, 7.25rem);
  --t-alarme: clamp(4.75rem, 17vw, 11.875rem);
  --t-h1: clamp(2rem, 5.2vw, 3.375rem);
  --t-h2: clamp(1.5rem, 3.4vw, 2.0625rem);
  --t-h3: 1.125rem;
  --t-chiffre: clamp(1.25rem, 2.4vw, 1.75rem);
  --t-corps: 1.0625rem;
  --t-legende: 0.90625rem;

  --rail: clamp(1.25rem, 5vw, 4.5rem);
  --mesure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --nuit: #eef1f6;
    --cadran: #16233f;
    --papier: #0a1122;
    --bitume: #a7b0c2;
    --gravier: rgba(255, 255, 255, 0.13);
    --panneau: #6fa8ff;
    --sous: #32d74b;
    --sous-fond: rgba(48, 209, 88, 0.2);
    --dessus: #ff7b73;
    --dessus-fond: rgba(255, 69, 58, 0.2);
  }
}

/* -------------------------------------------------------------------------- */
/* Reset                                                                       */
/* -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--nuit);
  font-family: 'Overpass', system-ui, sans-serif;
  font-size: var(--t-corps);
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

a {
  color: var(--panneau);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Layout — one left rail, shared by every section. Nothing is centred.        */
/* -------------------------------------------------------------------------- */

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding-inline: var(--rail);
}

.bande {
  border-top: 1px solid var(--gravier);
}

.bande > .wrap {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.mesure {
  max-width: var(--mesure);
}

h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
}

h2 {
  font-size: var(--t-h2);
  max-width: 30ch;
}

h3 {
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sous-titre {
  margin-top: 1.125rem;
  max-width: var(--mesure);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--bitume);
}

.legende {
  font-size: var(--t-legende);
  color: var(--bitume);
}

.chiffre {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

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

.tete {
  border-bottom: 1px solid var(--gravier);
}

.tete > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.marque {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
}

.marque img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.langues {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--t-legende);
  font-weight: 600;
}

.langues span[aria-current] {
  color: var(--nuit);
}

.langues a {
  color: var(--bitume);
  text-decoration: none;
}

.langues a:hover {
  text-decoration: underline;
}

.langues i {
  width: 1px;
  height: 0.9em;
  background: var(--gravier);
  font-style: normal;
}

/* -------------------------------------------------------------------------- */
/* Hero                                                                        */
/* -------------------------------------------------------------------------- */

.hero > .wrap {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 7vw, 5.5rem);
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}

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

.hero__telechargement {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem 2rem;
}

/* Apple's badge, unmodified, never below 40px tall, with its clear space. */
.badge {
  display: inline-block;
  padding: 4px;
}

.badge img {
  display: block;
  height: 44px;
  width: auto;
}

.badge + .legende {
  margin-top: 0.4rem;
}

.qr {
  display: none;
}

@media (min-width: 48rem) {
  .qr {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
  }

  .qr img {
    width: 88px;
    height: 88px;
    background: #fff;
    padding: 6px;
    border-radius: 4px;
  }

  .qr .legende {
    max-width: 14ch;
  }
}

/* -------------------------------------------------------------------------- */
/* Le panneau d'instrument — la seule surface surélevée de la page.            */
/* It replays the app's status card, in the app's own order.                   */
/* -------------------------------------------------------------------------- */

.panneau {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  border: 1px solid var(--gravier);
  border-radius: 20px;
  background: var(--cadran);
  overflow: hidden;
}

.panneau--sous {
  background: var(--sous-fond), var(--cadran);
}

.panneau--dessus {
  background: var(--dessus-fond), var(--cadran);
}

.panneau__corps {
  padding: clamp(1.125rem, 3vw, 1.75rem);
  display: grid;
  gap: 1.125rem;
}

.panneau__filet {
  border-top: 1px solid var(--gravier);
  padding-top: 1.125rem;
}

/* Verdict pill: a dot, plus a word. The colour never carries the meaning alone. */
.verdict {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--cadran);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.verdict::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.verdict--sous {
  color: var(--sous);
}

.verdict--dessus {
  color: var(--dessus);
}

.quota {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  /* Optical tightening of the no-break space before the unit. It cannot touch
     the narrow separator inside the number, which is not a word separator. */
  word-spacing: -0.06em;
  line-height: 1;
}

.ecart {
  font-size: var(--t-chiffre);
  font-weight: 700;
  line-height: 1.25;
}

.ecart--sous {
  color: var(--sous);
}

.ecart--dessus {
  color: var(--dessus);
}

.ecart .chiffre {
  font-weight: 700;
}

.conseil {
  margin-top: 0.375rem;
  color: var(--bitume);
  font-size: var(--t-legende);
  max-width: 46ch;
}

/* -------------------------------------------------------------------------- */
/* Le compteur à tambours — le seul mouvement de la page.                      */
/* -------------------------------------------------------------------------- */

.odo {
  /* One drum's height. Declared here so the housing can reserve it before the
     drums are injected — otherwise the panel grows on load and shifts layout. */
  --cell: 1.16em;
  min-height: calc(var(--cell) + 1rem);
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: var(--housing);
  color: var(--housing-ink);
  font-family: 'Overpass Mono', ui-monospace, monospace;
  font-size: var(--t-odo);
  font-weight: 700;
  line-height: 1;
  width: max-content;
  max-width: 100%;
  position: relative;
}

.odo__tambour {
  height: var(--cell);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  padding-inline: 0.06em;
  border-radius: 2px;
}

.odo__bande {
  display: block;
  transform: translateY(0);
}

.odo__bande > span {
  display: block;
  height: var(--cell);
  line-height: var(--cell);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* The drums are cylinders: the shading models their curvature, it is not
   ornament. Sits above the digits, below nothing. */
.odo::after {
  content: '';
  position: absolute;
  inset: 0.5rem 0.6rem;
  pointer-events: none;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0) 26%,
    rgba(0, 0, 0, 0) 74%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.odo__unite {
  align-self: flex-end;
  margin-left: 0.28em;
  padding-bottom: 0.12em;
  font-size: 0.22em;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--housing-ink-dim);
}

/* -------------------------------------------------------------------------- */
/* Cadre iPhone, dessiné en CSS. Aucune image de produit Apple.                */
/* -------------------------------------------------------------------------- */

.telephone {
  width: min(19rem, 100%);
  margin-inline: auto;
  padding: 11px;
  border-radius: 3rem;
  background: #1b1c22;
  box-shadow:
    inset 0 0 0 1.5px #3a3c46,
    0 24px 60px rgba(14, 26, 48, 0.22);
}

@media (min-width: 62rem) {
  .telephone {
    margin-inline: 0;
    margin-left: auto;
  }
}

.telephone__ecran {
  position: relative;
  aspect-ratio: 1320 / 2868;
  border-radius: 2.4rem;
  overflow: hidden;
  background: #0a1122;
  display: grid;
  place-items: center;
}

.telephone__ecran img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.telephone__ile {
  position: absolute;
  top: 2.2%;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 3.4%;
  border-radius: 999px;
  background: #000;
  z-index: 2;
}

/* Placeholder until the real 1320 × 2868 captures land in assets/img/screens. */
.telephone__attente {
  padding: 2rem 1.25rem;
  text-align: center;
  color: #8d97ab;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.telephone__attente .chiffre {
  display: block;
  margin-top: 0.5rem;
  color: #f6f8fb;
}

.telephone__legende {
  margin-top: 1rem;
  text-align: center;
  font-size: var(--t-legende);
  color: var(--bitume);
}

@media (min-width: 62rem) {
  .telephone__legende {
    text-align: right;
  }
}

/* -------------------------------------------------------------------------- */
/* Le risque — la bande inversée. Toujours le contraire du reste de la page.   */
/* -------------------------------------------------------------------------- */

.alarme {
  background: var(--nuit);
  color: var(--papier);
  border-top: 0;
}

.alarme .legende,
.alarme p {
  color: color-mix(in srgb, var(--papier) 78%, var(--nuit));
}

.alarme__somme {
  font-size: var(--t-alarme);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.05em;
  word-spacing: -0.06em;
  display: block;
}

.alarme p {
  margin-top: 1.5rem;
  max-width: 48ch;
  font-size: clamp(1.0625rem, 1.7vw, 1.25rem);
}

/* -------------------------------------------------------------------------- */
/* Feuille de spécifications — étapes, arguments, questions.                   */
/* No card grid: hairline rows on the page ground.                             */
/* -------------------------------------------------------------------------- */

.specs {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--gravier);
}

.specs > div,
.specs > .spec {
  display: grid;
  gap: 0.25rem 2rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--gravier);
}

@media (min-width: 48rem) {
  .specs > div,
  .specs > .spec {
    grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
    align-items: baseline;
  }
}

.specs dt {
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.specs p,
.specs dd {
  color: var(--bitume);
  max-width: var(--mesure);
}

/* The only numbering on the page: this really is a sequence. */
.etapes {
  counter-reset: etape;
}

.etapes > .spec {
  position: relative;
}

@media (min-width: 48rem) {
  .etapes > .spec {
    grid-template-columns: 2.75rem minmax(0, 17.25rem) minmax(0, 1fr);
  }
}

.etapes h3::before {
  counter-increment: etape;
  content: counter(etape);
  font-weight: 600;
  color: var(--bitume);
  margin-right: 0.7rem;
}

@media (min-width: 48rem) {
  .etapes h3 {
    grid-column: 2;
  }

  .etapes h3::before {
    position: absolute;
    left: 0;
    margin: 0;
    font-size: 1.75rem;
    line-height: 0.95;
  }

  .etapes p {
    grid-column: 3;
  }
}

/* -------------------------------------------------------------------------- */
/* Simulateur                                                                  */
/* -------------------------------------------------------------------------- */

.sim {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 62rem) {
  .sim {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: start;
  }
}

.champs {
  display: grid;
  gap: 1.25rem;
  max-width: 34rem;
}

.champ {
  display: grid;
  gap: 0.4rem;
}

.champ > label,
.champ > .champ__titre {
  font-size: var(--t-legende);
  font-weight: 700;
}

.champ input[type='date'],
.champ input[type='number'],
.champ input[type='text'] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--gravier);
  border-radius: 10px;
  background: var(--cadran);
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.champ__aide {
  font-size: 0.8125rem;
  color: var(--bitume);
}

.raccourcis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.raccourcis button {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--gravier);
  border-radius: 999px;
  background: transparent;
  color: var(--bitume);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.raccourcis button:hover {
  border-color: var(--bitume);
  color: var(--nuit);
}

.raccourcis button[aria-pressed='true'] {
  background: var(--nuit);
  border-color: var(--nuit);
  color: var(--papier);
}

.duree {
  display: flex;
  gap: 0.4rem;
}

.duree label {
  flex: 1;
  position: relative;
}

.duree input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.duree span {
  display: block;
  padding: 0.5rem 0;
  text-align: center;
  border: 1px solid var(--gravier);
  border-radius: 10px;
  font-weight: 600;
  color: var(--bitume);
}

.duree input:checked + span {
  background: var(--nuit);
  border-color: var(--nuit);
  color: var(--papier);
}

.duree input:focus-visible + span {
  outline: 3px solid var(--panneau);
  outline-offset: 3px;
}

.sim__note {
  margin-top: 1.5rem;
  font-size: var(--t-legende);
  color: var(--bitume);
  max-width: 40ch;
}

.resultat {
  margin-top: 0;
}

.resultat__lignes {
  display: grid;
  gap: 0.75rem;
}

.ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.ligne dt {
  font-size: var(--t-legende);
  color: var(--bitume);
}

.ligne dd {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  word-spacing: -0.08em;
  text-align: right;
}

.ligne--fort dd {
  font-size: var(--t-chiffre);
  font-weight: 700;
}

.handback {
  font-size: 0.8125rem;
  color: var(--bitume);
  max-width: 42ch;
}

/* -------------------------------------------------------------------------- */
/* Questions fréquentes                                                        */
/* -------------------------------------------------------------------------- */

.faq {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--gravier);
  max-width: 52rem;
}

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

.faq summary {
  padding-block: 1.125rem;
  padding-right: 2rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
}

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

.faq summary::after {
  content: '';
  position: absolute;
  right: 0.35rem;
  top: 1.7rem;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--bitume);
  border-bottom: 2px solid var(--bitume);
  transform: rotate(45deg);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  top: 1.85rem;
}

.faq details > p {
  padding-bottom: 1.25rem;
  color: var(--bitume);
  max-width: var(--mesure);
}

/* -------------------------------------------------------------------------- */
/* Pied de page                                                                */
/* -------------------------------------------------------------------------- */

.pied {
  border-top: 1px solid var(--gravier);
}

.pied > .wrap {
  padding-block: clamp(2rem, 4vw, 3rem);
  display: grid;
  gap: 1.25rem;
}

.pied nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  font-size: var(--t-legende);
}

.pied .marques {
  font-size: 0.8125rem;
  color: var(--bitume);
  max-width: 60ch;
}

/* -------------------------------------------------------------------------- */
/* Pages de texte (confidentialité, mentions légales, 404)                     */
/* -------------------------------------------------------------------------- */

/* The wrap keeps its full width on every page, so the left rail sits at the
   same x from the hero to the legal notice. The text column is narrowed
   inside it, never by centring a smaller container. */
.texte > .wrap {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.texte h1,
.texte h2,
.texte p,
.texte ul,
.texte ol,
.texte dl {
  max-width: 52rem;
}

.texte h1 {
  max-width: 34ch;
}

.texte h2 {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--gravier);
  font-size: 1.3125rem;
}

.texte p,
.texte li {
  margin-top: 1rem;
  max-width: var(--mesure);
  color: var(--bitume);
}

.texte h2 + p {
  margin-top: 0.875rem;
}

.texte ul {
  padding-left: 1.25rem;
}

.texte dl.releve {
  margin-top: 1rem;
}

.texte dl.releve div {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--gravier);
}

@media (min-width: 40rem) {
  .texte dl.releve div {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* The last row's rule would double up with the next heading's own rule. */
.texte dl.releve div:last-child {
  border-bottom: 0;
}

.texte dl.releve dt {
  font-weight: 700;
  font-size: var(--t-legende);
}

.texte dl.releve dd {
  color: var(--bitume);
}

.maj {
  margin-top: 2rem;
  font-size: var(--t-legende);
}

/* -------------------------------------------------------------------------- */
/* Utilitaires                                                                 */
/* -------------------------------------------------------------------------- */

.compteur-legende {
  margin-top: 0.6rem;
}

.champ--groupe {
  border: 0;
  padding: 0;
  margin: 0;
}

.note-diagnostic {
  margin-top: 1.25rem;
}
