/* SICOS Motors - pre-enrolement en ligne
   Polices : Bricolage Grotesque (titres, code) et Atkinson Hyperlegible (texte), toutes deux sous licence SIL OFL, hebergees ici (voir LICENSES.txt). */

@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #0F211A;
  --ink-2: #1C3A2E;
  --green: #0E7C4A;
  --green-dk: #0A6339;
  --mint: #2FBF86;
  --mint-soft: #DFF2E7;
  --blue: #1D5FAE;
  --road: #F6BC1B;
  --road-soft: #FDF1CC;
  --page: #EDF2EE;
  --card: #FFFFFF;
  --edge: #C5CEC8;
  --line: #D9E0DB;
  --muted: #55645C;
  --red: #C0182B;
  --red-soft: #FDECEA;
  --display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font: 400 17px/1.5 var(--body);
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- en-tete ---------- */
/* En-tete fixe : reste visible en haut quand on fait defiler la page (logo + langue) */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; box-shadow: 0 8px 18px -14px rgba(15,33,26,.45); }
.top__in { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 50px; width: auto; display: block; }
.lang { display: inline-flex; background: var(--page); border-radius: 999px; padding: 3px; }
.lang__btn { border: 0; background: transparent; min-width: 48px; min-height: 40px; padding: 0 12px; border-radius: 999px; font-weight: 700; color: var(--muted); cursor: pointer; }
.lang__btn[aria-pressed="true"] { background: var(--ink); color: #fff; }

.main { flex: 1; padding-top: 28px; padding-bottom: 56px; outline: none; }
.boot { color: var(--muted); padding: 40px 0; }

/* ---------- le pass (le QR code) ---------- */
.pass { position: relative; width: 100%; max-width: 372px; background: #fff; border-radius: 22px; box-shadow: 0 1px 0 rgba(15,33,26,.05), 0 22px 40px -22px rgba(15,33,26,.45); }
.pass__head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 18px 22px; background: var(--ink); color: #fff; border-radius: 22px 22px 0 0; }
.pass__head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--road) 0 20px, transparent 20px 32px); }
.pass__logo { flex: none; background: #fff; border-radius: 10px; padding: 3px 6px; display: grid; place-items: center; }
.pass__logo img { display: block; height: 34px; width: auto; }
.pass__title { font: 700 19px/1.15 var(--display); }
.pass__sub { font-size: 13.5px; opacity: .78; }
.pass__body { padding: 18px 20px 20px; display: grid; gap: 4px; }
.pass__name { font: 800 25px/1.1 var(--display); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.pass__name.is-empty { color: #A5B2AB; }
.pass__line { font-size: 16px; color: var(--muted); }
.pass__line strong { color: var(--ink); }
.pass__cut { position: relative; margin: 0 22px; border-top: 2px dashed var(--edge); height: 0; }
.pass__cut::before, .pass__cut::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--page); }
.pass__cut::before { left: -34px; }
.pass__cut::after { right: -34px; }
.pass__stub { padding: 22px 20px 22px; display: grid; justify-items: center; gap: 14px; background: linear-gradient(#fff, #fff); border-radius: 0 0 22px 22px; }
.pass__qr { position: relative; width: 100%; max-width: 252px; aspect-ratio: 1; background: #fff; }
.pass__qr canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.pass__qr.is-ghost canvas { opacity: .16; filter: grayscale(1); }
.pass__ghost { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px; }
.pass__ghost span { background: rgba(255,255,255,.92); border-radius: 10px; padding: 8px 12px; font: 700 15.5px/1.25 var(--display); color: var(--ink-2); }
.pass__code { font: 700 clamp(20px, 6.6vw, 26px)/1 var(--body); letter-spacing: .1em; text-align: center; white-space: nowrap; }
.pass__code.is-empty { color: #B8C3BC; }
.pass__valid { font-size: 14.5px; color: var(--muted); text-align: center; }
.pass__tag { position: absolute; z-index: 3; top: -12px; right: -10px; background: var(--road); color: var(--ink); font: 800 14px/1 var(--display); padding: 7px 12px; border-radius: 8px; transform: rotate(4deg); box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); }
.pass--off .pass__qr { display: none; }
.pass--off .pass__code { text-decoration: line-through; color: var(--muted); }

/* ---------- accueil ---------- */
.home { display: grid; gap: 36px; }
.hero { display: grid; gap: 28px; align-items: center; }
.hero__text { display: grid; gap: 18px; justify-items: start; }
.hero h1 { font-size: clamp(2.05rem, 7.2vw, 3.6rem); font-weight: 800; letter-spacing: -0.025em; }
.hero__lead { font-size: 1.12rem; max-width: 34em; color: var(--ink-2); }
.hero__cta { display: grid; gap: 12px; margin-top: 4px; width: 100%; max-width: 440px; }
.nb { white-space: nowrap; }
.hero__pass { display: grid; justify-items: center; padding: 10px 0 6px; }

.how { display: grid; gap: 14px; counter-reset: how; padding: 0; margin: 0; list-style: none; }
.how li { counter-increment: how; display: grid; grid-template-columns: 44px 1fr; gap: 4px 14px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.how li::before { content: counter(how); grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--road); display: grid; place-items: center; font: 800 22px/1 var(--display); }
.how b { font: 700 18px/1.25 var(--display); align-self: end; }
.how span { color: var(--muted); font-size: 16px; }

.prep { background: var(--mint-soft); border-radius: 18px; padding: 18px 18px 18px; display: grid; gap: 10px; }
.prep h2 { font-size: 1.25rem; }
.prep ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.prep li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.prep li::before { content: ""; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 24px; border-radius: 14px; border: 2px solid transparent; font: 700 17px/1.1 var(--body); text-decoration: none; cursor: pointer; text-align: center; transition: background-color .15s, border-color .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover:not([disabled]) { background: var(--green-dk); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--edge); }
.btn--ghost:hover:not([disabled]) { border-color: var(--ink); }
.btn--road { background: var(--road); color: var(--ink); }
.btn--road:hover:not([disabled]) { background: #E5AB0A; }
.btn--danger { background: #fff; color: var(--red); border-color: #E3B3B9; }
.btn--text { background: transparent; color: var(--blue); min-height: 44px; padding: 0 6px; text-decoration: underline; text-underline-offset: 3px; }
.btn--block { width: 100%; }
.btn svg { flex: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- formulaire ---------- */
.layout { display: grid; gap: 24px; align-items: start; }
.aside { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 22px 18px 20px; display: grid; gap: 22px; }
.stephead { display: grid; gap: 14px; margin-bottom: 4px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.steps li { flex: 1; height: 7px; border-radius: 4px; background: var(--line); }
.steps li.is-done { background: var(--green); }
.steps li.is-now { background: var(--road); }
.stepcount { font-size: 15px; color: var(--muted); }
.card h2 { font-size: clamp(1.6rem, 5.4vw, 2.1rem); font-weight: 800; }
.card__intro { color: var(--muted); margin-top: -10px; }

.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.label, .field legend { font-weight: 700; font-size: 16.5px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 15px; margin-left: 4px; }
.hint { font-size: 15px; color: var(--muted); }
.err { font-size: 15px; font-weight: 700; color: var(--red); display: none; }
.field.is-bad .err { display: block; }
.input, .select {
  width: 100%; min-height: 54px; padding: 12px 14px; background: #fff;
  border: 1.5px solid var(--edge); border-radius: 12px; font-size: 17px; line-height: 1.3;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.input[data-upper] { text-transform: uppercase; }
.select { padding-right: 44px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%230F211A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center/22px no-repeat; text-overflow: ellipsis; }
.select:disabled { background-color: #F4F6F5; color: #8B9791; cursor: not-allowed; }
.input:focus, .select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(47,191,134,.3); }
.field.is-bad .input, .field.is-bad .select { border-color: var(--red); background-color: var(--red-soft); }
.grid2 { display: grid; gap: 22px; align-items: start; }
.phone { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.phone__cc { display: grid; place-items: center; padding: 0 14px; border-radius: 12px; background: var(--page); border: 1.5px solid var(--edge); font-weight: 700; }

/* cartes a choisir (usage, type) */
.choices { display: grid; gap: 10px; }
.choice { display: block; position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice__box { display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; padding: 15px 16px; border: 1.5px solid var(--edge); border-radius: 16px; background: #fff; transition: border-color .15s, background-color .15s; }
.choice__mark { width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--edge); background: #fff center/70% no-repeat; }
.choice__text { display: grid; gap: 2px; }
.choice__text b { font: 700 18px/1.2 var(--display); }
.choice__text span { color: var(--muted); font-size: 15.5px; }
.choice input:checked + .choice__box { border-color: var(--green); background: var(--mint-soft); }
.choice input:checked + .choice__box .choice__mark { border-color: var(--green); background-color: var(--green); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.choice input:focus-visible + .choice__box { outline: 3px solid var(--blue); outline-offset: 2px; }
.field.is-bad .choice__box { border-color: var(--red); }

/* pastilles (sexe, taille, oui / non) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pill span { display: grid; place-items: center; min-width: 56px; min-height: 50px; padding: 0 16px; border: 1.5px solid var(--edge); border-radius: 12px; background: #fff; font-weight: 700; transition: border-color .15s, background-color .15s, color .15s; }
.pill input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.pill input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.field.is-bad .pill span { border-color: var(--red); }
.pills--fill .pill { flex: 1; }
.pills--fill .pill span { width: 100%; }

.subform { display: grid; gap: 18px; padding: 16px; border-radius: 16px; background: var(--page); }
.note { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 14px; border-radius: 14px; background: var(--road-soft); font-size: 15.5px; }
.note::before { content: "i"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--road); font: 800 14px/1 var(--display); }
.note--ok { background: var(--mint-soft); }
.note--bad { background: var(--red-soft); color: #7A1020; }
.note--bad::before { content: "!"; background: var(--red); color: #fff; }

.nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav .btn--primary { flex: 1; max-width: 320px; margin-left: auto; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* recapitulatif */
.recap { display: grid; gap: 14px; }
.recap__sec { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.recap__h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 8px 4px 16px; background: var(--page); }
.recap__h h3 { font-size: 1.05rem; }
.recap dl { margin: 0; padding: 4px 16px 10px; display: grid; }
.recap dl > div { display: grid; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.recap dl > div:last-child { border-bottom: 0; }
.recap dt { color: var(--muted); font-size: 14.5px; }
.recap dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.consent { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.consent input { width: 26px; height: 26px; margin: 0; accent-color: var(--green); }
.field.is-bad .consent { color: var(--red); }

/* ---------- resultat ---------- */
.result { display: grid; gap: 26px; grid-template-areas: "title" "pass" "rest"; }
.result__title { grid-area: title; display: grid; gap: 10px; justify-items: start; align-self: start; }
.result__rest { grid-area: rest; display: grid; gap: 22px; justify-items: start; align-content: start; }
.result h1 { font-size: clamp(1.9rem, 6.4vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
.result__lead { color: var(--ink-2); max-width: 34em; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 15.5px; background: var(--road-soft); }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--road); }
.status--done { background: var(--mint-soft); }
.status--done::before { background: var(--green); }
.status--expired, .status--cancelled { background: var(--red-soft); }
.status--expired::before, .status--cancelled::before { background: var(--red); }
.actions { display: grid; gap: 10px; width: 100%; max-width: 420px; }
.actions__more { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.next { display: grid; gap: 12px; width: 100%; max-width: 560px; padding: 0; margin: 0; list-style: none; counter-reset: nx; }
.next li { counter-increment: nx; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.next li::before { content: counter(nx); width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--road); display: grid; place-items: center; font: 800 17px/1 var(--display); }
.pass-wrap { grid-area: pass; display: grid; justify-items: center; padding-top: 6px; }

.findbox { max-width: 560px; }

/* ---------- messages, fenetre ---------- */
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 12px 30px -12px rgba(0,0,0,.6); }
.modal { position: fixed; inset: 0; background: rgba(15,33,26,.55); display: grid; place-items: center; padding: 16px; z-index: 55; }
.modal__box { background: #fff; border-radius: 20px; padding: 22px 20px; width: 100%; max-width: 440px; display: grid; gap: 14px; }
.modal__box h2 { font-size: 1.4rem; }
.modal__btns { display: grid; gap: 10px; margin-top: 4px; }

/* ---------- pied de page ---------- */
.foot { border-top: 1px solid var(--line); background: #fff; }
.foot__in { padding-top: 22px; padding-bottom: 28px; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.foot__help a { font-weight: 700; }

/* ---------- grands ecrans ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .hero__cta { display: flex; flex-wrap: wrap; width: auto; max-width: none; }
  .choices--row { grid-template-columns: 1fr 1fr; }
  .card { padding: 30px 30px 26px; }
  .actions { grid-template-columns: 1fr 1fr; max-width: 560px; }
  .actions .btn--wide { grid-column: 1 / -1; }
  .modal__btns { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .main { padding-top: 48px; }
  .hero { grid-template-columns: 1.15fr .85fr; gap: 56px; }
  .hero__pass .pass { transform: rotate(-2.4deg); }
  .how { grid-template-columns: repeat(3, 1fr); }
  .how li { grid-template-columns: 1fr; padding: 22px; gap: 10px; }
  .how li::before { grid-row: auto; }
  .prep ul { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .result { grid-template-columns: 1fr 372px; grid-template-areas: "title pass" "rest pass"; column-gap: 64px; row-gap: 24px; align-items: start; grid-template-rows: auto 1fr; }
  .pass-wrap { justify-items: end; }
}
@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr) 372px; gap: 48px; }
  .aside { display: block; position: sticky; top: 96px; }
}

/* ---------- mouvement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@keyframes stamp { from { transform: rotate(4deg) translateY(-12px); opacity: 0; } to { transform: rotate(4deg); opacity: 1; } }
.pass__tag--new { animation: stamp .45s cubic-bezier(.2,.9,.3,1.2) .25s both; }

/* ---------- impression : seulement le pass ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; display: block; min-height: 0; }
  .top, .foot, .skip, .toast, .modal, .result__title, .result__rest, .aside, .pass__tag { display: none !important; }
  .main { padding: 0; max-width: none; }
  .result { display: block; }
  .pass-wrap { justify-items: start; }
  .pass { box-shadow: none; border: 1.5px solid #000; max-width: 360px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pass__cut::before, .pass__cut::after { background: #fff; }
}
