/* =========================================================================
   Bus Urbain — carte de transport, lignes et arrêts
   -------------------------------------------------------------------------
   Une seule feuille pour les deux écrans : les vues sont écrites ici, elles
   n'ont donc pas de doublon « -mobile ». Au-delà de 640px le contenu se centre
   dans une colonne, plutôt que de s'étirer sur toute la largeur — ces écrans
   sont pensés pour la main.

   Palette du logo, déjà portée par le reste de l'application.
   ========================================================================= */

:root {
  --bu-blue:   var(--yb-blue, #0d65c9);
  --bu-navy:   var(--yb-navy, #0d233e);
  --bu-ink:    #1f2937;
  --bu-body:   #4b5563;
  --bu-muted:  #9ca3af;
  --bu-line:   #e5e7eb;
  --bu-page:   #f5f7fb;
  --bu-vert:   #059669;
}

.bu-page { background: var(--bu-page); min-height: 60vh; padding-bottom: 28px; }
.bu-conteneur { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- En-tête à onglets --------------------------------------------- */

.bu-entete {
  background: linear-gradient(135deg, var(--yb-navy, #0d233e) 0%, var(--yb-blue-dark, #0a52a4) 100%);
  color: #fff; padding: 18px 0 20px;
}
.bu-entete__haut {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.bu-page .bu-entete__titre { margin: 0; color: #fff; font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.bu-entete__sous { margin: 2px 0 0; font-size: 13.5px; color: rgba(255,255,255,.84); }
/* État de connexion : renseigné par le navigateur, pas décoratif. */
.bu-etat {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  background: rgba(255,255,255,.18); color: #fff;
  font-size: 13px; font-weight: 700;
}
.bu-etat.is-hors { background: rgba(0,0,0,.22); }

.bu-onglets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin-top: 16px; padding: 5px; border-radius: 999px;
  background: rgba(255,255,255,.16);
}
.bu-onglet {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 6px; border-radius: 999px;
  color: rgba(255,255,255,.92) !important; font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bu-onglet.is-on { background: #fff; color: var(--bu-blue) !important; }
.bu-onglet i { font-size: 16px; }

/* ---------- Blocs communs -------------------------------------------------- */

.bu-bloc {
  background: #fff; border-radius: 18px; padding: 18px;
  box-shadow: 0 6px 18px rgba(13,35,62,.08);
  margin-top: 16px;
}
.bu-page .bu-bloc__titre { margin: 0 0 14px; font-size: 17px; font-weight: 800; color: var(--bu-ink); }
.bu-aide { margin: 16px 0 0; font-size: 13.5px; color: var(--bu-body); }

/* ---------- Ma Carte ------------------------------------------------------- */

.bu-carte {
  position: relative; overflow: hidden;
  margin-top: 16px; padding: 20px;
  border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--yb-navy, #0d233e) 0%, var(--yb-blue-dark, #0a52a4) 100%);
  box-shadow: 0 14px 30px rgba(37,99,235,.28);
}
/* Deux halos, comme sur une carte physique : de la matière sans image. */
.bu-carte::before, .bu-carte::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.bu-carte::before {
  width: 190px; height: 190px; top: -70px; right: -40px; background: rgba(255,255,255,.10);
}
.bu-carte::after {
  width: 150px; height: 150px; bottom: -80px; left: -40px; background: rgba(255,255,255,.08);
}
.bu-carte__haut {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bu-carte__nom { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.bu-carte__nom i { font-size: 20px; }
.bu-carte__numero {
  padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,.16); font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
}
.bu-carte__cle { position: relative; margin: 26px 0 0; font-size: 12.5px; color: rgba(255,255,255,.78); }
.bu-carte__solde { position: relative; margin: 2px 0 0; }
.bu-carte__solde strong { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.bu-carte__solde span { font-size: 15px; font-weight: 600; margin-left: 6px; }
.bu-carte__bas {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-top: 22px;
}
.bu-carte__titulaire { font-size: 15px; font-weight: 700; }

.bu-action {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 14px; padding: 16px;
  background: #fff; border: 0; border-radius: 16px;
  box-shadow: 0 6px 18px rgba(13,35,62,.08);
  font-size: 16px; font-weight: 800; color: var(--bu-blue) !important; cursor: pointer;
}
.bu-action i { font-size: 18px; }

.bu-mouvements { list-style: none; margin: 0; padding: 0; }
.bu-mouvement {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-top: 1px solid #f1f3f8;
}
.bu-mouvement:first-child { border-top: 0; padding-top: 0; }
.bu-mouvement__quoi { min-width: 0; }
.bu-mouvement__quoi strong {
  display: block; font-size: 15px; font-weight: 700; color: var(--bu-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bu-mouvement__quand { font-size: 12.5px; color: var(--bu-muted); }
.bu-montant { flex: 0 0 auto; font-size: 15px; font-weight: 800; color: var(--bu-ink); }
.bu-montant--credit { color: var(--bu-vert); }

/* Association d'une carte : ce que voit un visiteur sans carte, à la place
   d'un solde qui ne lui appartiendrait pas. */
.bu-champ { margin-bottom: 12px; }
.bu-page .bu-champ label {
  display: block; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--bu-body);
}
.bu-page .bu-champ input {
  width: 100%; height: 46px; box-sizing: border-box;
  background: #f7f8fa; border: 1px solid #eceef2; border-radius: 12px;
  padding: 0 14px; font-size: 15px; color: var(--bu-ink);
}
.bu-page .bu-champ input:focus {
  outline: none; background: #fff; border-color: var(--bu-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.bu-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--bu-navy), var(--bu-blue));
  color: #fff !important; font-size: 15px; font-weight: 700; cursor: pointer;
}
.bu-erreur {
  margin: 0 0 12px; padding: 11px 14px; border-radius: 12px;
  background: #fef2f2; color: #b91c1c; font-size: 13.5px;
}
.bu-lien-discret {
  display: inline-block; margin-top: 12px;
  background: none; border: 0; padding: 0;
  font-size: 13px; font-weight: 600; color: var(--bu-muted) !important; cursor: pointer;
}

/* ---------- Lignes --------------------------------------------------------- */

.bu-ligne { margin-top: 12px; border-radius: 18px; background: #fff; box-shadow: 0 6px 18px rgba(13,35,62,.08); }
.bu-ligne__tete {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  cursor: pointer; list-style: none;
}
.bu-ligne__tete::-webkit-details-marker { display: none; }
.bu-ligne__numero {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.bu-ligne__corps { flex: 1 1 auto; min-width: 0; }
.bu-page .bu-ligne__titre {
  margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--bu-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bu-ligne__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--bu-body); }
.bu-ligne__meta i { color: var(--bu-muted); margin-right: 4px; }
.bu-ligne__sep { color: var(--bu-muted); }
.bu-ligne__chevron { flex: 0 0 auto; color: var(--bu-muted); font-size: 18px; transition: transform .2s ease; }
.bu-ligne[open] .bu-ligne__chevron { transform: rotate(180deg); }
.bu-hors {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: #f1f3f8; color: var(--bu-muted); font-size: 11.5px; font-weight: 700;
}

/* Parcours : une ligne verticale reliant les arrêts, comme un plan de réseau. */
.bu-parcours { list-style: none; margin: 0; padding: 4px 16px 16px 22px; }
.bu-parcours li { position: relative; padding: 0 0 16px 22px; }
.bu-parcours li::before {
  content: ''; position: absolute; left: 0; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2px solid currentColor;
}
.bu-parcours li::after {
  content: ''; position: absolute; left: 5px; top: 15px; bottom: 0;
  width: 2px; background: currentColor; opacity: .28;
}
.bu-parcours li:last-child { padding-bottom: 0; }
.bu-parcours li:last-child::after { display: none; }
.bu-parcours strong { display: block; font-size: 14px; font-weight: 700; color: var(--bu-ink); }
.bu-parcours span { font-size: 12.5px; color: var(--bu-muted); }

/* ---------- Arrêts --------------------------------------------------------- */

.bu-position {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 14px 16px;
  background: #fff; border-radius: 16px; box-shadow: 0 6px 18px rgba(13,35,62,.08);
}
.bu-position__ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--yb-blue-50, #ebf2fa); color: var(--bu-blue); font-size: 19px;
}
.bu-position__texte { flex: 1 1 auto; min-width: 0; }
.bu-position__texte strong { display: block; font-size: 15px; font-weight: 700; color: var(--bu-ink); }
.bu-position__texte span { font-size: 12.5px; color: var(--bu-muted); }
.bu-position__bouton {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 13px;
  background: #f4f6fa; color: var(--bu-body); font-size: 17px; cursor: pointer;
}

#bu-carte-plan { height: 190px; margin-top: 12px; border-radius: 16px; overflow: hidden; background: #e8eef8; }
.bu-plan-absent {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--bu-muted); font-size: 13px; text-align: center; padding: 0 20px;
}

.bu-arret { margin-top: 14px; padding: 16px; background: #fff; border-radius: 18px; box-shadow: 0 6px 18px rgba(13,35,62,.08); }
.bu-arret__tete { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bu-arret__tete i { color: var(--bu-blue); font-size: 18px; }
.bu-page .bu-arret__nom { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 800; color: var(--bu-ink); }
.bu-distance {
  flex: 0 0 auto; padding: 4px 11px; border-radius: 999px;
  background: #f1f3f8; color: var(--bu-body); font-size: 12px; font-weight: 700;
}

.bu-passage {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: #f8f9fc;
}
.bu-passage + .bu-passage { margin-top: 8px; }
.bu-passage__numero {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
}
.bu-passage__vers { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--bu-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bu-passage__quand { flex: 0 0 auto; font-size: 14px; font-weight: 800; color: var(--bu-ink); }
.bu-passage__quand i { color: var(--bu-muted); font-weight: 400; margin-right: 5px; }
.bu-passage__quand.is-proche { color: var(--bu-vert); }
.bu-passage__quand.is-hors { color: var(--bu-muted); font-size: 12.5px; font-weight: 700; }

.bu-vide {
  margin-top: 16px; padding: 30px 20px; text-align: center;
  background: #fff; border-radius: 18px; box-shadow: 0 6px 18px rgba(13,35,62,.08);
}
.bu-vide i { font-size: 40px; color: #cbd5e1; }
.bu-vide p { margin: 10px 0 0; font-size: 14px; color: var(--bu-body); }

/* ---------- Écrans étroits ------------------------------------------------- */

@media (max-width: 359.98px) {
  .bu-onglet { font-size: 12.5px; gap: 5px; padding: 10px 4px; }
  .bu-onglet i { font-size: 14px; }
  .bu-carte__solde strong { font-size: 32px; }
}

/* ---------- Guichet (agents) ----------------------------------------------- */

/* Le guichet réutilise les blocs de l'application ; il lui faut seulement de
   quoi présenter des formulaires, absents des trois écrans voyageurs. */
.bu-flash {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--yb-blue-50, #ebf2fa); color: var(--bu-blue); font-size: 13.5px; font-weight: 600;
}
.bu-flash i { margin-right: 6px; }

.bu-form label {
  display: block; margin: 12px 0 5px;
  font-size: 11.5px; font-weight: 700; color: var(--bu-muted);
}
.bu-form label:first-of-type { margin-top: 0; }
.bu-page .bu-form input,
.bu-page .bu-form select {
  width: 100%; height: 46px; padding: 0 13px;
  border: 1px solid var(--bu-line); border-radius: 11px; background: #f8fafc;
  font-size: 15px; color: var(--bu-ink); outline: none;
}
.bu-page .bu-form input:focus,
.bu-page .bu-form select:focus { border-color: var(--bu-blue); background: #fff; }
.bu-form .bu-btn { margin-top: 14px; }

/* Montants courants : cibles larges, la saisie se fait debout et vite. */
.bu-montants { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.bu-montants__choix {
  flex: 1 1 auto; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--bu-line); border-radius: 999px; background: #fff;
  font-size: 13.5px; font-weight: 700; color: var(--bu-ink);
}
.bu-montants__choix:hover { border-color: var(--bu-blue); color: var(--bu-blue); }

/* Prix annoncé avant validation : le voyageur doit pouvoir le contester. */
.bu-prix {
  margin: 14px 0 0; padding: 13px; border-radius: 12px; text-align: center;
  background: linear-gradient(135deg, var(--bu-navy), var(--bu-blue)); color: #fff;
  font-size: 18px; font-weight: 800;
}
