/* Espace conducteur — pensé pour le téléphone : gros textes, gros boutons, rien de superflu.
   Base : Bootstrap 5.3 (vendor/bootstrap.min.css) ; ici, seulement les réglages propres à BTA. */

:root {
  --bta-bleu: #0b4f8a;
  --bta-vert: #157347;
  --bta-rouge: #b02a37;
  --bta-gris: #4a5560;
  --bta-bordure: #d5dbe1;
}

html { font-size: 18px; }
body { background: #f3f5f7; color: #1d2329; }

/* En-tête */
.entete { background: var(--bta-bleu); color: #fff; min-height: 56px; padding: .25rem 0; display: flex; align-items: center; }
.marque { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: .06em; text-decoration: none; }
.marque:hover, .marque:focus { color: #fff; }
.lien-deconnexion { color: #fff; font-size: 1rem; padding: .5rem 0; text-decoration: underline; }
.lien-deconnexion:hover, .lien-deconnexion:focus { color: #fff; }
/* Pages intérieures (21/11) : « ← Accueil » au lieu de « Se déconnecter », et le véhicule (numéro de parc, plaque) */
.lien-retour {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding-right: .4rem;
  color: #fff; font-size: 1rem; font-weight: 600; text-decoration: none;
}
.lien-retour:hover, .lien-retour:focus { color: #fff; text-decoration: underline; }
.entete-vehicule { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 700; }

/* Colonne unique, confortable aussi sur ordinateur */
.contenu, .contenu-large { max-width: 560px; }
.contenu { padding-top: 1rem; padding-bottom: 3rem; }

/* Textes */
.titre { font-size: 1.75rem; font-weight: 700; margin-bottom: .2rem; }
.sous-titre { font-size: 1.1rem; color: var(--bta-gris); margin-bottom: 1.25rem; }
.aide { color: var(--bta-gris); font-size: 1rem; margin: .3rem 0 .8rem; }
.etiquette { color: var(--bta-gris); font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ligne-forte { font-size: 1.2rem; font-weight: 600; }
.alert { font-size: 1.05rem; }

/* Boutons : grandes zones à toucher */
.btn-gros {
  min-height: 4.25rem; font-size: 1.3rem; font-weight: 600; border-radius: .8rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.btn-moyen { min-height: 3.4rem; font-size: 1.1rem; border-radius: .7rem; display: flex; align-items: center; justify-content: center; }
.lien-annuler { font-size: 1.1rem; padding: .9rem; }

/* Champs */
.form-label { font-size: 1.1rem; font-weight: 600; }
.form-control-lg { min-height: 3.5rem; font-size: 1.3rem; border-radius: .7rem; }
.case-a-cocher { font-size: 1.1rem; }
.case-a-cocher .form-check-input { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.case-a-cocher .form-check-label { padding-left: .4rem; }
.champ-km { font-size: 2rem; font-weight: 700; text-align: center; letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* Cartes d'information */
.carte { background: #fff; border: 1px solid var(--bta-bordure); border-radius: .9rem; padding: 1rem; margin-bottom: 1rem; }
.immatriculation { font-size: 2rem; font-weight: 800; letter-spacing: .05em; }
.kilometrage { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Étapes du tour */
.etape { background: #fff; border: 2px solid var(--bta-bordure); border-radius: .9rem; padding: 1rem; margin-bottom: 1rem; position: relative; }
.etape-titre { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; margin: 0 0 .2rem; }
.numero {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--bta-bleu); color: #fff; font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.etape-photo .texte-reprendre { display: none; }
.etape-photo.faite { border-color: var(--bta-vert); }
.etape-photo.faite .numero { background: var(--bta-vert); }
.etape-photo.faite .texte-prendre { display: none; }
.etape-photo.faite .texte-reprendre { display: inline; }
.etape.manquante { border-color: var(--bta-rouge); }
.apercu { display: block; width: 100%; max-height: 15rem; object-fit: cover; border-radius: .6rem; margin-bottom: .8rem; background: #e9ecef; }

/* Envoi du tour par le script (conducteur.js) : photo en préparation, avancement, coupure */
.etape-photo .texte-preparation { display: none; }
.etape-photo.en-preparation .texte-preparation { display: block; }
.etat-envoi { margin-bottom: .9rem; }
.etat-texte { font-size: 1.1rem; font-weight: 600; margin-bottom: .45rem; }
.etat-envoi.echec .etat-texte { color: var(--bta-rouge); }
.etat-envoi .progress { height: 1rem; border-radius: .5rem; }
.note-brouillon .effacer-brouillon { font-size: inherit; }

/* Tour du véhicule (maquette « B4 retouchée », 21/11) : le compteur et son kilométrage, puis le plan du véhicule et
   ses quatre angles, dans l'ordre voulu ; une photo prise remplit sa case. Les cases restent des étapes (faite,
   manquante, en-preparation) : conducteur.js garde la même logique. */
.tete-tour { display: flex; align-items: center; gap: .2rem; margin-bottom: .6rem; }
.tete-tour .titre { flex: 1; min-width: 0; margin: 0; font-size: 1.3rem; }
.bouton-aide {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--bta-bleu); display: inline-flex; align-items: center; justify-content: center;
}
.compte-photos {
  flex: none; padding: .3rem .7rem; border-radius: 999px; background: #e7f1ff; color: var(--bta-bleu);
  font-size: .85rem; font-weight: 700; white-space: nowrap;
}
.compte-photos.complet { background: #e8f5ee; color: #146c43; }

/* Une case de photo : l'appareil photo tant qu'elle n'est pas prise, puis la photo elle-même avec une coche */
.formulaire-tour .tuile-image { position: relative; display: block; margin: 0; overflow: hidden; background: #f5f9ff; color: #0d6efd; cursor: pointer; }
.formulaire-tour .tuile-image .apercu {
  position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; object-fit: cover;
}
.tuile-vide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.etape-photo.faite .tuile-vide { display: none; }
.etape-photo.en-preparation .tuile-vide, .etape-photo.faite:has(.apercu.d-none) .tuile-vide { display: flex; }
.coche {
  position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50%;
  background: var(--bta-vert); display: none; align-items: center; justify-content: center;
}
.etape-photo.faite .coche { display: flex; }
.etape-photo.en-preparation .coche { display: none; }
.formulaire-tour .texte-preparation {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: .2rem; background: rgba(29, 35, 41, .75);
  color: #fff; font-size: .75rem; text-align: center;
}
.tuile-etat { font-size: .72rem; font-weight: 700; }
.tuile-etat .a-prendre { color: var(--bta-bleu); }
.tuile-etat .prise { display: none; color: var(--bta-vert); }
.etape-photo.faite .tuile-etat .a-prendre { display: none; }
.etape-photo.faite .tuile-etat .prise { display: inline; }

/* Le compteur : sa photo, et à côté le kilométrage que l'on y lit */
.formulaire-tour .bloc-compteur { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding: .55rem; margin-bottom: .6rem; }
.formulaire-tour .bloc-compteur.faite { border-color: var(--bta-vert); }
.formulaire-tour .bloc-compteur.manquante { border-color: var(--bta-rouge); }
.tuile-image-compteur { flex: none; width: 7.5rem; aspect-ratio: 4 / 3; border: 2px dashed #0d6efd; border-radius: .6rem; }
.bloc-compteur.faite .tuile-image-compteur { border: 0; }
.formulaire-tour .etape-km { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; background: none; }
.ligne-compteur { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; }
.nom-compteur { margin: 0; font-size: 1rem; font-weight: 700; }
.aide-km { display: block; margin: .15rem 0; font-size: .75rem; color: var(--bta-gris); }
.formulaire-tour .champ-km { min-height: 2.4rem; padding: .15rem .4rem; font-size: 1.2rem; border-width: 2px; }
.etape-km.manquante .champ-km { border-color: var(--bta-rouge); }
.formulaire-tour .etape-km .errorlist { font-size: .85rem; }
.formulaire-tour .bloc-compteur > .errorlist { flex-basis: 100%; margin: 0; }

/* Le plan : le véhicule vu du dessus au milieu, une case par angle à l'endroit où l'on se tient */
.plan {
  display: grid; grid-template-columns: minmax(0, 1fr) 5.1rem minmax(0, 1fr);
  grid-template-areas: "ag vehicule ad" "arg vehicule ard"; gap: .55rem .35rem; align-items: start;
  max-width: 25rem; margin: 0 auto; padding: .35rem; background: #fff; border: 2px solid var(--bta-bordure); border-radius: 1rem;
}
.plan-vehicule { grid-area: vehicule; align-self: center; }
.vehicule-dessus { display: block; width: 100%; height: auto; aspect-ratio: 100 / 262; }
.tuile-avant-gauche { grid-area: ag; }
.tuile-avant-droit { grid-area: ad; }
.tuile-arriere-gauche { grid-area: arg; }
.tuile-arriere-droit { grid-area: ard; }
.formulaire-tour .tuile { margin: 0; padding: 0; overflow: hidden; background: #f5f9ff; border: 2px dashed #0d6efd; border-radius: .75rem; }
.formulaire-tour .tuile.faite { background: #fff; border-style: solid; border-color: var(--bta-vert); }
.formulaire-tour .tuile.manquante { border-style: solid; border-color: var(--bta-rouge); }
.tuile-zone { display: flex; flex-direction: column; align-items: center; margin: 0; text-align: center; cursor: pointer; }
.tuile .tuile-image { width: 100%; aspect-ratio: 3 / 4; }
.tuile-nom { padding: .3rem .2rem 0; font-size: .8rem; font-weight: 700; line-height: 1.15; }
.tuile .tuile-etat { padding-bottom: .3rem; }
.tuile .errorlist { margin: 0; padding: 0 .3rem .35rem; font-size: .75rem; text-align: center; }
.consigne-ordre { margin: .45rem 0 .1rem; font-size: .85rem; text-align: center; }
.consigne-ordre .si-fini, .formulaire-tour.tout-pris .consigne-ordre .si-en-cours { display: none; }
.formulaire-tour.tout-pris .consigne-ordre .si-fini { display: inline; }

/* La remarque, repliée tant qu'on n'en a pas besoin */
.formulaire-tour .remarque { margin: 0 0 .6rem; padding: 0; background: none; border: 0; }
.remarque summary {
  display: flex; align-items: center; min-height: 44px; color: var(--bta-bleu); font-size: 1rem;
  text-decoration: underline; cursor: pointer; list-style: none;
}
.remarque summary::-webkit-details-marker { display: none; }
.remarque .si-ouvert, .remarque[open] .si-ferme { display: none; }
.remarque[open] .si-ouvert { display: inline; }
.formulaire-tour .remarque[open] { padding: .2rem .8rem .8rem; background: #fff; border: 2px solid var(--bta-bordure); border-radius: .9rem; }
.formulaire-tour .remarque.manquante { border: 2px solid var(--bta-rouge); }
.remarque[open] summary { color: inherit; font-weight: 700; text-decoration: none; }

/* « Envoyer le tour » : gris avec « Encore 2 photos » tant qu'il en manque (l'appui dit alors lesquelles) */
.formulaire-tour .bouton-envoyer { min-height: 3.75rem; flex-direction: column; gap: 0; line-height: 1.2; }
.bouton-envoyer .reste-photos { font-size: .8rem; font-weight: 500; }
.bouton-envoyer.incomplet {
  --bs-btn-bg: #dee2e6; --bs-btn-border-color: #dee2e6; --bs-btn-color: #4a5560;
  --bs-btn-hover-bg: #d3d9df; --bs-btn-hover-border-color: #d3d9df; --bs-btn-hover-color: #4a5560;
  --bs-btn-active-bg: #c8cfd6; --bs-btn-active-border-color: #c8cfd6; --bs-btn-active-color: #4a5560;
}

/* Une photo prise, en grand : « Garder » ou « Reprendre » */
.visionneuse {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: #11161a; color: #fff;
}
.visionneuse[open] { display: flex; flex-direction: column; }
.visionneuse::backdrop { background: #11161a; }
.visionneuse-haut { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 56px; padding: 0 1rem 0 .3rem; }
.visionneuse-retour {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .5rem; border: 0; background: none;
  color: #fff; font-size: 1rem; font-weight: 600;
}
.visionneuse-titre { margin: 0; font-size: 1rem; font-weight: 700; }
.visionneuse-photo { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.visionneuse-bas { flex: none; display: grid; gap: .75rem; padding: .8rem 1.1rem 1.2rem; }
.visionneuse-question { margin: 0; color: #e9edf1; font-size: 1rem; text-align: center; }
.visionneuse-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.visionneuse-boutons .btn { min-height: 3.6rem; gap: .45rem; font-size: 1.1rem; }

/* Touche « i » : les croquis, dans un panneau qui monte du bas */
.panneau-aide {
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 1.1rem 1.1rem 0 0; background: #fff; color: #1d2329; overflow: auto;
}
.panneau-aide::backdrop { background: rgba(29, 35, 41, .45); }
.panneau-contenu { display: grid; gap: .5rem; padding: .5rem 1rem 1rem; }
.panneau-poignee { justify-self: center; width: 44px; height: 5px; border-radius: 3px; background: #c3cbd3; }
.panneau-haut { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.panneau-haut h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.panneau-fermer {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f3f5f7;
  color: var(--bta-gris); display: inline-flex; align-items: center; justify-content: center;
}
.regle { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .55rem .7rem; border-radius: .7rem; background: #e7f1ff; font-size: .9rem; line-height: 1.35; }
.regle svg { flex: none; color: var(--bta-bleu); }
.croquis { display: block; height: auto; aspect-ratio: 200 / 240; }
.croquis-compteur { display: flex; align-items: center; gap: .7rem; margin: 0; padding: .35rem .7rem .35rem .35rem; border-radius: .7rem; background: #f3f5f7; }
.croquis-compteur .croquis { flex: none; width: 4.5rem; }
.grille-croquis { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.grille-croquis figure {
  margin: 0; padding: .45rem .35rem; border-radius: .7rem; background: #f3f5f7;
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
}
.grille-croquis .croquis { width: 100%; max-width: 7.5rem; }
.panneau-aide figcaption strong { display: block; font-size: .85rem; }
.panneau-aide figcaption span { display: block; color: var(--bta-gris); font-size: .72rem; line-height: 1.3; }
body:has(dialog[open]) { overflow: hidden; }
dialog:not([open]) { display: none; }       /* très vieux navigateur qui ne connaît pas les fenêtres : rien ne s'affiche */

/* « Tout reprendre à zéro ? » (21/11) : le choix sûr d'abord, l'effacement en rouge */
.confirmation { width: calc(100% - 2rem); max-width: 26rem; padding: 0; border: 0; border-radius: 1rem; background: #fff; color: #1d2329; }
.confirmation::backdrop { background: rgba(29, 35, 41, .45); }
.confirmation-contenu { display: grid; gap: .7rem; padding: 1.1rem; }
.confirmation h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.confirmation p { margin: 0 0 .2rem; color: var(--bta-gris); font-size: 1rem; }

/* Signaler un problème (20/11) : le choix en gros boutons, ses signalements en cours sur l'accueil */
.choix-nature { display: grid; gap: .6rem; margin-top: .6rem; }
.choix-nature .btn {
  min-height: 3.6rem; font-size: 1.15rem; font-weight: 600; border-radius: .8rem;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.liste-signalements { list-style: none; padding: 0; margin: .4rem 0 .6rem; }
.liste-signalements li { display: flex; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-top: 1px solid var(--bta-bordure); font-size: 1.05rem; font-weight: 600; }
.liste-signalements li:first-child { border-top: 0; }
.liste-signalements .quand { color: var(--bta-gris); font-weight: 400; text-align: right; white-space: nowrap; }

/* Messages d'erreur des champs */
.errorlist { list-style: none; padding: 0; margin: .6rem 0 0; color: var(--bta-rouge); font-weight: 600; font-size: 1.05rem; }

/* Photos d'un tour enregistré */
.grille-photos { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1.25rem; }
.grille-photos figure { margin: 0; }
.grille-photos .photo-large { grid-column: 1 / -1; }
.grille-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .6rem; background: #e9ecef; display: block; }
.grille-photos figcaption { font-size: .95rem; color: var(--bta-gris); margin-top: .25rem; text-align: center; }

/* Accueil : prochains jours de la feuille de route (décisions du 25/11). Le jour et son état sur une ligne, ce qui est
   prévu dessous : demain confirmé (coche verte) ; les jours suivants en gris, « prévisionnel » ; un jour pas encore
   préparé, en italique */
.prochains-jours { list-style: none; padding: 0; margin: .4rem 0 .5rem; }
.prochains-jours li { padding: .5rem 0; border-top: 1px solid var(--bta-bordure); font-size: 1.05rem; }
.prochains-jours li:first-child { border-top: 0; }
.prochains-jours .ligne-jour { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.prochains-jours .jour { color: var(--bta-gris); }
.prochains-jours .statut { color: var(--bta-gris); font-size: .85rem; white-space: nowrap; }
.prochains-jours .statut-confirme { color: var(--bta-vert); font-weight: 700; }
.prochains-jours .vehicule { font-size: 1.15rem; font-weight: 700; }
.prochains-jours li.previsionnel .vehicule, .prochains-jours li.previsionnel .sans-vehicule { color: var(--bta-gris); }
.prochains-jours li.en-preparation .sans-vehicule { color: var(--bta-gris); font-style: italic; }
