/* KamerTrip — feuille de style unique, sans bibliothèque, pensée pour la 3G. */
:root {
  --vert: #0d6b3d;
  --vert-fonce: #084a2a;
  --vert-pale: #e6f2eb;
  --jaune: #f4b400;
  --jaune-pale: #fff6d6;
  --rouge: #c62828;
  --rouge-pale: #fdecea;
  --encre: #1c2421;
  --gris: #5f6b66;
  --ligne: #dfe5e2;
  --fond: #f6f8f7;
  --carte: #ffffff;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --vert: #3fb878; --vert-fonce: #2f9a62; --vert-pale: #12291d;
    --jaune: #f4c542; --jaune-pale: #2c2612; --rouge: #ef6c6c; --rouge-pale: #2d1515;
    --encre: #e8eeeb; --gris: #9aa7a1; --ligne: #2b3531; --fond: #111614; --carte: #182019;
    --ombre: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--encre); background: var(--fond); }
a { color: var(--vert); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
small, .discret { color: var(--gris); font-size: .875rem; }

/* En-tête */
.entete { background: var(--vert-fonce); color: #fff; }
.entete .contenu { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.logo span { color: var(--jaune); }
.entete nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.entete nav a, .entete nav button { color: #fff; text-decoration: none; opacity: .92; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.entete nav a:hover { opacity: 1; text-decoration: underline; }
.contenu { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.contenu { padding-top: 20px; padding-bottom: 48px; }
.pied { color: var(--gris); font-size: .8rem; text-align: center; padding: 24px 16px 40px; }

/* Cartes */
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); margin-bottom: 14px; }
.carte.accent { border-color: var(--vert); border-width: 2px; }
.grille { display: grid; gap: 12px; }
@media (min-width: 640px) { .grille-2 { grid-template-columns: 1fr 1fr; } .grille-3 { grid-template-columns: repeat(3, 1fr); } .grille-4 { grid-template-columns: repeat(4, 1fr); } }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--ligne); border-radius: 8px; background: var(--carte); color: var(--encre); min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vert); outline-offset: 1px; border-color: var(--vert); }
.champ { margin-bottom: 12px; }
.aide { font-size: .8rem; color: var(--gris); margin-top: 3px; font-weight: 400; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; }
.rangee > * { flex: 1 1 140px; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 18px; border-radius: 10px; border: 0; background: var(--vert); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.bouton:hover { background: var(--vert-fonce); }
.bouton.large { width: 100%; }
.bouton.secondaire { background: transparent; color: var(--vert); border: 1.5px solid var(--vert); }
.bouton.danger { background: var(--rouge); }
.bouton.petit { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.bouton[disabled] { opacity: .5; cursor: not-allowed; }
.choix-operateur { display: flex; gap: 10px; }
.choix-operateur label { flex: 1; border: 1.5px solid var(--ligne); border-radius: 10px; padding: 12px; text-align: center; cursor: pointer; font-weight: 700; }
.choix-operateur input { width: auto; min-height: 0; margin-right: 6px; }
.choix-operateur label:has(input:checked) { border-color: var(--vert); background: var(--vert-pale); }

/* Messages */
.message { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--vert-pale); border: 1px solid var(--vert); }
.message.error, .message.erreur { background: var(--rouge-pale); border-color: var(--rouge); }
.message.warning, .message.info { background: var(--jaune-pale); border-color: var(--jaune); }

/* Recherche */
.heros { background: linear-gradient(160deg, var(--vert-fonce), var(--vert)); color: #fff; padding: 28px 0 70px; }
.heros h1 { font-size: 1.7rem; }
.heros p { opacity: .9; }
.recherche { margin-top: -56px; }
.inverser { align-self: end; flex: 0 0 auto !important; }
.liens-rapides { display: flex; gap: 8px; flex-wrap: wrap; }
.puce { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--vert-pale); color: var(--vert-fonce); text-decoration: none; font-size: .875rem; font-weight: 600; border: 0; cursor: pointer; font-family: inherit; }
.puce.active { background: var(--vert); color: #fff; }
@media (prefers-color-scheme: dark) { .puce { color: var(--encre); } }

/* Résultats */
.offre { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.offre .heure { font-size: 1.6rem; font-weight: 800; }
.offre .prix { font-size: 1.25rem; font-weight: 800; text-align: right; }
.offre .compagnie { font-weight: 700; }
.etiquette { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--fond); border: 1px solid var(--ligne); color: var(--gris); vertical-align: middle; }
.etiquette.vip { background: var(--jaune-pale); border-color: var(--jaune); color: var(--encre); }
.etiquette.ok { background: var(--vert-pale); border-color: var(--vert); color: var(--vert-fonce); }
.etiquette.alerte { background: var(--rouge-pale); border-color: var(--rouge); color: var(--rouge); }
@media (prefers-color-scheme: dark) { .etiquette.ok { color: var(--encre); } }
.navigation-jours { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* Plan du bus */
.bus { display: inline-block; padding: 14px 12px; border: 2px solid var(--ligne); border-radius: 28px 28px 12px 12px; background: var(--carte); }
.bus .avant { text-align: right; font-size: .75rem; color: var(--gris); margin-bottom: 8px; }
.rangee-bus { display: flex; gap: 6px; margin-bottom: 6px; }
.siege, .couloir { width: 40px; height: 40px; flex: 0 0 40px; }
.siege { border-radius: 8px 8px 12px 12px; border: 1.5px solid var(--vert); background: var(--carte); color: var(--encre); font-weight: 700; font-size: .85rem; cursor: pointer; padding: 0; }
.siege.occupe { background: var(--ligne); border-color: var(--ligne); color: var(--gris); cursor: not-allowed; text-decoration: line-through; }
.siege.choisi { background: var(--vert); color: #fff; }
.legende { display: flex; gap: 14px; font-size: .8rem; color: var(--gris); margin: 8px 0; flex-wrap: wrap; }
.legende i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1.5px solid var(--vert); }
.legende i.o { background: var(--ligne); border-color: var(--ligne); }
.legende i.c { background: var(--vert); }
.disposition-choix { display: grid; gap: 16px; }
@media (min-width: 820px) { .disposition-choix { grid-template-columns: auto 1fr; align-items: start; } .disposition-choix .colle { position: sticky; top: 12px; } }
.passager { border-left: 4px solid var(--vert); }
.passager h3 { display: flex; justify-content: space-between; }

/* Récapitulatif des prix */
.recap { width: 100%; border-collapse: collapse; }
.recap td { padding: 6px 0; }
.recap td:last-child { text-align: right; white-space: nowrap; }
.recap tr.total td { border-top: 1px solid var(--ligne); font-weight: 800; font-size: 1.1rem; padding-top: 10px; }

/* Billet */
.billet { border: 2px dashed var(--vert); border-radius: var(--rayon); padding: 16px; background: var(--carte); margin-bottom: 14px; }
.billet .qr { width: 220px; max-width: 70vw; margin: 8px auto; display: block; background: #fff; padding: 6px; border-radius: 8px; }
.billet .qr svg { width: 100%; height: auto; display: block; }
.code-resa { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .15em; font-weight: 800; }
.statut { font-weight: 700; }
.statut-valide { color: var(--vert); }
.statut-annule, .statut-expire, .statut-absent { color: var(--rouge); }

/* Attente du paiement */
.attente { text-align: center; padding: 28px 16px; }
.roue { width: 48px; height: 48px; border: 5px solid var(--vert-pale); border-top-color: var(--vert); border-radius: 50%; margin: 0 auto 16px; animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation: none; } }

/* Tableaux du personnel */
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tableau th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gris); }
.tableau td.nombre, .tableau th.nombre { text-align: right; white-space: nowrap; }
.defile { overflow-x: auto; }
.chiffre { font-size: 1.6rem; font-weight: 800; }
.barre { height: 8px; background: var(--ligne); border-radius: 4px; overflow: hidden; min-width: 80px; }
.barre > span { display: block; height: 100%; background: var(--vert); }

/* Écran de scan */
.resultat-scan { border-radius: var(--rayon); padding: 18px; text-align: center; font-size: 1.1rem; font-weight: 700; margin: 12px 0; min-height: 90px; }
.resultat-scan.valide { background: var(--vert); color: #fff; }
.resultat-scan.erreur { background: var(--rouge); color: #fff; }
.resultat-scan.attention { background: var(--jaune); color: #1c2421; }
.resultat-scan.neutre { background: var(--carte); border: 1px solid var(--ligne); }
#lecteur { width: 100%; max-width: 420px; margin: 0 auto; border-radius: var(--rayon); overflow: hidden; }
#lecteur.actif { background: #000; min-height: 200px; }
.reseau { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.reseau.en-ligne { background: var(--vert-pale); color: var(--vert-fonce); }
.reseau.hors-ligne { background: var(--rouge-pale); color: var(--rouge); }

/* Téléphone simulé (démo) */
.telephone { max-width: 340px; margin: 0 auto; border: 10px solid #222; border-radius: 34px; padding: 22px 18px; background: #f2f2f2; color: #111; }
.telephone .ecran-op { background: #fff; border-radius: 12px; padding: 16px; }
.telephone .op-om { color: #ff7900; }
.telephone .op-momo { color: #c29b00; }
.bandeau-demo { background: var(--jaune); color: #1c2421; text-align: center; font-size: .8rem; font-weight: 700; padding: 4px 8px; }

/* Impression (billets, manifestes, affiches) */
@media print {
  .entete, .pied, .non-imprime, .bandeau-demo { display: none !important; }
  body { background: #fff; color: #000; }
  .carte, .billet { box-shadow: none; break-inside: avoid; }
  main.contenu { padding: 0; max-width: none; }
}
.affiche { text-align: center; max-width: 640px; margin: 0 auto; }
.affiche .qr-grand { width: 380px; max-width: 80vw; margin: 0 auto; background: #fff; padding: 10px; }
.affiche .qr-grand svg { width: 100%; height: auto; }
.cache { display: none !important; }
