/* Salon GELEC : texte toujours noir (#000) ou blanc (#fff), accent rouge GELEC. */
:root {
  --rouge: #E30613;
  --noir: #000;
  --blanc: #fff;
  --fond-doux: #f4f4f4;   /* fond uniquement, jamais pour du texte */
  --barre: 76px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blanc);
  color: var(--noir);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1 { font-size: 24px; margin: 8px 0 4px; }
h2 { font-size: 21px; margin: 4px 0 12px; }
hr { border: 0; border-top: 1px solid var(--noir); margin: 24px 0; }

/* Bandeau d'état réseau */
.bandeau {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--noir); color: var(--blanc);
  font-size: 15px; font-weight: 600;
}
.bandeau.hors-ligne { background: var(--rouge); }

/* En-tête et onglets */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.logo { height: 28px; }
.moi { font-size: 15px; font-weight: 600; text-align: right; }
.onglets { display: flex; border-bottom: 2px solid var(--noir); background: var(--blanc); }
.onglet {
  flex: 1; min-height: 48px; border: 0; background: var(--blanc); color: var(--noir);
  font: inherit; font-weight: 600; cursor: pointer;
}
.onglet.actif { background: var(--noir); color: var(--blanc); }

/* Pages */
.page { padding: 16px; padding-bottom: calc(var(--barre) + 32px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
#v-liste.page, #v-export.page { padding-bottom: 32px; }
.bloc { margin-bottom: 22px; }
.libelle { display: block; font-weight: 700; margin: 12px 0 6px; font-size: 16px; }
.bloc > .libelle:first-child, .bloc > div > .libelle:first-child { margin-top: 0; }
.aide { font-size: 15px; margin: 8px 0 0; }
.deux-colonnes { display: grid; grid-template-columns: 2fr 3fr; gap: 12px; }

input[type=text], input[type=email], input[type=tel], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 17px; color: var(--noir); background: var(--blanc);
  border: 2px solid var(--noir); border-radius: 8px; appearance: none; -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, #000 50%), linear-gradient(135deg, #000 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-within { outline: 3px solid var(--rouge); outline-offset: 1px; }
::placeholder { color: var(--noir); opacity: 1; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 16px; border-radius: 8px;
  border: 2px solid var(--noir); background: var(--blanc); color: var(--noir);
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-principal { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }
.btn-danger { background: var(--noir); border-color: var(--noir); color: var(--blanc); }
.btn-large { width: 100%; min-height: 56px; font-size: 18px; margin-top: 12px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-photo { width: 100%; min-height: 64px; font-size: 18px; background: var(--noir); color: var(--blanc); }
.ligne-boutons { display: flex; gap: 10px; }
.ligne-boutons .btn { flex: 1; }

/* Boutons de choix (radio / cases) */
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix-colonne { flex-direction: column; }
.choix button {
  min-height: 46px; padding: 8px 14px; border-radius: 23px;
  border: 2px solid var(--noir); background: var(--blanc); color: var(--noir);
  font: inherit; font-size: 16px; font-weight: 500; cursor: pointer;
}
.choix-colonne button { border-radius: 8px; min-height: 52px; font-weight: 600; text-align: left; }
.choix button[aria-checked=true], .choix button[aria-pressed=true] { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); font-weight: 700; }
.choix-temperature button { flex: 1; }

.case { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; }
.case input { width: 28px; height: 28px; accent-color: var(--rouge); flex: none; margin: 0; }

/* Photo */
.photo-apercu { margin-top: 12px; border: 2px solid var(--noir); border-radius: 8px; padding: 10px; }
.photo-apercu img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: var(--fond-doux); border-radius: 4px; }
.photo-apercu p { margin: 8px 0; font-size: 15px; }

/* Messages */
.message-erreur { background: var(--rouge); color: var(--blanc); padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.message-alerte { border: 2px solid var(--rouge); color: var(--noir); padding: 8px 12px; border-radius: 8px; font-size: 15px; margin: 8px 0 0; }
.encart-edition { border: 2px solid var(--noir); border-radius: 8px; padding: 4px 12px 12px; margin-bottom: 20px; background: var(--fond-doux); }

/* Barre Enregistrer fixée en bas */
.barre-enregistrer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--blanc); border-top: 2px solid var(--noir);
}
.barre-enregistrer .btn { margin: 0; max-width: 608px; display: flex; margin-inline: auto; min-height: 56px; }

/* Toast */
.toast {
  position: fixed; left: 16px; right: 16px; top: 60px; z-index: 40;
  padding: 14px 16px; border-radius: 8px; text-align: center; font-weight: 700;
  background: var(--noir); color: var(--blanc); box-shadow: 0 6px 20px rgba(0,0,0,.25);
}

/* Liste */
.compteurs { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.filtres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.filtres .btn-filtre { grid-column: 1 / -1; }
.btn-filtre[aria-pressed=true] { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }
.filtre .libelle { margin-top: 0; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { margin-bottom: 10px; }
.fiche {
  width: 100%; display: block; text-align: left; padding: 12px; border-radius: 8px;
  border: 2px solid var(--noir); background: var(--blanc); color: var(--noir); font: inherit; cursor: pointer;
}
.fiche strong { display: block; font-size: 17px; }
.fiche .details { display: block; font-size: 15px; margin-top: 2px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 12px; border: 2px solid var(--noir); background: var(--blanc); color: var(--noir); }
.badge-chaud { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }
.badge-tiede { background: var(--noir); color: var(--blanc); }
.badge-attente { border-style: dashed; }
.vide { text-align: center; font-weight: 600; margin-top: 32px; }

/* Connexion */
#v-login { padding: 24px 16px 40px; max-width: 480px; margin: 0 auto; }
.logo-login { height: 40px; display: block; margin: 12px 0 16px; }
.sous-titre { margin: 0 0 16px; font-weight: 500; }
#login-pin { font-size: 26px; letter-spacing: 12px; text-align: center; }
