/* =====================================================================
   Secrétariat BBJ — feuille de style
   Charte issue du logo : vert forêt profond et crème.
   Aucune police téléchargée : sur Mac et iPhone, ui-serif donne
   New York et -apple-system donne SF. Élégant et instantané.
   ===================================================================== */

:root {
  --vert:          #1E4A32;
  --vert-fonce:    #163726;
  --vert-clair:    #2C6646;
  --vert-pale:     #E3EBE5;

  --creme:         #F2EBD9;
  --creme-clair:   #FAF6EC;
  --blanc:         #FDFCF8;

  --encre:         #22251F;
  --encre-douce:   #5A5F54;
  --trait:         #D9D0BA;

  --alerte:        #B8691E;
  --alerte-fond:   #FBF0E2;
  --danger:        #9B2F2F;
  --succes:        #2C6646;

  --serif:  ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans:   -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
            system-ui, sans-serif;

  --rayon:  8px;
  --ombre:  0 1px 2px rgba(34, 37, 31, .06),
            0 4px 12px rgba(34, 37, 31, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--creme);
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- */
/*  En-tête                                                          */
/* ---------------------------------------------------------------- */

.entete {
  background: var(--vert);
  color: var(--creme);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 94px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.entete__logo {
  width: 74px;
  height: 74px;
  flex: none;
  border-radius: 50%;
  background: var(--creme);
  object-fit: contain;
}

.entete__titre {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0;
}

.entete__espace { flex: 1; }

.entete__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.entete__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vert-clair);
  color: var(--creme);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(242, 235, 217, .3);
}

.entete__lien {
  color: rgba(242, 235, 217, .75);
  text-decoration: none;
  font-size: 13px;
}
.entete__lien:hover { color: var(--creme); }

/* ---------------------------------------------------------------- */
/*  Navigation                                                       */
/* ---------------------------------------------------------------- */

.nav {
  background: var(--creme-clair);
  border-bottom: 1px solid var(--trait);
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  position: sticky;
  top: 94px;
  z-index: 19;
}

.nav a {
  padding: 13px 16px;
  color: var(--encre-douce);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
}

.nav a:hover { color: var(--vert); }

.nav a.actif {
  color: var(--vert);
  border-bottom-color: var(--vert);
}

/* ---------------------------------------------------------------- */
/*  Mise en page                                                     */
/* ---------------------------------------------------------------- */

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.sous-titre {
  color: var(--encre-douce);
  font-size: 14.5px;
  margin: 0 0 26px;
}

.carte {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--ombre);
}

.carte__titre {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--trait);
}

/* ---------------------------------------------------------------- */
/*  Tableau de bord                                                  */
/* ---------------------------------------------------------------- */

.chiffres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.chiffre {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 18px;
  box-shadow: var(--ombre);
}

.chiffre__valeur {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--vert);
  line-height: 1.1;
}

.chiffre__libelle {
  font-size: 13px;
  color: var(--encre-douce);
  margin-top: 5px;
}

.pile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--trait);
}
.pile:last-child { border-bottom: none; }

.pile__nombre {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  min-width: 42px;
}
.pile__nombre--zero { color: var(--encre-douce); opacity: .45; }
.pile__nombre--actif { color: var(--alerte); }

.barre {
  height: 7px;
  background: var(--vert-pale);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
/* Un effectif nul n'affiche aucune barre : un rail plein se lit de
   loin comme une barre remplie. */
.barre--vide { background: transparent; }
.barre > span {
  display: block;
  height: 100%;
  background: var(--vert-clair);
}

.activite-ligne {
  padding: 11px 0;
  border-bottom: 1px solid var(--trait);
}
.activite-ligne:last-child { border-bottom: none; }

.activite-ligne__haut {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 14.5px;
}

/* ---------------------------------------------------------------- */
/*  Formulaires                                                      */
/* ---------------------------------------------------------------- */

.champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 15px;
}

.champ { display: flex; flex-direction: column; }
.champ--large { grid-column: 1 / -1; }

.champ label {
  font-size: 13px;
  font-weight: 600;
  color: var(--encre-douce);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="date"],
select,
textarea {
  font-family: var(--sans);
  font-size: 16px;            /* 16px évite le zoom automatique sur iPhone */
  padding: 10px 12px;
  border: 1px solid var(--trait);
  border-radius: 6px;
  background: var(--creme-clair);
  color: var(--encre);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--vert-clair);
  background: var(--blanc);
  box-shadow: 0 0 0 3px rgba(44, 102, 70, .13);
}

textarea { min-height: 70px; resize: vertical; }

/* ---------------------------------------------------------------- */
/*  Boutons                                                          */
/* ---------------------------------------------------------------- */

button, .bouton {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--vert);
  color: var(--creme);
  text-decoration: none;
  display: inline-block;
}

button:hover, .bouton:hover { background: var(--vert-fonce); }
button:disabled { opacity: .45; cursor: not-allowed; }

.bouton--secondaire {
  background: transparent;
  color: var(--vert);
  border-color: var(--trait);
}
.bouton--secondaire:hover { background: var(--vert-pale); }

.bouton--grand { font-size: 16px; padding: 14px 26px; }

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ---------------------------------------------------------------- */
/*  Recherche de personne (saisie)                                   */
/* ---------------------------------------------------------------- */

.recherche { position: relative; }

.suggestions {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  max-height: 290px;
  overflow-y: auto;
  z-index: 30;
}

.suggestion {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--trait);
}
.suggestion:last-child { border-bottom: none; }
.suggestion:hover { background: var(--vert-pale); }

.suggestion__nom { font-weight: 600; font-size: 14.5px; }
.suggestion__detail { font-size: 12.5px; color: var(--encre-douce); }

/* ---------------------------------------------------------------- */
/*  Activités cochables                                              */
/* ---------------------------------------------------------------- */

.activites-choix { display: flex; flex-direction: column; gap: 9px; }

.activite-choix {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--trait);
  border-radius: 6px;
  cursor: pointer;
  background: var(--creme-clair);
}

.activite-choix:hover { border-color: var(--vert-clair); }

.activite-choix input { width: 19px; height: 19px; accent-color: var(--vert); flex: none; }

.activite-choix__nom { flex: 1; font-size: 14.5px; }

.activite-choix__tarif {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  color: var(--vert);
}

.activite-choix:has(input:checked) {
  background: var(--vert-pale);
  border-color: var(--vert-clair);
}

/* ---------------------------------------------------------------- */
/*  Total                                                            */
/* ---------------------------------------------------------------- */

.total {
  background: var(--vert);
  color: var(--creme);
  border-radius: var(--rayon);
  padding: 18px 22px;
  margin-top: 18px;
}

.total__ligne {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  padding: 3px 0;
  color: rgba(242, 235, 217, .82);
}

.total__final {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid rgba(242, 235, 217, .25);
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  color: var(--creme);
}

/* ---------------------------------------------------------------- */
/*  Messages                                                         */
/* ---------------------------------------------------------------- */

.message {
  padding: 13px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 14.5px;
  border: 1px solid;
}

.message--succes {
  background: var(--vert-pale);
  border-color: var(--vert-clair);
  color: var(--vert-fonce);
}

.message--alerte {
  background: var(--alerte-fond);
  border-color: var(--alerte);
  color: var(--alerte);
}

.message--erreur {
  background: #FBEDED;
  border-color: var(--danger);
  color: var(--danger);
}

.vide {
  text-align: center;
  padding: 44px 20px;
  color: var(--encre-douce);
  font-size: 14.5px;
}

.chargement { text-align: center; padding: 44px; color: var(--encre-douce); }

/* ---------------------------------------------------------------- */
/*  Étiquettes                                                       */
/* ---------------------------------------------------------------- */

.etiquette {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--vert-pale);
  color: var(--vert-fonce);
}

.etiquette--alerte { background: var(--alerte-fond); color: var(--alerte); }

/* ---------------------------------------------------------------- */
/*  Compteur de session                                              */
/* ---------------------------------------------------------------- */

.compteur {
  font-size: 13.5px;
  color: var(--encre-douce);
  margin-left: auto;
}

/* ---------------------------------------------------------------- */
/*  iPhone                                                           */
/* ---------------------------------------------------------------- */

@media (max-width: 640px) {
  .entete { padding: 0 14px; height: 72px; gap: 12px; }
  .entete__logo { width: 56px; height: 56px; }
  .entete__titre { font-size: 19px; }
  .entete__user span.prenom { display: none; }
  .nav { top: 72px; padding: 0 8px; }
  main { padding: 20px 14px 70px; }
  h2 { font-size: 22px; }
  .champs { grid-template-columns: 1fr; }
  .actions button, .actions .bouton { width: 100%; }
}

/* Zone sûre pour l'encoche et la barre d'accueil en mode PWA */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .entete { padding-top: env(safe-area-inset-top); height: calc(94px + env(safe-area-inset-top)); }
}

/* ---------------------------------------------------------------- */
/*  États (certificat, droit à l'image)                              */
/* ---------------------------------------------------------------- */

.etiquette--danger { background: #FBEDED; color: var(--danger); }
.etiquette--neutre { background: #EFEDE6; color: var(--encre-douce); }

/* ---------------------------------------------------------------- */
/*  Choix à trois états : oui / non / non renseigné                  */
/* ---------------------------------------------------------------- */

.segments {
  display: inline-flex;
  border: 1px solid var(--trait);
  border-radius: 6px;
  overflow: hidden;
  background: var(--creme-clair);
}

.segments label { margin: 0; position: relative; cursor: pointer; }

.segments input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.segments span {
  display: block;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--encre-douce);
  border-right: 1px solid var(--trait);
  white-space: nowrap;
}

.segments label:last-child span { border-right: none; }

.segments input:checked + span {
  background: var(--vert);
  color: var(--creme);
  font-weight: 600;
}

.segments input:focus-visible + span {
  box-shadow: inset 0 0 0 2px var(--vert-clair);
}

/* ---------------------------------------------------------------- */
/*  Aide sous un champ                                               */
/* ---------------------------------------------------------------- */

.aide {
  font-size: 12.5px;
  color: var(--encre-douce);
  margin-top: 5px;
}

/* ---------------------------------------------------------------- */
/*  Liste d'adhérents : ligne entièrement cliquable                  */
/* ---------------------------------------------------------------- */

a.pile { text-decoration: none; color: inherit; }
a.pile:hover { background: var(--creme-clair); }

.pile__infos { min-width: 0; }
.pile__detail {
  font-size: 13px;
  color: var(--encre-douce);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- */
/*  Barre d'outils d'une liste                                       */
/* ---------------------------------------------------------------- */

.outils {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
}
.outils .champ { flex: 1 1 200px; margin: 0; }

@media (max-width: 640px) {
  .segments { width: 100%; }
  .segments label { flex: 1; }
  .segments span { text-align: center; padding: 11px 8px; }
}

/* ---------------------------------------------------------------- */
/*  Écran de connexion                                               */
/* ---------------------------------------------------------------- */

.page-connexion {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--vert);
}

.connexion {
  max-width: 420px;
  width: 100%;
  padding: 28px 20px;
  text-align: center;
}

.connexion__logo {
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background: var(--creme);
  object-fit: contain;
  margin-bottom: 20px;
}

.connexion__titre {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--creme);
  margin: 0 0 4px;
}

.connexion__soustitre {
  font-size: 13.5px;
  color: rgba(242, 235, 217, .65);
  margin: 0 0 26px;
}

.connexion__carte {
  text-align: left;
  margin-bottom: 20px;
}

/* Le « ou » posé sur un filet, pour séparer les deux moyens sans
   donner l'impression que l'un est de second rang. */
.connexion__ou {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--encre-douce);
  font-size: 13px;
}
.connexion__ou::before,
.connexion__ou::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--trait);
}

.connexion__pied {
  font-size: 12.5px;
  color: rgba(242, 235, 217, .45);
  margin: 0;
}

.page-connexion .message {
  text-align: left;
}

/* ---------------------------------------------------------------- */
/*  Mon compte                                                       */
/* ---------------------------------------------------------------- */

.appareil {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--trait);
}
.appareil:last-child { border-bottom: none; }

.bouton--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--trait);
  font-size: 13.5px;
  padding: 7px 14px;
}
.bouton--danger:hover { background: #FBEDED; }

@media (max-width: 640px) {
  .connexion__logo { width: 124px; height: 124px; margin-bottom: 16px; }
  .connexion__titre { font-size: 25px; }
}

/* Écran bas : le formulaire doit rester visible sans faire défiler. */
@media (max-height: 720px) {
  .connexion__logo { width: 104px; height: 104px; margin-bottom: 12px; }
  .connexion { padding-top: 16px; padding-bottom: 16px; }
  .connexion__soustitre { margin-bottom: 18px; }
}

/* ---------------------------------------------------------------- */
/*  Choix des colonnes à l'export                                    */
/* ---------------------------------------------------------------- */

.preselections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.bouton--petit {
  font-size: 13.5px;
  padding: 7px 14px;
}

.colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 22px;
  padding: 18px;
  background: var(--creme-clair);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
}

.groupe-colonnes__titre {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--encre-douce);
  margin-bottom: 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--trait);
}

.case {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 14px;
}

.case input {
  width: 17px;
  height: 17px;
  accent-color: var(--vert);
  flex: none;
  margin: 0;
}

.case span { overflow-wrap: anywhere; }
.case:hover span { color: var(--vert); }

.bouton--inactif {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: auto;
}
