/* ═══════════════════════════════════════════════════════════════════════
   BetterVTC V3 — Cockpit Chauffeur Unifié ("Style Heetch" + Mode Route)
   Mode Sombre anti-éblouissement permanent pour la vue #drive
   ═══════════════════════════════════════════════════════════════════════ */

#drive.app__page {
  background: #0E0E0E;
  color: #F4F2EE;
  min-height: calc(100dvh - 135px);
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
}
#drive.app__page.app__page--active {
  display: flex;
}

/* ── Header Conduite Compact ("Au Volant") ── */
.drive-topbar {
  background: #161616;
  border: 1px solid #2A2A2A;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.drive-topbar__row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Gros Switch EN LIGNE / HORS LIGNE */
.drive-online-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid #333;
  background: #222;
  color: #AAA;
  transition: all 0.2s ease;
}
.drive-online-btn__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #666;
  transition: all 0.2s ease;
}
.drive-online-btn.is-online {
  background: rgba(15, 123, 75, 0.22);
  border-color: #19B36B;
  color: #E8FFF3;
  box-shadow: 0 0 18px rgba(25, 179, 107, 0.35);
}
.drive-online-btn.is-online .drive-online-btn__dot {
  background: #19B36B;
  box-shadow: 0 0 10px #19B36B;
  animation: drivePulse 1.8s infinite;
}

@keyframes drivePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.28); opacity: 0.7; }
}

/* Sélecteur véhicule + Badge Freemium + Bouton + Externe (TPE) */
.drive-topbar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drive-veh-select {
  background: #222;
  color: #F4F2EE;
  border: 1px solid #383838;
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 600;
  max-width: 190px;
}

.drive-freemium-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(168, 121, 16, 0.18);
  border: 1px solid rgba(217, 165, 40, 0.45);
  color: #F5C451;
}
.drive-freemium-pill.is-unlimited {
  background: rgba(25, 179, 107, 0.16);
  border-color: rgba(25, 179, 107, 0.45);
  color: #5CE6A0;
}

.drive-tpe-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  background: #F4F2EE;
  color: #0E0E0E;
  font-weight: 800;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.drive-tpe-btn:active {
  transform: scale(0.97);
}

/* Jauge Objectif Journalier BetterVTC */
.drive-obj-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #1E1E1E;
  border: 1px solid #2C2C2C;
  border-radius: 12px;
  padding: 9px 12px;
}
.drive-obj-bar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.drive-obj-bar__title {
  color: #AAA;
  font-weight: 600;
}
.drive-obj-bar__nums {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  color: #FFF;
}
.drive-obj-bar__track {
  height: 7px;
  background: #2E2E2E;
  border-radius: 999px;
  overflow: hidden;
}
.drive-obj-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #D9A528, #19B36B);
  border-radius: 999px;
  width: 0%;
  transition: width 0.35s ease;
}
.drive-obj-bar__sub {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #999;
}

/* ── Carte Plein Écran Souveraine ── */
.drive-map-wrap {
  position: relative;
  flex: 1;
  min-height: 440px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #2A2A2A;
  background: #12161A;
}

#drive-map {
  width: 100%;
  height: 100%;
  min-height: 440px;
  z-index: 1;
}

/* Fond neutre et suppression du filtre d'inversion aveugle */
#drive-map {
  background: #0B0F14;
}
#drive-map .leaflet-tile-pane {
  filter: none;
}

/* ── Barre d'outils Carte : Styles (sans POI commerciaux) & Calques ── */
.drive-map-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  pointer-events: auto;
}

.drive-map-styles,
.drive-map-toggles {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.drive-style-btn,
.drive-toggle-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.drive-style-btn:hover,
.drive-toggle-btn:hover {
  color: #F8FAFC;
  background: rgba(255, 255, 255, 0.08);
}

.drive-style-btn.is-active {
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
}

.drive-toggle-btn.is-active {
  background: rgba(25, 179, 107, 0.20);
  color: #22C55E;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-weight: 700;
}

/* ── Bannière Statut Trafic Temps Réel ── */
.drive-traffic-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: pointer;
  max-width: 90%;
  white-space: nowrap;
}

.drive-traffic-banner.is-fluide {
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.35);
}

.drive-traffic-banner.is-dense {
  color: #FBBF24;
  border-color: rgba(251, 191, 36, 0.45);
}

.drive-traffic-banner.is-perturbe {
  color: #F87171;
  border-color: rgba(248, 113, 113, 0.5);
}

/* ── Numéros de rue sur façades et entrées BAN ── */
.bvtc-hn-marker {
  pointer-events: auto;
}

.bvtc-housenumber-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 17px;
  padding: 0 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid #38BDF8;
  color: #38BDF8;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
}

.bvtc-housenumber-pin:hover {
  transform: scale(1.25);
  background: #38BDF8;
  color: #0F172A;
  z-index: 1000;
}

/* Badges Dépose & Prise en charge */
.bvtc-ride-address-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: #0F172A;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}
.bvtc-ride-address-badge--pickup {
  border: 2px solid #10B981;
  color: #10B981;
}
.bvtc-ride-address-badge--dropoff {
  border: 2px solid #EF4444;
  color: #EF4444;
}

/* ── Signalisations d'événements Leaflet & Pulses ── */
.bvtc-hazard-pin {
  pointer-events: auto;
  cursor: pointer;
}

.bvtc-hazard-inner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
  position: relative;
  transition: transform 0.18s ease;
}

.bvtc-hazard-inner:hover {
  transform: scale(1.2);
}

.bvtc-hazard--controle .bvtc-hazard-inner {
  border: 2px solid #38BDF8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.bvtc-hazard--danger .bvtc-hazard-inner,
.bvtc-hazard--accident .bvtc-hazard-inner {
  border: 2px solid #EF4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
}

.bvtc-hazard--ralentissement .bvtc-hazard-inner,
.bvtc-hazard--travaux .bvtc-hazard-inner {
  border: 2px solid #F59E0B;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.bvtc-hazard--route_barree .bvtc-hazard-inner {
  border: 2px solid #DC2626;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.85);
}

.bvtc-hazard-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.7;
  animation: bvtcPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes bvtcPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Badge GPS fréquence en haut à gauche de la carte */
.drive-gps-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 400;
  background: rgba(18, 18, 18, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid #333;
  color: #CCC;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 3 Boutons Flottants Carte (Signaler, Hubs, Mon QR Client) */
.drive-map-fab-col {
  position: absolute;
  top: 76px;
  right: 12px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drive-fab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid #3A3A3A;
  color: #F4F2EE;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.drive-fab:hover {
  border-color: #D9A528;
}
.drive-fab:active {
  transform: scale(0.96);
}
.drive-fab--qr {
  background: linear-gradient(135deg, #241C0C, #181818);
  border-color: rgba(217, 165, 40, 0.55);
  color: #F5C451;
}

/* ── Bandeau Course Active / Approche < 500m / Certification W4W ── */
.drive-active-panel {
  background: #161616;
  border: 2px solid #19B36B;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.drive-active-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.drive-bdc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(217, 165, 40, 0.18);
  border: 1px solid rgba(217, 165, 40, 0.5);
  color: #F5C451;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.drive-price-net {
  font-family: var(--font-mono, monospace);
  font-size: 22px;
  font-weight: 800;
  color: #5CE6A0;
}

.drive-route-box {
  background: #1F1F1F;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
}
.drive-route-box__pt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Chronomètre de courtoisie (5 min gratuites puis attente facturable) */
.drive-courtesy-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(25, 179, 107, 0.14);
  border: 1px solid rgba(25, 179, 107, 0.45);
  color: #79F2B4;
  font-size: 13px;
  font-weight: 700;
}
.drive-courtesy-timer.is-overtime {
  background: rgba(217, 119, 36, 0.22);
  border-color: #F59E0B;
  color: #FCD34D;
}

/* Barre de certification terrain Women4Women (Niveau 2) */
.drive-w4w-cert-bar {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.22), rgba(90, 24, 154, 0.28));
  border: 1px solid #B565F2;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drive-w4w-cert-bar__title {
  font-size: 13px;
  font-weight: 800;
  color: #E6C2FF;
}
.drive-w4w-cert-bar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Grille d'actions Course Active */
.drive-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
}
.drive-act-btn {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid #333;
  background: #242424;
  color: #F4F2EE;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.drive-act-btn--primary {
  background: #19B36B;
  border-color: #19B36B;
  color: #062112;
  font-weight: 800;
}
.drive-act-btn--gold {
  background: #D9A528;
  border-color: #D9A528;
  color: #141004;
  font-weight: 800;
}
.drive-act-btn--danger {
  background: rgba(194, 41, 41, 0.2);
  border-color: #E04F4F;
  color: #FF9999;
}

/* ── Pop-up Offre de Course Entrante ("Style Heetch") ── */
.drive-offer-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.drive-offer-modal.is-open {
  display: flex;
}

.drive-offer-card {
  width: 100%;
  max-width: 480px;
  background: #161616;
  color: #F4F2EE;
  border: 2px solid #D9A528;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  animation: driveSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes driveSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.drive-offer-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.drive-offer-net {
  font-family: var(--font-mono, monospace);
  font-size: 32px;
  font-weight: 900;
  color: #5CE6A0;
  line-height: 1;
}
.drive-offer-zero-comm {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(25, 179, 107, 0.2);
  color: #5CE6A0;
}

.drive-offer-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #202020;
}
.drive-offer-source {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(217, 165, 40, 0.2);
  color: #F5C451;
}

.drive-offer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.drive-offer-metric {
  background: #1F1F1F;
  border: 1px solid #2E2E2E;
  border-radius: 11px;
  padding: 8px 11px;
}
.drive-offer-metric__lbl {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
}
.drive-offer-metric__val {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  font-weight: 800;
  color: #FFF;
}

.drive-offer-w4w-alert {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(181, 101, 242, 0.22);
  border: 1px solid #B565F2;
  color: #EBC9FF;
  font-size: 12.5px;
  font-weight: 700;
}

.drive-offer-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
}
.drive-offer-btn-decline {
  padding: 15px;
  border-radius: 14px;
  background: #2A2A2A;
  border: 1px solid #444;
  color: #CCC;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.drive-offer-btn-accept {
  padding: 15px;
  border-radius: 14px;
  background: #19B36B;
  border: none;
  color: #051F11;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(25, 179, 107, 0.4);
}

/* ── Tiroirs & Modales Cockpit (Hubs, QR Code, Encaissement Direct, GPS Externe) ── */
.drive-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.drive-drawer-backdrop.is-open {
  display: flex;
}
.drive-drawer-card {
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  background: #181818;
  color: #F4F2EE;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Marqueur Passager Live sur le trottoir (< 500m) */
.bvtc-pax-live-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3B82F6;
  border: 3px solid #FFF;
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.35);
  animation: drivePulse 1.5s infinite;
}
