/* =============================================================================
   MUJE DRIVE — feuille de style principale
   Palette dérivée du logo : bleu marine profond + or, sur fond clair.
   Signature visuelle : le "trait de trajet" — une ligne de course pointillée
   avec point de départ et destination, qui revient en fil rouge du site.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Couleurs de marque, extraites du logo et de la bannière Muje Drive */
  --bleu-nuit: #072840;
  --bleu-marine: #0A3D62;
  --bleu-vif: #12588f;
  --bleu-ciel: #AFD4ED;
  --bleu-ciel-clair: #EAF4FC;
  --or: #E8A93A;
  --or-fonce: #C98A1F;
  --or-clair: #F7D488;
  --blanc-casse: #FAFBFC;
  --blanc: #FFFFFF;
  --encre: #10222E;
  --ardoise: #45596B;
  --ardoise-clair: #7C93A6;
  --ligne: #E1E9F0;
  --succes: #2E9E6B;
  --alerte: #D64545;

  --rayon: 16px;
  --rayon-sm: 10px;
  --ombre: 0 10px 30px -12px rgba(7, 40, 64, 0.25);
  --ombre-sm: 0 4px 14px -6px rgba(7, 40, 64, 0.18);

  --police-affichage: 'Sora', sans-serif;
  --police-texte: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--police-texte);
  color: var(--encre);
  background: var(--blanc-casse);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .police-affichage {
  font-family: var(--police-affichage);
  font-weight: 700;
  color: var(--bleu-nuit);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a { color: var(--bleu-vif); text-decoration: none; }
a:hover { color: var(--or-fonce); }

p { line-height: 1.6; color: var(--ardoise); }

.conteneur {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* -----------------------------------------------------------------------
   BOUTONS
   -------------------------------------------------------------------- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-family: var(--police-affichage);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-align: center;
}
.bouton:active { transform: scale(0.97); }

.bouton-or {
  background: linear-gradient(135deg, var(--or), var(--or-fonce));
  color: var(--bleu-nuit);
  box-shadow: 0 8px 20px -8px rgba(201, 138, 31, 0.55);
}
.bouton-or:hover { color: var(--bleu-nuit); box-shadow: 0 10px 24px -6px rgba(201, 138, 31, 0.65); }

.bouton-marine {
  background: var(--bleu-marine);
  color: var(--blanc);
}
.bouton-marine:hover { background: var(--bleu-nuit); color: var(--blanc); }

.bouton-contour {
  background: transparent;
  color: var(--blanc);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
.bouton-contour:hover { background: rgba(255, 255, 255, 0.12); color: var(--blanc); }

.bouton-contour-marine {
  background: transparent;
  color: var(--bleu-marine);
  border: 1.5px solid var(--bleu-marine);
}
.bouton-contour-marine:hover { background: var(--bleu-marine); color: var(--blanc); }

.bouton-large { width: 100%; padding: 1em 1.6em; }
.bouton-petit { padding: 0.55em 1.1em; font-size: 0.85rem; }
.bouton-danger { background: var(--alerte); color: var(--blanc); }
.bouton:disabled { opacity: 0.5; cursor: not-allowed; }

/* -----------------------------------------------------------------------
   EN-TÊTE / NAVIGATION
   -------------------------------------------------------------------- */
.entete {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}
/* .entete est en position fixed (et non plus sticky) : sur certains
   navigateurs mobiles, notamment en orientation paysage, "overflow-x:
   hidden" sur html/body (nécessaire pour le tiroir de menu) empêche
   "position: sticky" de fonctionner correctement, ce qui faisait défiler
   la barre du logo hors de l'écran alors que le menu (position: fixed,
   non affecté par ce problème) restait affiché seul. Les deux éléments
   utilisent maintenant la même stratégie de positionnement, avec une
   marge de compensation ci-dessous pour ne pas masquer le contenu qui
   suit immédiatement le menu. */
.entete-nav + * {
  margin-top: 68px;
}
.entete .conteneur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.entete-marque {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--police-affichage);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--bleu-nuit);
}
.entete-marque img { height: 38px; width: auto; }
.entete-nav {
  position: fixed;
  top: 0;
  right: max(20px, calc((100vw - 1120px) / 2 + 20px));
  height: 68px;
  display: flex;
  align-items: center;
  gap: 1.6em;
  z-index: 55;
  /* Filet de sécurité : cette barre est fixée indépendamment de .entete
     (nécessaire pour le tiroir mobile, voir plus haut). Sur certains
     navigateurs mobiles, notamment en orientation paysage, les deux
     éléments peuvent se désynchroniser pendant le défilement (l'un reste
     figé, l'autre non), ce qui laissait le texte du menu flotter sans
     fond sur le contenu de la page. En lui donnant son propre fond, le
     menu reste lisible même si .entete ne suit pas correctement. */
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.35em 1.2em;
  box-shadow: var(--ombre-sm);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}
.entete-nav a {
  color: var(--ardoise);
  font-weight: 600;
  font-size: 0.92rem;
}
.entete-nav a:hover { color: var(--bleu-marine); }
/* Le bouton "Réserver une course" est un <a> dans .entete-nav : sans cette
   règle plus spécifique, la couleur grisée des liens du menu ci-dessus
   prenait le dessus sur le blanc de .bouton-marine, rendant son texte
   difficile à lire sur fond marine. */
.entete-nav a.bouton-marine,
.entete-nav a.bouton-marine:hover { color: var(--blanc); }

/* -----------------------------------------------------------------------
   HÉRO — bannière avec flou en haut, dégradé de fusion vers le fond clair
   -------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--blanc);
  padding: 0;
}
.hero-fond {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: var(--image-banniere);
  background-size: cover;
  background-position: center 30%;
}
.hero-flou {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  backdrop-filter: blur(2px);
  background: linear-gradient(
    180deg,
    rgba(7, 40, 64, 0.55) 0%,
    rgba(7, 40, 64, 0.45) 35%,
    rgba(7, 40, 64, 0.75) 75%,
    var(--blanc-casse) 100%
  );
}
.hero-contenu {
  position: relative;
  z-index: 2;
  padding: 108px 20px 130px;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.hero-etiquette {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.4em 1em;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 1.3em;
}
.hero-etiquette .point { width: 7px; height: 7px; border-radius: 50%; background: var(--or); display: inline-block; }
.hero h1 {
  color: var(--blanc);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  margin-bottom: 0.45em;
}
.hero h1 span { color: var(--or-clair); }
.hero-soustitre {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  margin-bottom: 2em;
}
.hero-actions { display: flex; gap: 0.9em; justify-content: center; flex-wrap: wrap; }

/* Le "trait de trajet" signature : ligne pointillée + deux points, utilisée
   en fil rouge (accueil, réservation, suivi) pour évoquer le principe même
   du service : un départ, un trajet, une arrivée. */
.trait-trajet {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 1.6em;
  width: 100%;
  max-width: 240px;
}
.trait-trajet .point-depart,
.trait-trajet .point-arrivee {
  width: 11px; height: 11px; border-radius: 50%;
  flex-shrink: 0;
}
.trait-trajet .point-depart { background: var(--or); box-shadow: 0 0 0 4px rgba(232, 169, 58, 0.25); }
.trait-trajet .point-arrivee { background: var(--bleu-marine); box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.18); }
.trait-trajet .ligne {
  flex: 1;
  height: 0;
  border-top: 2.5px dashed rgba(10, 61, 98, 0.35);
}
.hero .trait-trajet .ligne { border-top-color: rgba(255,255,255,0.55); }
.hero .trait-trajet .point-arrivee { background: var(--blanc); box-shadow: 0 0 0 4px rgba(255,255,255,0.2); }

/* -----------------------------------------------------------------------
   SECTIONS GÉNÉRALES
   -------------------------------------------------------------------- */
.section { padding: 76px 0; }
.section-titre { text-align: center; max-width: 620px; margin: 0 auto 3em; }
.section-titre .oeil {
  display: block;
  color: var(--or-fonce);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}
.section-alterne { background: var(--blanc); }

.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grille-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.carte {
  background: var(--blanc);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 28px;
  box-shadow: var(--ombre-sm);
}
.carte-icone {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--bleu-ciel-clair);
  color: var(--bleu-marine);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1em;
}
.carte h3 { font-size: 1.08rem; margin-bottom: 0.4em; }
.carte p { font-size: 0.92rem; margin: 0; }

/* Étapes numérotées : ici la numérotation encode un vrai ordre (le trajet
   du client, étape par étape), donc elle est justifiée. */
.etapes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: etape; }
.etape { position: relative; padding-top: 0.2em; }
.etape .numero {
  font-family: var(--police-affichage);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--or-fonce);
  display: block;
  margin-bottom: 0.3em;
}
.etape h4 { font-size: 1rem; margin-bottom: 0.3em; color: var(--bleu-nuit); }
.etape p { font-size: 0.88rem; }

.bande-marine {
  background: var(--bleu-nuit);
  color: var(--blanc);
  border-radius: 20px;
  padding: 46px;
  text-align: center;
  margin: 0 20px;
}
.bande-marine h2 { color: var(--blanc); }
.bande-marine p { color: rgba(255,255,255,0.82); }

/* -----------------------------------------------------------------------
   PIED DE PAGE
   -------------------------------------------------------------------- */
.pied {
  background: var(--bleu-nuit);
  color: rgba(255, 255, 255, 0.75);
  padding: 50px 0 26px;
  margin-top: 60px;
}
.pied .conteneur { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
.pied a { color: rgba(255, 255, 255, 0.75); }
.pied a:hover { color: var(--or-clair); }
.pied-marque { display: flex; align-items: center; gap: 0.6em; color: var(--blanc); font-family: var(--police-affichage); font-weight: 700; }
.pied-marque img { height: 30px; }
.pied-bas {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 30px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* -----------------------------------------------------------------------
   FORMULAIRES
   -------------------------------------------------------------------- */
.panneau-formulaire {
  max-width: 460px;
  /* La marge haute doit dépasser la hauteur de l'en-tête fixe (68 px),
     sinon le titre du panneau passe dessous et se retrouve tronqué — ce
     qui était visible sur l'écran de connexion, le tout premier écran vu
     par les utilisateurs. La règle générale « .entete-nav + * » ne suffit
     pas ici : à spécificité égale, la marge déclarée ci-dessous gagne. */
  margin: 96px auto 60px;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 40px;
  border: 1px solid var(--ligne);
}
.panneau-formulaire h1 { font-size: 1.5rem; text-align: center; }
.panneau-formulaire .sous-titre { text-align: center; color: var(--ardoise); font-size: 0.92rem; margin-bottom: 1.8em; }

.champ { margin-bottom: 1.2em; }
.champ label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--bleu-nuit);
  margin-bottom: 0.4em;
}
.champ input[type="text"],
.champ input[type="tel"],
.champ input[type="password"],
.champ input[type="email"],
.champ input[type="number"],
.champ select,
.champ textarea {
  width: 100%;
  padding: 0.75em 1em;
  border: 1.5px solid var(--ligne);
  border-radius: var(--rayon-sm);
  font-size: 1rem;
  font-family: var(--police-texte);
  background: var(--blanc-casse);
  color: var(--encre);
  transition: border-color 0.15s ease;
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none;
  border-color: var(--bleu-vif);
  background: var(--blanc);
}
.aide { font-size: 0.8rem; color: var(--ardoise-clair); margin-top: 0.3em; display: block; }
.champ .aide { margin-top: 0.3em; }
.champ-case { display: flex; align-items: center; gap: 0.6em; }
.champ-case input { width: auto; }

.champ-otp input {
  text-align: center;
  font-size: 1.7rem;
  letter-spacing: 0.5em;
  font-family: var(--police-affichage);
  padding-left: 1.3em;
}

.messages { list-style: none; padding: 0; margin: 0 0 1.2em; }
.messages li {
  padding: 0.75em 1em;
  border-radius: var(--rayon-sm);
  font-size: 0.88rem;
  margin-bottom: 0.5em;
}
.messages .success { background: #E6F6EE; color: var(--succes); border: 1px solid #BEE8D2; }
.messages .error { background: #FCEAEA; color: var(--alerte); border: 1px solid #F5C6C6; }
.messages .info { background: var(--bleu-ciel-clair); color: var(--bleu-marine); border: 1px solid var(--bleu-ciel); }

/* -----------------------------------------------------------------------
   TABLEAUX DE BORD (chauffeur / dispatch)
   -------------------------------------------------------------------- */
.mise-en-page-tableau { display: flex; min-height: 100vh; }
.tableau-lateral {
  width: 240px;
  background: var(--bleu-nuit);
  color: rgba(255,255,255,0.8);
  padding: 26px 18px;
  flex-shrink: 0;
}
.tableau-lateral .marque { display: flex; align-items: center; gap: 0.6em; color: var(--blanc); font-family: var(--police-affichage); font-weight: 700; margin-bottom: 2em; }
.tableau-lateral .marque img { height: 32px; }
.tableau-lateral nav a {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 0.9em;
  border-radius: var(--rayon-sm);
  color: rgba(255,255,255,0.78);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.3em;
}
.icone-menu { font-size: 1.05em; line-height: 1; width: 1.2em; text-align: center; flex-shrink: 0; }
.tableau-lateral nav a:hover, .tableau-lateral nav a.actif {
  background: rgba(255,255,255,0.1);
  color: var(--blanc);
}
.tableau-lateral nav a.actif { border-left: 3px solid var(--or); }
.bloc-compte {
  margin-top: 2em;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1em;
}
.nom-connecte {
  font-size: 0.85rem;
  color: var(--or-clair);
  margin: 0 0 0.6em;
}
.lien-deconnexion {
  /* Rendu identique qu'il s'agisse d'un lien ou, désormais, du bouton
     d'un formulaire POST (déconnexion protégée contre le CSRF). */
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 0.9em;
  border-radius: var(--rayon-sm);
  color: var(--or-clair);
  font-weight: 600;
  font-size: 0.92rem;
}
.lien-deconnexion:hover { background: rgba(255,255,255,0.1); color: var(--or); }
.tableau-principal { flex: 1; padding: 34px 40px; max-width: 1100px; }
.tableau-entete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2em; flex-wrap: wrap; gap: 1em; }
.tableau-entete h1 { margin: 0; font-size: 1.5rem; }

.stat-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 2.2em; }
.stat-carte {
  background: var(--blanc);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 20px;
}
.stat-carte .valeur { font-family: var(--police-affichage); font-size: 1.8rem; font-weight: 800; color: var(--bleu-nuit); }
.stat-carte .libelle { font-size: 0.82rem; color: var(--ardoise); }
.stat-carte.accent-or .valeur { color: var(--or-fonce); }

table.tableau-donnees { width: 100%; border-collapse: collapse; background: var(--blanc); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre-sm); }
table.tableau-donnees th {
  text-align: left; padding: 14px 18px; background: var(--bleu-ciel-clair);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bleu-marine);
}
table.tableau-donnees td { padding: 14px 18px; border-top: 1px solid var(--ligne); font-size: 0.92rem; }
table.tableau-donnees tr:hover td { background: #FBFCFD; }

.etiquette-statut {
  display: inline-block;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.statut-demandee { background: #FDF1DA; color: var(--or-fonce); }
.statut-proposee { background: #FDF1DA; color: var(--or-fonce); }
.statut-acceptee, .statut-en_cours { background: var(--bleu-ciel-clair); color: var(--bleu-marine); }
.statut-terminee { background: #E6F6EE; color: var(--succes); }
.statut-annulee { background: #FCEAEA; color: var(--alerte); }
.statut-disponible { background: #E6F6EE; color: var(--succes); }
.statut-en_course { background: var(--bleu-ciel-clair); color: var(--bleu-marine); }
.statut-hors_service { background: #F1F3F5; color: var(--ardoise-clair); }

.bande-references {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 32px;
  margin-top: 8px;
}
.bande-references span {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ardoise);
  padding: 0.5em 1.1em;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: var(--blanc);
}

.etiquette-type {
  display: inline-block;
  padding: 0.3em 0.85em;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #EFF3FB;
  color: var(--bleu-marine);
}

.carte-course {
  background: var(--blanc);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--ombre-sm);
}
.carte-course .adresses { margin: 14px 0; }

/* -----------------------------------------------------------------------
   SUIVI DE COURSE — page client
   -------------------------------------------------------------------- */
.suivi-course {
  max-width: 560px;
  margin: 50px auto;
  padding: 0 20px;
}
.suivi-statut-grand {
  text-align: center;
  padding: 40px 20px;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  margin-bottom: 24px;
}
.suivi-statut-grand .icone { font-size: 2.6rem; margin-bottom: 0.3em; }

.notation-etoiles { display: flex; flex-direction: row-reverse; justify-content: center; gap: 4px; margin: 10px 0 16px; }
.notation-etoiles input { display: none; }
.notation-etoiles label { font-size: 2.2rem; color: #E0E0E0; cursor: pointer; line-height: 1; }
.notation-etoiles input:checked ~ label,
.notation-etoiles label:hover,
.notation-etoiles label:hover ~ label { color: var(--or); }

/* -----------------------------------------------------------------------
   BANNIÈRES BASSES : NOTIFICATIONS / INSTALLATION
   -------------------------------------------------------------------- */
.pile-bannieres-bas {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 998;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.banniere-bas {
  background: var(--bleu-nuit);
  color: var(--blanc);
  padding: 16px 18px;
  border-radius: 14px;
  box-shadow: 0 12px 30px -8px rgba(7, 40, 64, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
}
.banniere-bas .texte-banniere { flex: 1; font-size: 0.88rem; line-height: 1.35; }
.banniere-bas .bouton-action-banniere {
  background: var(--or);
  color: var(--bleu-nuit);
  border: none;
  padding: 0.6em 1.1em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
}
.banniere-bas .bouton-action-banniere:hover { background: var(--or-fonce); }
.banniere-bas .bouton-fermer-banniere {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.banniere-bas .bouton-fermer-banniere:hover { color: var(--blanc); }
/* Variante « notifications bloquées » : même bandeau, teinte alerte plutôt
   que la couleur de marque neutre, pour bien marquer qu'il ne s'agit plus
   d'une simple proposition mais d'un problème réel (aucune alerte de
   course ne sera reçue tant que ce n'est pas corrigé côté téléphone). */
.banniere-bas.banniere-bas-alerte {
  background: #6B2222;
}
/* -----------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------- */
.bascule-menu-mobile { display: none; }
.bouton-menu-mobile { display: none; }
.bouton-menu-entete { display: none; }
.bouton-fermer-panneau { display: none; }
.voile-menu-mobile { display: none; }
.profil-mini-tiroir { display: none; }

@media (max-width: 860px) {
  .grille-3, .grille-2, .etapes, .stat-grille { grid-template-columns: 1fr 1fr; }
  .mise-en-page-tableau { flex-direction: column; }
  .tableau-lateral { width: 100%; }
  .tableau-principal { padding: 24px 18px; }

  /* Fond assombri cliquable, commun aux deux tiroirs (client / dispatch-chauffeur) */
  .voile-menu-mobile {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(7, 40, 64, 0.45);
    z-index: 900;
  }
  .bascule-menu-mobile:checked ~ .voile-menu-mobile { display: block; }

  .bouton-menu-mobile {
    display: inline-block; margin-left: auto; background: none; border: none;
    color: var(--blanc); font-size: 1.5rem; cursor: pointer; line-height: 1;
  }

  /* Tiroir latéral dispatch/chauffeur : glisse depuis la gauche, contient
     à la fois le menu et le bloc profil ("Connecté : ..." + déconnexion). */
  .panneau-lateral-mobile {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(78vw, 300px);
    background: var(--bleu-nuit);
    z-index: 950;
    padding: 26px 20px 30px;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .bascule-menu-mobile:checked ~ .mise-en-page-tableau .panneau-lateral-mobile {
    transform: translateX(0);
  }
  .panneau-lateral-mobile .bouton-fermer-panneau {
    display: block; align-self: flex-end; background: none; border: none;
    color: rgba(255,255,255,0.8); font-size: 1.4rem; cursor: pointer; margin-bottom: 0.6em;
  }

  .bouton-menu-entete {
    display: inline-block; margin-left: auto; background: none; border: none;
    color: var(--bleu-nuit); font-size: 1.5rem; cursor: pointer; line-height: 1;
  }

  /* Tiroir latéral client : glisse depuis la droite (côté du bouton ☰). */
  .entete-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.1em;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    height: auto;
    width: min(78vw, 300px);
    background: var(--blanc);
    backdrop-filter: none;
    border-radius: 0;
    box-shadow: -16px 0 32px -12px rgba(7, 40, 64, 0.3);
    padding: 24px 22px 30px;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 950;
    overflow-y: auto;
  }
  .bascule-menu-mobile:checked ~ .entete-nav {
    transform: translateX(0);
  }
  .entete-nav .bouton-fermer-panneau {
    display: block; align-self: flex-end; background: none; border: none;
    color: var(--ardoise); font-size: 1.4rem; cursor: pointer; margin-bottom: 0.4em;
  }
  .profil-mini-tiroir {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 0.4em;
    background: var(--blanc-casse); border-radius: var(--rayon-sm);
  }
  .profil-mini-tiroir .initiale-profil {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: var(--bleu-marine); color: var(--blanc); font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
  }
  .profil-mini-tiroir .nom-profil { font-weight: 700; color: var(--bleu-nuit); font-size: 0.92rem; }

  table.tableau-donnees { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 560px) {
  .grille-3, .grille-2, .etapes, .stat-grille { grid-template-columns: 1fr; }
  .hero-contenu { padding: 88px 20px 100px; }
  .bande-marine { margin: 0 12px; padding: 32px 22px; }
  /* Marge haute conservée au-dessus de la hauteur de l'en-tête fixe
     (68 px) : avec 30 px, le titre du panneau passait sous l'en-tête et
     était tronqué sur téléphone — c'est-à-dire sur l'écran de connexion,
     le premier écran vu par les chauffeurs et les clients. */
  .panneau-formulaire { margin: 88px 16px 30px; padding: 28px 22px; }
}


/* -----------------------------------------------------------------------
   CARTES (Leaflet / OpenStreetMap)
   -------------------------------------------------------------------- */
.carte-conteneur {
  border-radius: var(--rayon);
  overflow: hidden;
  border: 1px solid var(--ligne);
  box-shadow: var(--ombre-sm);
  margin-bottom: 1.2em;
  position: relative;
}
#carte-reservation { height: 340px; width: 100%; }
#carte-suivi { height: 220px; width: 100%; }

.marqueur-muje .pastille {
  width: 20px; height: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid var(--blanc);
  box-shadow: 0 2px 6px rgba(7, 40, 64, 0.35);
}
.marqueur-muje .pastille-or { background: var(--or); }
.marqueur-muje .pastille-marine { background: var(--bleu-marine); }

.instruction-carte {
  font-size: 0.85rem;
  color: var(--ardoise);
  text-align: center;
  margin: -0.4em 0 1em;
}

.champ-recherche-carte { position: relative; }
.resultats-recherche {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--blanc);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon-sm);
  box-shadow: var(--ombre);
  z-index: 400;
  max-height: 220px;
  overflow-y: auto;
}
.resultat-recherche {
  padding: 0.7em 1em;
  font-size: 0.86rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ligne);
  color: var(--ardoise);
}
.resultat-recherche:last-child { border-bottom: none; }
.resultat-recherche:hover { background: var(--bleu-ciel-clair); color: var(--bleu-marine); }

/* Pagination réelle (listes de courses appelées à grossir sur plusieurs
   années) — voir drive/templates/drive/partials/pagination.html */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  margin: 1.5em 0;
  flex-wrap: wrap;
}
.pagination__lien {
  padding: 0.5em 1.1em;
  border-radius: var(--rayon, 10px);
  background: var(--bleu-marine, #0A3D62);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.pagination__lien:hover { opacity: 0.85; }
.pagination__info { color: var(--ardoise, #555); font-size: 0.9rem; }

/* Bouton présenté comme un lien — utilisé pour les actions qui doivent
   passer en POST (déconnexion) tout en gardant l'apparence d'un lien. */
.lien-bouton {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
}
.lien-bouton:hover { color: var(--or-fonce); }

/* =============================================================================
   BARRE DE NAVIGATION BASSE — style "application mobile", visible uniquement
   sous 860px (même seuil que le reste du responsive). Utilisée côté client,
   côté chauffeur, et côté dispatch (où elle coexiste avec le tiroir latéral :
   son dernier bouton "Menu" ouvre ce même tiroir plutôt que de dupliquer la
   navigation complète).
   ========================================================================== */
.barre-nav-basse { display: none; }

@media (max-width: 860px) {
  .barre-nav-basse {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 800;
    background: var(--blanc);
    border-top: 1px solid var(--ligne);
    box-shadow: 0 -6px 20px -10px rgba(7, 40, 64, 0.25);
    padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
  }
  .barre-nav-basse a,
  .barre-nav-basse label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    color: var(--ardoise);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--rayon-sm);
    transition: color 0.15s ease, background 0.15s ease;
  }
  .barre-nav-basse a .icone-nav-basse,
  .barre-nav-basse label .icone-nav-basse { font-size: 1.3rem; line-height: 1; }
  .barre-nav-basse a:hover,
  .barre-nav-basse label:hover { background: var(--blanc-casse); }
  .barre-nav-basse a.actif,
  .barre-nav-basse label.actif { color: var(--or-fonce); }

  /* Empêche le contenu de se cacher derrière la barre fixe — présente sur
     toutes les pages base.html (client) et base_tableau.html (chauffeur/
     dispatch), donc appliqué sans condition sous ce seuil. */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
}

/* Bloc itinéraire de l'espace chauffeur : rappelle en une ligne d'où l'on
   part et où l'on va, pour l'étape en cours (rejoindre le client, puis
   conduire le client à destination). */
.bloc-itineraire {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--rayon-sm);
  background: var(--bleu-ciel-clair);
  border-left: 4px solid var(--bleu-marine);
}
.bloc-itineraire .itineraire-titre {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--bleu-nuit);
  font-size: 0.95rem;
}
.bloc-itineraire .itineraire-trajet {
  margin: 0 0 10px;
  color: var(--ardoise);
  font-size: 0.9rem;
}
.bloc-itineraire .aide:empty { display: none; }

/* =============================================================================
   FENÊTRES MODALES — composant réutilisable (voir drive/js/modale.js).
   Pensé pour les formulaires courts (changement de mot de passe, saisie
   rapide) qui ne méritent pas une page dédiée. Repose sur l'attribut HTML
   "hidden" : sans JavaScript, la fenêtre reste masquée au lieu de
   s'afficher en plein milieu de la page.
   ========================================================================== */
.modale[hidden] { display: none; }
.modale {
  position: fixed;
  /* top/right/bottom/left plutôt que le raccourci « inset », non reconnu
     par les navigateurs antérieurs à 2021 : sur un téléphone Android un
     peu ancien, la fenêtre ne se positionnait pas et devenait inutilisable. */
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modale-fond {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(7, 30, 48, 0.55);
  backdrop-filter: blur(2px);
}
.modale-boite {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: 0 24px 60px -18px rgba(7, 40, 64, 0.5);
  padding: 22px 24px 24px;
  animation: modale-apparition 0.18s ease-out;
}
@keyframes modale-apparition {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
/* Respecte le réglage système « réduire les animations ». */
@media (prefers-reduced-motion: reduce) {
  .modale-boite { animation: none; }
}
.modale-entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modale-entete h3 { margin: 0; color: var(--bleu-nuit); }
.modale-fermer {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ardoise);
  padding: 0 4px;
}
.modale-fermer:hover { color: var(--bleu-nuit); }
.modale-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}
/* Empêche la page de défiler derrière la fenêtre ouverte. */
body.modale-active { overflow: hidden; }

@media (max-width: 560px) {
  .modale { padding: 12px; align-items: flex-end; }
  .modale-boite { max-width: none; padding: 18px 16px 20px; }
  .modale-actions .bouton { flex: 1; text-align: center; }
}

/* Indicateur d'état des notifications push d'un chauffeur — rend visible
   au dispatch un problème jusqu'ici invisible : un chauffeur qui n'a
   jamais activé les notifications (ou dont le téléphone les bloque) ne
   recevait aucune alerte de nouvelle course, sans que personne ne s'en
   aperçoive avant qu'une course soit manquée. */
.etiquette-notif {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.etiquette-notif-ok { background: #E3F5EC; color: #12805A; }
.etiquette-notif-off { background: #FDECEC; color: #B23A3A; }

.encadre-avertissement {
  background: #FFF8E7;
  border-left: 4px solid #E6B325;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 8px 0 4px;
  font-size: 0.9rem;
  color: #6B4E12;
  max-width: 520px;
}
