/* Charte graphique Carwise, palette B : voir ../CLAUDE.md */
:root {
  --encre: #0E1D20;
  --encre-2: #3C5156;
  --encre-3: #5E7478;
  --filet: #D7E0DE;
  --porcelaine: #F6F8F7;
  --petrole: #1F5A7A;
  --petrole-fonce: #164660;
  --bleu-clair: #8FB8CE;
  --bleu-pale: #E3EDF3;
  --brique: #B5483A;
  --brique-fonce: #9A3B2F;
  --valide: #2F6B45;
  --alerte: #9B2F35;
  --vert-wa: #1fa855;
  --rayon: 8px;
  --serif: "Source Serif 4", Constantia, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--porcelaine);
  color: var(--encre);
  line-height: 1.45;
  padding-bottom: 96px;
}
h1, h2 { font-family: var(--serif); font-weight: 600; }
h1 { font-size: 1.45rem; margin: 18px 0 12px; }
h2 { font-size: 1.05rem; margin: 14px 0 8px; color: var(--petrole); }
a { color: var(--petrole); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--petrole); outline-offset: 2px; }
.topbar :focus-visible { outline-color: #fff; }

/* En-tête : bandeau bleu pétrole */
.topbar { background: var(--petrole); color: #fff; }
/* Le bandeau garde le même ordre dans toutes les langues : logo, titre, téléphone, puis langues */
.topbar__inner { direction: ltr; max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; }
.topbar__logo { width: 100px; height: auto; display: block; }
.topbar__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.topbar__text strong { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.topbar__text span { font-size: .85rem; color: var(--bleu-pale); }
.topbar__phone { color: #fff; text-decoration: none; background: var(--petrole-fonce); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
.topbar__phone svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Étapes */
.stepper { background: #fff; border-bottom: 1px solid var(--filet); position: sticky; top: 0; z-index: 5; }
.stepper ol { list-style: none; margin: 0 auto; padding: 10px 12px; max-width: 960px; display: flex; justify-content: space-between; gap: 4px; }
.stepper li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .76rem; color: var(--encre-2); flex: 1; text-align: center; }
.stepper li span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--filet); color: var(--encre-2); font-weight: 700; font-size: .8rem; }
.stepper li.is-current { color: var(--encre); font-weight: 600; }
.stepper li.is-current span { background: var(--petrole); color: #fff; }
.stepper li.is-done { cursor: pointer; }
.stepper li.is-done span { background: var(--bleu-pale); color: var(--petrole); }

.container { max-width: 960px; margin: 0 auto; padding: 0 16px 24px; }
.hint { color: var(--encre-2); font-size: .92rem; margin-top: -4px; }
.card { background: #fff; border: 1px solid var(--filet); border-radius: var(--rayon); padding: 16px; margin-bottom: 12px; }
.card.info { border-inline-start: 3px solid var(--petrole); background: var(--bleu-pale); border-color: var(--bleu-pale); border-inline-start-color: var(--petrole); }

/* Filtres */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { border: 1px solid var(--filet); background: #fff; color: var(--encre); border-radius: 6px; padding: 8px 14px; font: inherit; font-size: .88rem; white-space: nowrap; cursor: pointer; }
.chip.is-active { background: var(--petrole); color: #fff; border-color: var(--petrole); }

/* Véhicules */
.vehicles { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .vehicles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .vehicles { grid-template-columns: repeat(3, 1fr); } }
.vehicle {
  display: flex; flex-direction: column; gap: 6px; text-align: start; font: inherit; color: inherit;
  background: #fff; border: 2px solid var(--filet); border-radius: var(--rayon);
  padding: 12px; cursor: pointer; transition: border-color .15s, background .15s;
}
.vehicle:hover { border-color: var(--bleu-clair); }
.vehicle.is-selected { border-color: var(--petrole); background: var(--bleu-pale); }
.vehicle img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; border-radius: 6px; }
.vehicle__name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.vehicle__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.vehicle__tags span { font-size: .75rem; background: var(--porcelaine); border: 1px solid var(--filet); padding: 2px 8px; border-radius: 4px; color: var(--encre-2); }
.vehicle__tags .tag--gold { background: var(--bleu-pale); border-color: var(--bleu-pale); color: var(--petrole); font-weight: 600; }
.vehicle__price { font-weight: 700; color: var(--encre); }
.vehicle__price small { color: var(--encre-2); font-weight: 400; }
/* Téléphone : carte horizontale, photo à gauche, pour voir plus de véhicules à l'écran */
@media (max-width: 599px) {
  .vehicle { display: grid; grid-template-columns: 42% 1fr; grid-template-rows: auto auto 1fr; column-gap: 12px; row-gap: 4px; padding: 10px; }
  .vehicle img { grid-row: 1 / 4; align-self: center; }
  .vehicle__name { font-size: 1.02rem; }
  .vehicle__price { align-self: end; font-size: .95rem; }
}

/* Formulaires */
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; margin-bottom: 12px; }
input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select, textarea {
  font: inherit; font-weight: 400; font-size: 1rem; padding: 11px 12px; border: 1px solid var(--encre-3);
  border-radius: 6px; background: #fff; width: 100%; color: var(--encre);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--petrole); outline-offset: 1px; }
.tel { display: grid; grid-template-columns: minmax(0, 40%) 1fr; gap: 8px; margin-bottom: 12px; }
.tel select { text-overflow: ellipsis; font-family: var(--sans), "Noto Color Emoji"; }
label[for="telephone"] { margin-bottom: 4px; }
.row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; cursor: pointer; margin: 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--petrole); flex-shrink: 0; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--encre-2); }
.option input[type="text"] { margin-top: 12px; }
.check--cgu { margin: 8px 0 12px; }
.check--accord { background: var(--bleu-pale); color: var(--encre); padding: 10px 12px; border-radius: 6px; margin: 10px 0 0; }
.check--accord span { display: inline; }
.check--cgu span { display: inline; }
.error { color: var(--alerte); font-size: .9rem; font-weight: 600; min-height: 1em; margin: 4px 0 0; }
.promo { background: var(--bleu-pale); color: var(--encre); padding: 10px 12px; border-radius: 6px; font-size: .92rem; }
.promo:empty { display: none; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--porcelaine); border: 1px solid var(--filet); padding: 3px; border-radius: 6px; margin-bottom: 14px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { text-align: center; padding: 9px; border-radius: 4px; cursor: pointer; font-weight: 600; color: var(--encre-2); }
.segmented input:checked + span { background: var(--petrole); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--petrole); outline-offset: 2px; }

/* Devis */
.devis-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.devis-head img { width: 110px; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--filet); }
.devis-head div { display: flex; flex-direction: column; font-size: .88rem; color: var(--encre-2); }
.devis-head strong { font-family: var(--serif); font-weight: 600; color: var(--encre); font-size: 1.1rem; }
.devis-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.devis-table th, .devis-table td { padding: 8px 4px; border-bottom: 1px solid var(--filet); text-align: start; vertical-align: top; }
.devis-table th { font-size: .74rem; color: var(--encre-2); background: var(--porcelaine); text-transform: uppercase; letter-spacing: .08em; }
.devis-table .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.devis-table tfoot td { font-weight: 700; font-size: 1.05rem; background: var(--bleu-pale); border-bottom: 0; padding: 12px 8px; }
.devis-table--compact td small { display: block; color: var(--encre-2); font-size: .8rem; }
.devis-table--compact td.num { font-weight: 600; }
.lettres { font-size: .85rem; color: var(--encre-2); }
.devis-infos { padding-inline-start: 18px; font-size: .9rem; margin: 8px 0 0; }
.notice { font-size: .88rem; color: var(--encre-2); text-align: center; }
.actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) { .actions { flex-direction: row; } .actions .btn { flex: 1; } }
.toast { text-align: center; color: var(--valide); font-weight: 600; min-height: 1.2em; }
.conditions { padding-inline-start: 18px; font-size: .9rem; }
.conditions li { margin-bottom: 8px; }

/* Boutons : bleu pétrole par défaut, une seule touche brique par écran */
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 6px; padding: 13px 18px; cursor: pointer; text-align: center; transition: background .15s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--petrole); color: #fff; }
.btn--primary:not(:disabled):hover { background: var(--petrole-fonce); }
.btn--primary.btn--brique { background: var(--brique); }
.btn--primary.btn--brique:not(:disabled):hover { background: var(--brique-fonce); }
.btn--ghost { background: #fff; color: var(--petrole); border: 1px solid var(--petrole); }
.btn--back { background: transparent; color: var(--petrole); padding: 13px 8px; }
.btn--whatsapp { background: var(--vert-wa); color: #fff; }

/* Barre du bas */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--filet); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
.bottombar__inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.bottombar__total { flex: 1; display: flex; flex-direction: column; text-align: end; min-width: 0; }
.bottombar__total small { color: var(--encre-2); font-size: .75rem; }
.bottombar__total strong { font-size: 1.08rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Confirmation */
.done { text-align: center; padding: 28px 18px; margin-top: 24px; }
.done__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--valide); color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto; }

/* Fenêtre conditions */
.modal { border: 0; border-radius: var(--rayon); padding: 18px; max-width: 560px; width: calc(100% - 32px); max-height: 85vh; color: var(--encre); }
.modal::backdrop { background: rgba(14, 29, 32, .5); }
.modal__head { display: flex; justify-content: space-between; align-items: center; }
.modal__head h2 { margin: 0; }
.modal__close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--encre-2); }
.modal .btn { width: 100%; }

/* Impression du devis */
.print-only { display: none; }
@media print {
  body { background: #fff; padding: 0; }
  body > *:not(#devis-print) { display: none !important; }
  .print-only { display: block; font-size: 10.5pt; color: var(--encre); }
  .p-head { display: flex; gap: 18px; align-items: center; background: var(--petrole); color: #fff; padding: 8px 14px; margin-bottom: 14px; font-size: 9.5pt; border-radius: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-head img { width: 28mm; height: auto; }
  .p-head strong { font-family: var(--serif); font-size: 12pt; font-weight: 600; }
  .print-only h1 { font-size: 16pt; margin: 6px 0 2px; }
  .print-only h2 { color: var(--petrole); font-size: 11.5pt; }
  .p-client { border: 1px solid var(--filet); padding: 8px 10px; margin: 10px 0; border-radius: 4px; }
  .devis-table th, .devis-table td { border: 1px solid var(--filet); padding: 5px 6px; }
  .devis-table th { background: var(--porcelaine); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .devis-table tfoot td { background: var(--bleu-pale); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only p { margin: 6px 0; }
  .conditions { font-size: 8.5pt; margin: 4px 0; }
  .conditions li { margin-bottom: 2px; }
  .p-legal { border-top: 1px solid var(--filet); margin-top: 12px; padding-top: 6px; font-size: 8.5pt; font-style: italic; color: var(--encre-3); text-align: center; }
  @page { margin: 14mm; }
}

/* Choix de la langue */
.langues { direction: ltr; max-width: 960px; margin: 0 auto; padding: 0 16px 10px; display: flex; gap: 6px; }
.langue { flex: 1; font: inherit; font-size: .85rem; font-weight: 600; color: #fff; background: transparent; border: 1px solid var(--bleu-clair); border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.langue.is-active { background: #fff; color: var(--petrole); border-color: #fff; }
.langue[lang="ar"] { font-size: .9rem; }

/* Arabe : lecture de droite à gauche (Source Sans 3 et Source Serif 4 n'ont pas de lettres arabes) */
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] .topbar__text strong, [dir="rtl"] .vehicle__name { font-family: inherit; }
[dir="rtl"] .topbar__text { direction: rtl; text-align: left; }
[dir="rtl"] .check input { margin-top: 4px; }
.note-traduction { font-size: .82rem; color: var(--encre-2); font-style: italic; }
.stepper li b { font-weight: inherit; }
