/* Coliup — chaux blanche, bleu de Sidi Bou Saïd, jaune taxi. */
:root {
  --chaux: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --bleu: #0f4c9c;
  --bleu-deep: #0a3570;
  --on-bleu: #ffffff;
  --jaune: #ffc81e;
  --jaune-deep: #e5ad00;
  --ink: #14213d;
  --muted: #5b6b85;
  --line: #dce3ee;
  --ok: #1e8e5a;
  --warn: #b26a00;
  --danger: #c8352b;
  --shadow-sheet: 0 -10px 40px rgba(20, 33, 61, 0.16);
  --shadow-float: 0 6px 24px rgba(20, 33, 61, 0.18);
  --r-sheet: 24px;
  --r-control: 14px;
  --r-small: 8px;
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

/* Interface chauffeur : thème de nuit, lisible au volant. */
.theme-night {
  --chaux: #081831;
  --surface: #0f2549;
  --surface-2: #163261;
  --bleu: #6aa6ff;
  --bleu-deep: #3f86f0;
  --ink: #edf2fb;
  --muted: #9fb2d1;
  --line: #24416f;
  --ok: #3ccf8e;
  --warn: #ffb547;
  --danger: #ff6b5e;
  --on-bleu: #081831;
  --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.5);
  --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* Passagers et admin suivent le réglage clair / sombre du téléphone ou de l'ordinateur. */
@media (prefers-color-scheme: dark) {
  :root {
    --chaux: #0b1424;
    --surface: #131f35;
    --surface-2: #1b2a46;
    --bleu: #6aa6ff;
    --bleu-deep: #8fbcff;
    --on-bleu: #0b1424;
    --ink: #e9eef8;
    --muted: #a3b2cc;
    --line: #2a3d60;
    --ok: #3ccf8e;
    --warn: #ffb547;
    --danger: #ff7a6e;
    --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.5);
    --shadow-float: 0 6px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

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

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--chaux);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--bleu); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ——— Boutons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px;
  border: 0; border-radius: var(--r-control);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--bleu); color: var(--on-bleu); }
.btn--primary:hover:not(:disabled) { background: var(--bleu-deep); }
.btn--taxi { background: var(--jaune); color: #14213d; }
.btn--taxi:hover:not(:disabled) { background: var(--jaune-deep); }
.btn--ghost { background: var(--surface-2); color: var(--ink); }
.btn--danger-text { background: transparent; color: var(--danger); min-height: 44px; }
.btn--danger { background: var(--danger); color: #fff; }

/* ——— Propositions des chauffeurs (passager) et choix du prix (chauffeur) ——— */
.proposals__title { font-size: 1.05rem; margin: 0 0 8px; }
.proposals { display: grid; gap: 10px; margin-bottom: 14px; }
.proposal { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1.5px solid var(--line); }
.proposal--raised { border-color: var(--warn); }
.proposal__head { display: flex; align-items: center; gap: 12px; }
.proposal__head .person__text { flex: 1; min-width: 0; }
.proposal .avatar, .proposal .chip { background: var(--surface); }
.proposal__price { display: grid; text-align: end; }
.proposal__price strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.proposal__price span { font-size: 0.8rem; color: var(--muted); }
.proposal--raised .proposal__price span { color: var(--warn); }
.raises { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.raise { min-height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 600; cursor: pointer; }
.raise[aria-checked="true"] { background: var(--jaune); border-color: var(--jaune); color: #14213d; }
.offer-sent { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.offer-sent span { color: var(--muted); font-size: 0.92rem; }
.reasons { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.reason { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.reason input { width: 18px; height: 18px; accent-color: var(--bleu); }
.field textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.btn--block { width: 100%; }
.btn--small { min-height: 36px; padding: 0 12px; font-size: 0.9rem; border-radius: var(--r-small); }
.btn .ico { width: 20px; height: 20px; }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-float); cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }

/* ——— Formulaires ——— */
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.875rem; color: var(--muted); }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-control);
  background: var(--surface); font-size: 1rem;
}
.input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bleu) 20%, transparent); }
.form-error { color: var(--danger); font-size: 0.9rem; min-height: 1.3em; }
.ico { width: 20px; height: 20px; flex: none; }
.icon-btn .ico { width: 22px; height: 22px; }

/* Champ avec indicatif (+216) ou bouton (afficher le mot de passe) */
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; min-width: 0; }
.input-group__prefix {
  display: flex; align-items: center; padding: 0 12px; border: 1.5px solid var(--line); border-right: 0;
  border-radius: var(--r-control) 0 0 var(--r-control); background: var(--surface-2); color: var(--muted); font-weight: 500;
}
.input-group__prefix + .input { border-radius: 0 var(--r-control) var(--r-control) 0; letter-spacing: 0.04em; }
.input-group__action {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.input-group__action:hover { color: var(--ink); background: var(--surface-2); }
.input-group .input:has(+ .input-group__action) { padding-right: 52px; }

.auth__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: 0.92rem; }
.auth__points li { display: flex; gap: 10px; align-items: center; }
.auth__points .ico { width: 18px; height: 18px; color: var(--ok); }

/* ——— Écran de connexion ——— */
/* Bandeau bleu nuit avec le logo Coliup ; le logo rétrécit pendant la saisie pour laisser la place au formulaire. */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; background: var(--chaux); }
.auth__hero {
  width: 100%; display: grid; justify-items: center; gap: 10px;
  padding: max(28px, env(safe-area-inset-top)) 16px 56px; background: #0b1f3f;
}
.auth__logo { width: 230px; height: auto; transition: width 0.25s ease; }
.auth__tagline { color: #d7e2f4; font-weight: 500; text-align: center; max-height: 3em; transition: opacity 0.2s ease, max-height 0.25s ease; }
.auth:focus-within .auth__logo { width: 112px; }
.auth:focus-within .auth__tagline { opacity: 0; max-height: 0; }
.auth__card {
  width: min(100% - 24px, 420px); margin: -32px 0 32px; padding: 22px 20px;
  display: grid; gap: 18px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-float);
}
.auth__brand h1 { font-size: 1.4rem; }
.auth__brand p { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .auth__logo, .auth__tagline { transition: none; } }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: var(--r-control); padding: 4px; }
.auth__tabs button { min-height: 42px; border: 0; border-radius: 11px; background: transparent; font-weight: 500; cursor: pointer; color: var(--muted); }
.auth__tabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 33, 61, 0.12); }

/* Menu : mode de l'app (client / transporteur) et inscription comme transporteur */
.mode-box { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.mode-box__title { font-weight: 600; }
.mode-box small { color: var(--muted); font-size: 0.85rem; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: var(--r-control); padding: 4px; }
.mode-switch button { min-height: 42px; border: 0; border-radius: 11px; background: transparent; font: inherit; font-weight: 500; cursor: pointer; color: var(--muted); }
.mode-switch button[aria-checked='true'] { background: var(--jaune); color: #14213d; font-weight: 600; }
.mode-invite {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; border-radius: 14px;
  background: var(--surface-2); color: var(--ink); font: inherit; text-align: start; cursor: pointer;
}
.mode-invite > span { flex: 1; display: grid; gap: 2px; }
.mode-invite small { color: var(--muted); font-size: 0.85rem; }
.vehicle-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border: 0; margin: 0; padding: 0; }
.vehicle-picks legend { font-size: 0.875rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
.vehicle-pick {
  display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-size: 0.9rem; font-weight: 500;
}
.vehicle-pick input { position: absolute; opacity: 0; pointer-events: none; }
.vehicle-pick:has(input:checked) { border-color: var(--jaune-deep); background: var(--jaune); color: #14213d; }
.vehicle-pick:has(input:focus-visible) { outline: 3px solid var(--jaune); outline-offset: 2px; }

/* Envois en utilitaire */
.parcel-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 0.9rem; }
.chip .ico { width: 16px; height: 16px; }
.code-field input { font-size: 1.4rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.parcel-box { display: grid; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.parcel-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.parcel-count > div { display: flex; align-items: center; gap: 10px; }
.parcel-count strong { min-width: 2.2em; text-align: center; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.depots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.depots label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); cursor: pointer; }
.depots label span { flex: 1; display: grid; }
.depots label small { color: var(--muted); font-size: 0.8rem; }
.depots label:has(input:checked) { outline: 2px solid var(--jaune-deep); }
.delivery-code { display: grid; gap: 4px; padding: 12px; border-radius: 14px; background: var(--jaune); color: #14213d; text-align: center; }
.delivery-code strong { font-size: 2rem; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

/* Choix du véhicule dans le devis : un prix par véhicule */
.vehicle-options { display: grid; gap: 8px; }
.vehicle-option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; min-height: 56px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer;
}
.vehicle-option > span { flex: 1; display: grid; gap: 1px; min-width: 0; }
.vehicle-option small { color: var(--muted); font-size: 0.8rem; }
.vehicle-option strong.num { font-variant-numeric: tabular-nums; }
.vehicle-option[aria-checked='true'] { background: var(--jaune); border-color: var(--jaune-deep); color: #14213d; }
.vehicle-option[aria-checked='true'] small { color: #14213d; }
.auth form { display: grid; gap: 14px; }
.auth__note { font-size: 0.85rem; color: var(--muted); }

.logo-mark {
  width: 48px; height: 48px; flex: none; border-radius: 14px;
  background: var(--jaune); display: grid; place-items: center;
  box-shadow: inset 0 -3px 0 rgba(20, 33, 61, 0.18);
}
.logo-mark svg { width: 30px; height: 30px; }

/* ——— Carte plein écran (passager / chauffeur) ——— */
.app-shell { position: fixed; inset: 0; overflow: hidden; }
.map { position: absolute; inset: 0; z-index: 0; background: var(--surface-2); }
.leaflet-container { font-family: var(--font); }
/* Carte claire légèrement désaturée pour faire ressortir les taxis jaunes ; version nuit inversée. */
.leaflet-tile-pane { filter: saturate(0.55) contrast(0.95); }
.tiles-night { filter: invert(1) hue-rotate(195deg) saturate(0.6) brightness(0.85) contrast(0.95); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) saturate(0.55) brightness(0.85) contrast(0.95); }
}
.theme-night .leaflet-tile-pane { filter: none; }
.leaflet-control-attribution { font-size: 10px; }

.topbar {
  position: absolute; z-index: 500; top: 0; left: 0; right: 0;
  padding: max(12px, env(safe-area-inset-top)) 12px 0;
  display: flex; gap: 10px; align-items: flex-start;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.trip-card {
  flex: 1; min-width: 0; position: relative;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-float);
  padding: 6px 6px 6px 14px;
}
.trip-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.trip-row + .trip-row { border-top: 1px solid var(--line); }
.trip-row__text { flex: 1; min-width: 0; }
.trip-row__text small { display: block; font-size: 0.75rem; color: var(--muted); }
.trip-row__text div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.trip-row input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 46px; font-size: 1.05rem; font-weight: 500; }
.trip-row input:focus { outline: none; }
.trip-row input::placeholder { color: var(--muted); font-weight: 400; }
.dot { width: 12px; height: 12px; flex: none; border-radius: 50%; }
.dot--pickup { background: var(--bleu); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bleu) 22%, transparent); }
.dot--dest { background: var(--jaune); border: 3px solid var(--ink); border-radius: 3px; }

.results {
  list-style: none; margin: 6px -6px -6px -14px; padding: 6px 0;
  border-top: 1px solid var(--line); max-height: 50vh; overflow-y: auto;
}
.results button {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 10px 16px; display: grid; gap: 2px;
}
.results button:hover, .results button:focus-visible { background: var(--surface-2); }
.results strong { font-weight: 500; }
.results span { font-size: 0.85rem; color: var(--muted); }
.results__empty { padding: 12px 16px; color: var(--muted); font-size: 0.9rem; }

/* ——— Feuille du bas ——— */
.sheet {
  position: absolute; z-index: 600; left: 0; right: 0; bottom: 0;
  max-height: 78vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-sheet);
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}
.sheet::before {
  content: ''; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line);
}
.sheet:empty { display: none; }
@media (min-width: 720px) {
  .sheet { left: 16px; right: auto; bottom: 16px; width: 400px; border-radius: var(--r-sheet); max-height: calc(100vh - 140px); }
  .topbar { right: auto; width: 432px; }
}

.sheet h2 { font-size: 1.3rem; }
.sheet__lead { color: var(--muted); }
.sheet__actions { display: grid; gap: 8px; }
.sheet__row { display: flex; gap: 8px; }
.sheet__row > * { flex: 1; }

.trip-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.trip-summary h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-summary span { color: var(--muted); white-space: nowrap; font-size: 0.95rem; }

/* ——— Le compteur : prix proposé par le passager ——— */
.fare { display: grid; gap: 10px; }
.fare-plate {
  display: grid; grid-template-columns: 56px 1fr 56px; align-items: center;
  background: var(--jaune); color: #14213d;
  border-radius: 18px; padding: 8px;
  box-shadow: inset 0 -4px 0 rgba(20, 33, 61, 0.16);
}
.fare-plate__value {
  text-align: center; font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fare-plate__value small { font-size: 1rem; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.fare-step {
  width: 56px; height: 56px; border-radius: 14px; border: 0; cursor: pointer;
  background: #14213d; color: var(--jaune); font-size: 1.8rem; font-weight: 500; line-height: 1;
  display: grid; place-items: center;
}
.fare-step:disabled { opacity: 0.3; cursor: not-allowed; }
.fare-step:active:not(:disabled) { transform: scale(0.95); }

.fare-hint { font-size: 0.92rem; color: var(--muted); }
.fare-hint[data-tone='low'] { color: var(--warn); }
.fare-hint[data-tone='high'] { color: var(--ok); }

.offer-scale { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--warn), var(--line) 30%, var(--ok)); margin: 20px 0 18px; }
.offer-scale__mark, .offer-scale__thumb { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.offer-scale__mark { width: 2px; height: 14px; background: var(--ink); }
.offer-scale__mark::after { content: 'conseillé'; position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.offer-scale__thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--bleu); transition: left 0.15s ease; }
.offer-scale__ends { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-top: -12px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500; background: var(--surface-2); color: var(--ink);
}
.badge--night { background: #14213d; color: var(--jaune); }
.theme-night .badge--night { background: var(--jaune); color: #14213d; }
.badge--ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge--warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge--danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge--blue { background: color-mix(in srgb, var(--bleu) 14%, transparent); color: var(--bleu); }

.breakdown { border-top: 1px solid var(--line); padding-top: 10px; font-size: 0.92rem; }
.breakdown summary { cursor: pointer; color: var(--muted); }
.breakdown dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 10px 0 0; }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.breakdown .total { font-weight: 600; color: var(--ink); }

/* ——— Recherche en cours ——— */
.searching { display: flex; gap: 14px; align-items: center; }
.searching__pulse { width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--jaune); position: relative; display: grid; place-items: center; }
.searching__pulse::before, .searching__pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--jaune);
  animation: pulse 2s ease-out infinite;
}
.searching__pulse::after { animation-delay: 1s; }
.searching__pulse svg { width: 26px; height: 26px; }
@keyframes pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }

/* ——— Chauffeur assigné ——— */
.status-line { font-size: 1.25rem; font-weight: 600; }
.status-line strong { color: var(--bleu); }
.person { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); display: grid; place-items: center; font-weight: 600;
}
.person__text { flex: 1; min-width: 0; }
.person__text strong { display: block; font-weight: 600; }
.person__text span { color: var(--muted); font-size: 0.92rem; }

/* Plaque minéralogique tunisienne : fond noir, caractères blancs, « تونس » au centre. */
.plate-tn {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 5px 10px; border-radius: 6px; background: #111; color: #fff;
  border: 2px solid #e8e8e8; outline: 1px solid #111;
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; direction: ltr;
}
.plate-tn__ar { font-size: 0.9rem; letter-spacing: 0; font-family: 'Readex Pro', 'Noto Naskh Arabic', serif; }

.price-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: var(--r-control); background: var(--surface-2); }
.price-line strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.price-line span { color: var(--muted); font-size: 0.9rem; }

.route-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.route-list li { position: relative; padding: 4px 0 4px 26px; min-height: 30px; }
.route-list li::before { content: ''; position: absolute; left: 3px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--bleu); }
.route-list li:last-child::before { background: var(--jaune); border-radius: 2px; outline: 2px solid var(--ink); outline-offset: -2px; }
.route-list li:not(:last-child)::after { content: ''; position: absolute; left: 7px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.route-list small { display: block; color: var(--muted); font-size: 0.78rem; }

.done-price { text-align: center; padding: 18px; border-radius: 18px; background: var(--jaune); color: #14213d; }
.done-price strong { display: block; font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ——— Repères de carte ——— */
.taxi-marker__body { width: 26px; height: 42px; transition: transform 0.6s ease; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.taxi-marker__body svg { width: 100%; height: 100%; display: block; }
.taxi-marker--busy .taxi-marker__body { opacity: 0.55; }
.taxi-marker--mine .taxi-marker__body { width: 32px; height: 52px; }

.pin-pickup { width: 22px; height: 22px; border-radius: 50%; background: var(--bleu); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--bleu), 0 3px 8px rgba(0, 0, 0, 0.3); }
.pin-pickup--searching::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--bleu);
  animation: radar 2.2s ease-out infinite;
}
@keyframes radar { from { transform: scale(1); opacity: 0.7; } to { transform: scale(7); opacity: 0; } }
.pin-dest { width: 22px; height: 22px; border-radius: 4px; background: var(--jaune); border: 4px solid #14213d; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); }

/* ——— Notifications ——— */
.toasts { position: fixed; z-index: 2000; left: 50%; top: var(--toast-top, max(12px, env(safe-area-inset-top))); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
/* Sous la barre du haut, pour ne jamais cacher le champ de destination ou le bouton En ligne. */
.app--passenger { --toast-top: calc(max(12px, env(safe-area-inset-top)) + 136px); }
.app--driver { --toast-top: calc(max(12px, env(safe-area-inset-top)) + 72px); }
@media (min-width: 720px) {
  .app--passenger .toasts { left: auto; right: 16px; transform: none; --toast-top: 16px; }
}
.toast {
  padding: 12px 16px; border-radius: var(--r-control); background: #14213d; color: #fff;
  box-shadow: var(--shadow-float); font-size: 0.95rem; animation: toast-in 0.2s ease-out;
}
.toast--error { background: var(--danger); }
.toast--ok { background: var(--ok); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

/* ——— Menu latéral (historique, déconnexion) ——— */
.drawer-backdrop { position: fixed; inset: 0; z-index: 1500; background: rgba(8, 24, 49, 0.4); }
.drawer {
  position: fixed; z-index: 1600; top: 0; right: 0; bottom: 0; width: min(88vw, 380px);
  background: var(--surface); padding: max(18px, env(safe-area-inset-top)) 18px 18px; overflow-y: auto;
  display: grid; align-content: start; gap: 18px; box-shadow: var(--shadow-float);
}
.drawer header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.history li div { min-width: 0; }
.history li div span { display: block; color: var(--muted); font-size: 0.8rem; }
.history li > strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 0.92rem; }

/* ——— Chauffeur ——— */
.driver-bar {
  position: absolute; z-index: 500; top: 0; left: 0; right: 0;
  padding: max(12px, env(safe-area-inset-top)) 12px 0;
  display: flex; gap: 10px; align-items: center;
}
.online-toggle {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 14px;
  border: 0; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 1.05rem;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float);
}
.online-toggle__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.online-toggle[aria-pressed='true'] { background: var(--jaune); color: #14213d; }
.online-toggle[aria-pressed='true'] .online-toggle__dot { background: #14213d; box-shadow: 0 0 0 4px rgba(20, 33, 61, 0.2); }
.online-toggle:disabled { opacity: 0.6; cursor: not-allowed; }
.earnings { margin-left: auto; text-align: right; background: var(--surface); padding: 6px 14px; border-radius: 14px; box-shadow: var(--shadow-float); }
.earnings strong { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.earnings span { font-size: 0.78rem; color: var(--muted); }

.sim-bar {
  position: absolute; z-index: 500; top: calc(max(12px, env(safe-area-inset-top)) + 62px); left: 12px; right: 12px;
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--r-control); background: color-mix(in srgb, var(--surface) 92%, transparent);
  font-size: 0.85rem; color: var(--muted); box-shadow: var(--shadow-float);
}
@media (min-width: 720px) { .sim-bar { right: auto; max-width: 520px; } }

.offers { position: absolute; z-index: 650; left: 0; right: 0; bottom: 0; display: grid; gap: 10px; padding: 12px; max-height: 88vh; overflow-y: auto; }
.offers:empty { display: none; }
@media (min-width: 720px) { .offers { left: auto; right: 16px; bottom: 16px; width: 400px; padding: 0; } }

.offer-card {
  background: var(--surface); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet);
  padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; overflow: hidden; position: relative;
  border: 2px solid var(--jaune); animation: offer-in 0.25s ease-out;
}
@keyframes offer-in { from { transform: translateY(24px); opacity: 0; } }
.offer-card__timer { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--surface-2); }
.offer-card__timer span { display: block; height: 100%; background: var(--jaune); transform-origin: left; animation: countdown linear forwards; }
@keyframes countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.offer-card__head { display: flex; align-items: center; gap: 14px; }
.offer-price { padding: 8px 14px; border-radius: 14px; background: var(--jaune); color: #14213d; box-shadow: inset 0 -3px 0 rgba(20, 33, 61, 0.16); }
.offer-price strong { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.02em; }
.offer-price small { font-weight: 600; margin-left: 3px; }
.offer-delta { font-size: 0.9rem; color: var(--muted); }
.offer-delta strong { display: block; font-size: 1rem; }
.offer-delta--up strong { color: var(--ok); }
.offer-delta--down strong { color: var(--warn); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.facts div { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
.facts dt { font-size: 0.78rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.offer-card__actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }

.nav-links { display: flex; gap: 8px; }
.nav-links a { flex: 1; }

/* ——— Logo ——— (la page d'accueil a sa propre feuille : home.css) */
/* Le logo (lettres argentées) a besoin d'un fond sombre pour rester lisible. */
.brand-badge { display: inline-grid; place-items: center; padding: 8px 14px; border-radius: 16px; background: #0b1f3f; }
.brand-badge img { width: 112px; height: auto; display: block; }

/* ——— Passager : départ et destination modifiables ——— */
.trip-row__field { flex: 1; min-width: 0; display: grid; }
.trip-row__field small { font-size: 0.72rem; color: var(--muted); line-height: 1; padding-top: 7px; }
.trip-row__field input { min-height: 34px; padding: 0 0 4px; font-size: 1rem; text-overflow: ellipsis; }
.trip-row__action {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--bleu); cursor: pointer;
}
.trip-row__action:hover { background: var(--surface-2); }
.trip-row:focus-within .dot { transform: scale(1.25); }
.dot { transition: transform 0.15s ease; }
.results__hint { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--muted); font-size: 0.88rem; }
.results__hint .ico { width: 18px; height: 18px; }

/* Lieux récents : une touche pour revenir à une destination habituelle */
.places { list-style: none; margin: 0 -8px; padding: 0; display: grid; }
.places button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px; border: 0; border-radius: 12px;
  background: transparent; text-align: left; cursor: pointer; color: var(--ink);
}
.places button:hover, .places button:focus-visible { background: var(--surface-2); }
.places__icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.places__text { flex: 1; min-width: 0; }
.places__text strong { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.places__text span { display: block; font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.places button > .ico { color: var(--muted); }
.hint-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.92rem; }
.hint-line .ico { width: 18px; height: 18px; flex: none; }

/* Résumé du trajet : distance, durée, arrivée, paiement */
.summary { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: 0.86rem; font-weight: 500; font-variant-numeric: tabular-nums;
}
.chip .ico { width: 16px; height: 16px; color: var(--muted); }
.chip--night { background: #14213d; color: var(--jaune); }
.chip--night .ico { color: var(--jaune); }
.theme-night .chip--night { background: var(--jaune); color: #14213d; }
.theme-night .chip--night .ico { color: #14213d; }

/* Étapes de la course (le contenu est une vraie séquence) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; counter-reset: step; }
.steps li { display: grid; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.steps li::before { content: ''; height: 4px; border-radius: 2px; background: var(--line); }
.steps li[data-state='done']::before { background: var(--ok); }
.steps li[data-state='current']::before { background: var(--jaune); }
.steps li[data-state='current'] { color: var(--ink); font-weight: 600; }

.eta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.eta strong { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.eta span { color: var(--muted); }

/* Repères de carte avec une étiquette */
.leaflet-tooltip.pin-label {
  background: var(--ink); color: var(--chaux); border: 0; border-radius: 8px; padding: 3px 8px;
  font-family: var(--font); font-size: 0.78rem; font-weight: 600; box-shadow: var(--shadow-float);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.leaflet-tooltip-top.pin-label::before { border-top-color: var(--ink); }

/* Compte à rebours chiffré d'une demande, en plus de la barre */
.offer-card__count { margin-left: auto; align-self: flex-start; white-space: nowrap; font-size: 0.82rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.offer-card__count[data-urgent] { color: var(--warn); }

/* Apparition douce du contenu de la feuille quand l'étape change */
.sheet[data-anim] > * { animation: sheet-in 0.22s ease-out both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(6px); } }

/* Course acceptée pour juste après la course en cours (chauffeur) */
.next-ride { display: grid; gap: 6px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--jaune); background: var(--surface-2); }
.next-ride span { color: var(--muted); font-size: 0.92rem; }

/* Alerte danger (chauffeur) : bouton SOS sous la barre du haut, bandeaux rouges, repère qui pulse. */
.sos-zone {
  position: absolute; z-index: 700; top: calc(max(12px, env(safe-area-inset-top)) + 64px); left: 12px; right: 12px;
  display: grid; justify-items: end; gap: 8px; pointer-events: none;
}
.sos-zone > *, .sos-banners > * { pointer-events: auto; }
.sos-banners { justify-self: stretch; display: grid; gap: 8px; pointer-events: none; }
@media (min-width: 720px) { .sos-zone { left: auto; right: 16px; width: 400px; } }
.sos-btn {
  width: 58px; height: 58px; border-radius: 50%; border: 3px solid #fff; background: #d7263d; color: #fff;
  font: inherit; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.sos-btn[hidden] { display: none; }
.sos-btn:focus-visible, .sos-banner__actions > :focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.sos-banner { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: #d7263d; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.sos-banner strong { font-size: 1.05rem; }
.sos-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sos-banner__actions > * {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid #fff; background: transparent; color: #fff; font: inherit; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; cursor: pointer;
}
.sos-banner__actions > .solid { background: #fff; color: #d7263d; }
.sos-pin {
  width: 36px; height: 36px; border-radius: 50%; background: #d7263d; border: 3px solid #fff; box-sizing: border-box;
  color: #fff; font: 800 10px/30px system-ui, sans-serif; text-align: center; animation: sos-pulse 1.2s ease-out infinite;
}
@keyframes sos-pulse { from { box-shadow: 0 0 0 0 rgba(215, 38, 61, 0.65); } to { box-shadow: 0 0 0 20px rgba(215, 38, 61, 0); } }
@media (prefers-reduced-motion: reduce) { .sos-pin { animation: none; box-shadow: 0 0 0 6px rgba(215, 38, 61, 0.35); } }

/* Chauffeur (web) : commission, points et parrainage dans le menu */
.loyalty-box { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.loyalty-box div { display: grid; gap: 2px; }
.loyalty-box span, .loyalty-box small, .loyalty-box p { color: var(--muted); font-size: 0.88rem; margin: 0; }
.loyalty-box strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.loyalty-box .code { letter-spacing: 0.12em; }
