/* ==========================================================================
   GOdrivinG - feuille de style principale (application client)
   ========================================================================== */

:root {
  --bg: #0b0e13;
  --bg-soft: #11161d;
  --surface: #161c25;
  --surface-2: #1d2531;
  --surface-3: #263040;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f2f5f8;
  --text-soft: #c3ccd8;
  --muted: #8d9bab;
  --gold: #e0b84c;
  --gold-soft: rgba(224, 184, 76, .14);
  --gold-strong: #f0cd72;
  --green: #2fbf8f;
  --red: #e0554f;
  --blue: #4c9ae0;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --shadow: 0 6px 22px rgba(0, 0, 0, .28);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, .18);
  --nav-h: 62px;
  --topbar-h: 56px;
  --pad: 18px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { font-size: 16px; line-height: 1.45; }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0 0 .35rem; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .7rem; }
small { font-size: .78rem; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.link-mini { background: none; border: 0; color: var(--gold); font-size: .82rem; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 4px; }
.link-muted { color: var(--muted); font-size: .82rem; }
.skip-link { position: absolute; left: -9999px; }

/* ------------------------------ entete ---------------------------------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 8px;
  min-height: var(--topbar-h);
  background: linear-gradient(180deg, rgba(11, 14, 19, .95), rgba(11, 14, 19, .72) 70%, rgba(11, 14, 19, 0));
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--gold); }
.brand-mark { flex: none; }
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 1.08rem; color: var(--text); }
.brand-name span { color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch { display: inline-flex; gap: 2px; padding: 3px; background: rgba(255, 255, 255, .06); border-radius: 999px; }
.lang-btn {
  border: 0; background: none; color: var(--muted); font-size: .72rem; font-weight: 700;
  padding: 5px 8px; border-radius: 999px; cursor: pointer; transition: background .12s, color .12s, transform .12s;
}
.lang-btn.active { background: var(--gold); color: #1a1509; }
.lang-btn:active { transform: scale(.94); }
.lang-switch-inline { background: rgba(255, 255, 255, .08); }

/* ------------------------------ carte ----------------------------------- */

.app-page { background: var(--bg); }
.app-main { position: relative; min-height: 100vh; min-height: 100dvh; }
.map {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #0f141b;
}
.map-fallback {
  position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; color: var(--muted);
  background: radial-gradient(circle at 50% 30%, #16202c, #0b0e13 70%);
}
.leaflet-container { background: #0f141b; font-family: var(--font); }
.leaflet-control-attribution { background: rgba(11, 14, 19, .7) !important; color: var(--muted) !important; font-size: .66rem !important; }
.leaflet-control-attribution a { color: var(--text-soft) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--text); border-color: var(--line); }
.map-fab {
  position: fixed; right: 14px; z-index: 30;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 210px);
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: rgba(22, 28, 37, .92); color: var(--gold); display: grid; place-items: center;
  box-shadow: var(--shadow-soft); cursor: pointer; transition: transform .12s;
}
.map-fab:active { transform: scale(.94); }

.driver-marker {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(22, 28, 37, .95); border: 2px solid var(--gold); color: var(--gold);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
}
.driver-marker.busy { border-color: var(--muted); color: var(--muted); }
.driver-marker svg { width: 16px; height: 16px; }
.user-marker {
  width: 18px; height: 18px; border-radius: 50%; background: var(--blue);
  border: 3px solid rgba(76, 154, 224, .35); box-shadow: 0 0 0 6px rgba(76, 154, 224, .18);
}
.pin-marker {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #1a1509; font-weight: 800; font-size: .8rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}
.pin-marker.dropoff { background: var(--text); color: #10151c; }

/* --------------------------- panneau glissant --------------------------- */

.sheet {
  position: fixed; left: 0; right: 0; z-index: 40;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-soft);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
  transition: height .28s cubic-bezier(.22, .68, 0, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet[data-position="peek"] { height: 168px; }
.sheet[data-position="half"] { height: 60vh; }
.sheet[data-position="full"] { height: calc(100vh - var(--topbar-h) - env(safe-area-inset-top, 0px) - var(--nav-h)); }
.sheet.dragging { transition: none; }
.sheet-handle {
  border: 0; background: none; padding: 10px 0 6px; width: 100%; cursor: grab;
  display: flex; justify-content: center; flex: none;
}
.sheet-handle span { width: 42px; height: 4px; border-radius: 999px; background: var(--line-strong); display: block; }
.sheet-body { padding: 4px var(--pad) calc(var(--pad) + 6px); overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
.view { animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.greeting { font-size: 1.35rem; }
.greeting strong { color: var(--gold); }
.home-question { color: var(--text-soft); margin-bottom: 14px; font-size: 1.02rem; }

/* --------------------------- champs et boutons -------------------------- */

.search-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.field {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; color: var(--text); cursor: pointer; transition: transform .12s, border-color .12s;
}
.field:active { transform: scale(.985); }
.field:hover { border-color: var(--line-strong); }
.field-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--gold); }
.field-icon svg { width: 16px; height: 16px; }
.field-icon-dot { background: var(--gold-soft); position: relative; }
.field-icon-dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.field-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.field-body small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.field-body span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-body .placeholder { color: var(--muted); font-weight: 500; }
.field-edit { color: var(--gold); font-size: .8rem; flex: none; }

.when-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-soft);
  padding: 8px 14px; border-radius: 999px; font-size: .86rem; cursor: pointer; transition: transform .12s, background .12s, color .12s;
}
.chip.active { background: var(--gold); border-color: var(--gold); color: #1a1509; font-weight: 700; }
.chip:active { transform: scale(.95); }
.when-input { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius-sm); padding: 9px 10px; font-size: .86rem; flex: 1; min-width: 0; }

.shortcuts-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.shortcut {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 12px; cursor: pointer; color: var(--text); text-align: left;
  transition: transform .12s, border-color .12s; min-width: 0;
}
.shortcut:active { transform: scale(.97); }
.shortcut:hover { border-color: var(--line-strong); }
.shortcut-icon { width: 30px; height: 30px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.shortcut-text { display: flex; flex-direction: column; min-width: 0; }
.shortcut-text strong { font-size: .9rem; }
.shortcut-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nearby { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: .86rem; margin: 4px 0 14px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47, 191, 143, .16); flex: none; }

.btn {
  border: 0; border-radius: 14px; padding: 13px 18px; font-size: .96rem; font-weight: 700;
  cursor: pointer; transition: transform .12s, opacity .12s, background .12s; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #1a1509; }
.btn-primary:hover { background: var(--gold-strong); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(224, 85, 79, .14); color: #ff9c97; border: 1px solid rgba(224, 85, 79, .35); }
.btn-block { width: 100%; }
.btn-install {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--gold); color: var(--gold);
  background: var(--gold-soft); border-radius: 999px; padding: 8px 14px; font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: transform .12s, background .12s;
}
.btn-install:active { transform: scale(.95); }
.btn-install-compact span { display: none; }
.btn-install-ghost { border-color: var(--line-strong); color: var(--text-soft); background: rgba(255, 255, 255, .04); }
.cta-row { display: flex; gap: 10px; }

ul { margin: 0; padding-left: 1.1rem; }

/* ------------------------------- vues ---------------------------------- */

.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.view-head h2 { margin: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none;
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.94); }
.route-line { color: var(--text-soft); font-size: .86rem; margin-bottom: 12px; }
.route-line span { display: block; }
.route-line b { color: var(--gold); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-soft); margin-bottom: 14px;
}
.card h3 { margin-bottom: .5rem; }
.row {
  display: flex; justify-content: space-between; gap: 12px; padding: 7px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .07); font-size: .92rem;
}
.row:last-child { border-bottom: 0; }
.row span:first-child { color: var(--muted); }
.row span:last-child { text-align: right; font-weight: 600; }
.row.total { font-size: 1.06rem; }
.row.total span:last-child { color: var(--gold); font-weight: 800; }

.car-list { display: flex; flex-direction: column; gap: 12px; }
.car {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow-soft); transition: border-color .12s, transform .12s;
}
.car.selected { border-color: var(--gold); background: linear-gradient(180deg, rgba(224, 184, 76, .08), rgba(224, 184, 76, 0)); }
.car-photo { width: 84px; height: 66px; border-radius: 12px; object-fit: cover; background: var(--surface-3); }
.car-main { min-width: 0; }
.car-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.car-name { font-weight: 700; }
.car-price { color: var(--gold); font-weight: 800; white-space: nowrap; }
.car-specs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .78rem; margin: 4px 0 8px; }
.car-specs span { display: inline-flex; align-items: center; gap: 4px; }
.car-eta { color: var(--green); }
.car-cta { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.car-cta .btn { padding: 9px 14px; font-size: .86rem; }

.recap .thumb { width: 100%; height: 132px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; }

.form-block { display: flex; flex-direction: column; margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; }
.field-row > div { flex: 1; min-width: 0; }
label { font-size: .82rem; color: var(--text-soft); margin-bottom: 5px; display: block; }
input, select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 13px; font-size: .95rem; margin-bottom: 12px; font-family: inherit;
}
input:focus, select:focus, textarea:focus, .field:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent;
}
input:disabled { opacity: .6; }
textarea { resize: vertical; }
.stepper { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stepper input { margin: 0; text-align: center; max-width: 80px; }
.stepper-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font-size: 1.2rem; font-weight: 700; cursor: pointer; transition: transform .12s;
}
.stepper-btn:active { transform: scale(.93); }
.switch { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--text-soft); font-size: .9rem; }
.switch input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
.notice {
  background: var(--gold-soft); border: 1px solid rgba(224, 184, 76, .3); color: var(--gold-strong);
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: .84rem; margin-bottom: 12px;
}

.status-banner {
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; font-weight: 700;
  background: linear-gradient(135deg, rgba(224, 184, 76, .16), rgba(224, 184, 76, .04));
  border: 1px solid rgba(224, 184, 76, .28); color: var(--gold-strong);
}
.status-banner.done { background: rgba(47, 191, 143, .12); border-color: rgba(47, 191, 143, .3); color: #7fe0c0; }
.status-banner.cancel { background: rgba(224, 85, 79, .12); border-color: rgba(224, 85, 79, .3); color: #ff9c97; }
.status-banner small { display: block; color: var(--text-soft); font-weight: 500; margin-top: 4px; }

.timeline { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line-strong);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg-soft); flex: none; margin-top: 2px; }
.timeline-item.on .timeline-dot { border-color: var(--gold); background: var(--gold); }
.timeline-body { min-width: 0; }
.timeline-body strong { font-size: .92rem; display: block; }
.timeline-body small { color: var(--muted); }

.driver-card { display: flex; gap: 14px; align-items: center; }
.driver-card img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; }
.driver-info { min-width: 0; flex: 1; }
.driver-info strong { display: block; font-size: 1.02rem; }
.driver-info small { color: var(--muted); display: block; }
.driver-meta { display: flex; gap: 12px; color: var(--text-soft); font-size: .82rem; margin-top: 6px; flex-wrap: wrap; }
.rating-pill { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-weight: 700; font-size: .84rem; }
.rating-pill svg { width: 14px; height: 14px; }

.tracking-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.tracking-meta div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; }
.tracking-meta small { color: var(--muted); display: block; font-size: .74rem; }
.tracking-meta strong { font-size: .95rem; }

.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stats-row div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.stats-row small { color: var(--muted); display: block; font-size: .74rem; }
.stats-row strong { font-size: 1.15rem; color: var(--gold); }

.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.tab {
  flex: 1; border: 0; background: none; color: var(--text-soft); font-size: .88rem; font-weight: 600;
  padding: 9px 12px; border-radius: 999px; cursor: pointer; transition: background .12s, color .12s, transform .12s;
}
.tab.active { background: var(--gold); color: #1a1509; }
.tab:active { transform: scale(.97); }
.tabs.small .tab { font-size: .84rem; }

.rides-list { display: flex; flex-direction: column; gap: 12px; }
.ride-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-soft); }
.ride-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.badge {
  font-size: .72rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-3); color: var(--text-soft); white-space: nowrap;
}
.badge.pending { background: var(--gold-soft); color: var(--gold); }
.badge.accepted, .badge.arriving { background: rgba(76, 154, 224, .16); color: #9ecbf5; }
.badge.in_progress { background: rgba(224, 184, 76, .18); color: var(--gold-strong); }
.badge.completed { background: rgba(47, 191, 143, .16); color: #7fe0c0; }
.badge.cancelled, .badge.no_show { background: rgba(224, 85, 79, .14); color: #ff9c97; }
.badge.demo { background: rgba(255, 255, 255, .07); color: var(--muted); }
.ride-route { font-size: .88rem; color: var(--text-soft); }
.ride-route b { color: var(--text); }
.ride-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .78rem; margin: 8px 0; }
.ride-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ride-actions .btn { padding: 8px 12px; font-size: .82rem; }
.ride-detail { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }

.favorites-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.favorite-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; }
.favorite-item .shortcut-icon { background: var(--surface-3); color: var(--gold); }
.favorite-item .fav-body { flex: 1; min-width: 0; }
.favorite-item .fav-body strong { display: block; font-size: .9rem; }
.favorite-item .fav-body small { color: var(--muted); }
.favorite-item .icon-btn { width: 34px; height: 34px; }

.account-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.stars-input { display: flex; gap: 6px; margin: 6px 0 14px; }
.star { background: none; border: 0; color: var(--line-strong); cursor: pointer; padding: 2px; transition: transform .12s, color .12s; }
.star.on { color: var(--gold); }
.star:active { transform: scale(.9); }

.alert { border-radius: var(--radius-sm); padding: 11px 13px; font-size: .88rem; margin-bottom: 12px; }
.alert-error { background: rgba(224, 85, 79, .14); border: 1px solid rgba(224, 85, 79, .35); color: #ff9c97; }
.alert-ok { background: rgba(47, 191, 143, .12); border: 1px solid rgba(47, 191, 143, .3); color: #7fe0c0; }

/* --------------------------- navigation basse --------------------------- */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(11, 14, 19, .72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 4px 8px; height: var(--nav-h); color: var(--muted); font-size: .68rem; font-weight: 600;
  transition: color .12s, transform .12s;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--gold); }
.nav-item.active svg { background: var(--gold-soft); border-radius: 12px; padding: 4px; box-sizing: content-box; }
.nav-item:active { transform: scale(.94); }

/* ------------------------------ overlays -------------------------------- */

.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(6, 9, 13, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; }
.overlay-panel {
  background: var(--bg-soft); width: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px); max-height: 100%;
}
.overlay-head { display: flex; gap: 10px; align-items: center; padding: 8px var(--pad); }
.overlay-head input { margin: 0; }
.overlay-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--pad) 12px; }
.overlay-results { overflow-y: auto; padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px)); }
.result {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--text);
}
.result:active { background: rgba(255, 255, 255, .04); }
.result-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.result strong { display: block; font-size: .95rem; }
.result small { color: var(--muted); }
.result-empty { color: var(--muted); padding: 22px 4px; text-align: center; }

.modal { position: fixed; inset: 0; z-index: 120; background: rgba(6, 9, 13, .76); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal-card {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 520px; padding: 22px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  max-height: 92vh; overflow-y: auto; position: relative; animation: sheetUp .26s ease;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); display: grid; place-items: center; cursor: pointer; }
.pwa-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pwa-option p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.pwa-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--gold); display: grid; place-items: center; flex: none; }

.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast {
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); border-radius: 14px;
  padding: 12px 15px; font-size: .9rem; box-shadow: var(--shadow); animation: fadeUp .2s ease; pointer-events: auto;
}
.toast.ok { border-color: rgba(47, 191, 143, .4); }
.toast.err { border-color: rgba(224, 85, 79, .45); }

/* ------------------------- ecran d ouverture ---------------------------- */

#app-splash {
  display: none; position: fixed; inset: 0; z-index: 99999; pointer-events: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #0b0e13; color: var(--text); font-weight: 700; letter-spacing: -.01em;
}
#app-splash.show { display: flex; animation: splashOut .4s ease 1.2s forwards; }
#app-splash img { border-radius: 22px; }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

/* ------------------------------ pages auth ------------------------------ */

.auth-page { background: var(--bg); }
.auth-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-visual { position: relative; min-height: 34vh; display: flex; align-items: flex-end; overflow: hidden; }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 14, 19, .3), rgba(11, 14, 19, .95)); }
.auth-visual-inner { position: relative; z-index: 1; padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--pad) 22px; }
.auth-visual-inner h1 { margin-top: 12px; font-size: 1.5rem; }
.auth-visual-inner p { color: var(--text-soft); }
.auth-points { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; color: var(--text-soft); font-size: .86rem; }
.auth-points li { display: flex; align-items: center; gap: 9px; }
.auth-card {
  flex: 1; background: var(--bg-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
}
.auth-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.auth-card h2 { font-size: 1.15rem; }
.auth-card form { display: flex; flex-direction: column; }
.auth-card .btn { margin-top: 4px; }
.auth-alt { color: var(--text-soft); font-size: .88rem; margin-top: 14px; }
.auth-foot { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-top: 8px; }

/* ------------------------------ desktop --------------------------------- */

@media (min-width: 900px) {
  .app-page .map, .app-page .map-fallback { inset: 0 480px 0 0; }
  .sheet {
    left: auto; right: 0; width: 480px; top: 0; bottom: 0; border-radius: 0;
    height: auto !important; border-top: 0; border-left: 1px solid var(--line);
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  }
  .sheet[data-position] { height: auto; }
  .sheet-handle { display: none; }
  .sheet-body { padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
  .bottom-nav {
    left: auto; right: 0; width: 480px; background: rgba(17, 22, 29, .92);
  }
  .topbar { right: 480px; }
  .map-fab { right: 496px; bottom: 24px; }
  .modal { align-items: center; }
  .modal-card { border-radius: var(--radius-lg); }
  .auth-shell { flex-direction: row; }
  .auth-visual { flex: 1.1; min-height: 100vh; align-items: center; }
  .auth-visual-inner { max-width: 520px; margin: 0 auto; padding: 40px; }
  .auth-visual-inner h1 { font-size: 2.1rem; }
  .auth-card { flex: 1; max-width: 520px; border-radius: 0; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
  .auth-card-head { margin-bottom: 22px; }
}

@media (max-width: 520px) {
  .field-row { flex-direction: column; gap: 0; }
  .auth-card .field-row { flex-direction: column; }
}

@media (max-width: 380px) {
  :root { --pad: 14px; }
  .shortcuts { grid-template-columns: 1fr; }
  .car { grid-template-columns: 68px 1fr; }
  .car-photo { width: 68px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
