/* Club Manager — feuille de style unique, sans dépendance externe.
   Palette : bleu nuit, bleu, rouge, or, vert, orange (couleurs du club). */

:root {
  --bleu-nuit: #0b1f33;
  --bleu: #123a5a;
  --rouge: #c8102e;
  --or: #e4b04a;
  --vert: #1e7d46;
  --orange: #c46a00;
  --gris-clair: #f4f6f9;
  --gris: #dfe4ea;
  --texte: #16212e;
  --blanc: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--texte);
  background: var(--gris-clair);
  line-height: 1.45;
}

a { color: var(--bleu); }
h1, h2, h3 { color: var(--bleu-nuit); line-height: 1.2; }
h1 { font-size: 1.55rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

/* ---------- Entête et navigation ---------- */

.entete {
  display: flex;
  align-items: center;
  gap: .6rem 1rem;
  flex-wrap: wrap;
  background: var(--bleu-nuit);
  color: var(--blanc);
  padding: .7rem 1.2rem;
}
.marque { display: flex; align-items: center; gap: .6rem; }
.marque strong { display: block; font-size: 1rem; color: var(--blanc); }
.marque small { display: block; font-size: .72rem; color: var(--or); letter-spacing: .04em; }
.logo {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--rouge); color: var(--blanc);
  font-weight: 700; letter-spacing: .04em;
}
.nav-haut { display: flex; flex-wrap: wrap; gap: .15rem; flex: 1 1 auto; }
.nav-haut a {
  color: #dbe6f1; text-decoration: none; padding: .45rem .6rem;
  border-radius: 8px; font-size: .88rem; white-space: nowrap; padding: .4rem .5rem;
}
.nav-haut a:hover, .nav-haut a:focus-visible { background: var(--bleu); color: var(--blanc); }
.sortie { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.qui { font-size: .8rem; color: #c6d4e2; white-space: nowrap; }

/* Écrans intermédiaires : la navigation passe sous la marque plutôt que de
   comprimer les liens dans une colonne. */
@media (max-width: 1080px) {
  .nav-haut { order: 3; flex: 1 1 100%; }
  .sortie { order: 2; }
}

.contenu { max-width: 1180px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.titre-page { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

/* ---------- Cartes et grilles ---------- */

.carte {
  background: var(--blanc);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(11, 31, 51, .08);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.chiffre { display: flex; flex-direction: column; gap: .15rem; border-left: 5px solid var(--bleu); }
.chiffre .valeur { font-size: 2rem; font-weight: 700; color: var(--bleu-nuit); }
.chiffre .etiquette { font-weight: 600; }
.chiffre .sous { color: #5b6b7c; font-size: .85rem; }
.chiffre.alerte { border-left-color: var(--rouge); }
.alerte .valeur { color: var(--rouge); }
.grille-deux {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1rem;
}
.grille-champs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem;
}
.entete-carte { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.entete-carte h2 { margin: 0; flex: 1; }

/* ---------- Badges, ceintures, statuts ---------- */

.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.badge-vert { background: #e3f4e9; color: #145c33; border: 1px solid #9fd3b3; }
.badge-orange { background: #fdf0dd; color: #8a4a00; border: 1px solid #edc48a; }
.badge-rouge { background: #fde8ea; color: #8d0c20; border: 1px solid #f0a6b1; }
.badge-gris { background: #eef1f5; color: #45525f; border: 1px solid #cfd6de; }
.badge-bleu { background: #e6eef6; color: var(--bleu); border: 1px solid #b6cbe0; }

.ceinture { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; }
.ceinture i {
  display: inline-block; width: 26px; height: 10px; border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, .35);
}
.pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .45rem; }

/* ---------- Tableaux ---------- */

.tableau { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tableau th, .tableau td { padding: .5rem .5rem; text-align: left; border-bottom: 1px solid var(--gris); }
.tableau th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #55657a; }
.tableau tbody tr:hover { background: #f8fafc; }
.cliquable { cursor: pointer; }
.tableau-pointage td { vertical-align: middle; }
.pastilles { display: flex; gap: .3rem; flex-wrap: wrap; }
.pastille-statut {
  border: 1px solid var(--gris); background: var(--blanc); border-radius: 8px;
  padding: .45rem .6rem; font-size: .85rem; min-height: 44px; cursor: pointer;
}
.pastille-statut.actif { color: var(--blanc); border-color: transparent; font-weight: 600; }
.statut-present.actif { background: var(--vert); }
.statut-retard.actif { background: var(--orange); }
.statut-absent.actif { background: var(--rouge); }
.statut-excuse.actif { background: var(--bleu); }

.jauge { background: var(--gris); border-radius: 999px; height: 9px; overflow: hidden; min-width: 80px; }
.jauge span { display: block; height: 100%; background: var(--bleu); }
.jauge-verte span { background: var(--vert); }

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

label { display: block; font-size: .85rem; color: #3d4b5c; margin-bottom: .5rem; }
input, select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--gris);
  border-radius: 8px; font-size: .95rem; font-family: inherit; background: var(--blanc);
  min-height: 40px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--or); outline-offset: 1px;
}
.case { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.case input { width: auto; min-height: 0; }
.ligne-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.ligne-form > * { flex: 1 1 160px; }
.ligne-form.compacte > * { flex: 1 1 90px; }
/* Réinitialisation d'un mot de passe : une ligne par compte, hors tableau. */
.ligne-form.reinit { border-top: 1px solid var(--gris); padding: .55rem 0; margin: 0; }
.ligne-form.reinit .compte { flex: 1 1 100%; font-size: .88rem; font-weight: 600; }
.ligne-form.reinit .compte small { display: block; color: #5b6b7c; font-weight: 400; font-size: .78rem; }
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.filtres > * { flex: 1 1 150px; }

.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: .55rem .9rem;
  background: var(--bleu); color: var(--blanc); font-weight: 600; font-size: .9rem;
  cursor: pointer; text-decoration: none; min-height: 44px; text-align: center;
}
.btn:hover { background: var(--bleu-nuit); }
.btn-clair { background: #e6eef6; color: var(--bleu); }
.btn-clair:hover { background: #d3e1ee; }
.btn-sm { min-height: 36px; padding: .35rem .65rem; font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.actions form { margin: 0; }
.paiement-ligne { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; padding: .2rem 0; }
.paiement-ligne form { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; }
.paiement-ligne input { flex: 1 1 150px; min-width: 0; padding: .3rem .45rem; font-size: .85rem; }
.ligne-detail td { background: #fbfdff; font-size: .88rem; }
.montant { white-space: nowrap; }
.btn-vert { background: var(--vert); }
.btn-orange { background: var(--orange); }
.btn-rouge { background: var(--rouge); }

/* ---------- Messages et alertes ---------- */

.message { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.message-succes { background: #e3f4e9; color: #145c33; border: 1px solid #9fd3b3; }
.message-erreur { background: #fde8ea; color: #8d0c20; border: 1px solid #f0a6b1; }
.message-info { background: #e6eef6; color: var(--bleu); border: 1px solid #b6cbe0; }
.liste-alertes { list-style: none; margin: 0; padding: 0; }
.liste-alertes li { padding: .45rem 0; border-bottom: 1px solid var(--gris); }
.alerte-rouge a { color: var(--rouge); }
.alerte-orange a { color: var(--orange); }

/* ---------- Fiche adhérent ---------- */

.fiche-tete { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.voyants { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.voyant {
  background: var(--blanc); border-radius: 10px; padding: .7rem .9rem;
  border-left: 5px solid var(--gris); display: flex; flex-direction: column;
}
.voyant strong { font-size: 1.05rem; }
.voyant span { font-size: .8rem; color: #5b6b7c; }
.voyant-vert { border-left-color: var(--vert); }
.voyant-orange { border-left-color: var(--orange); }
.voyant-rouge { border-left-color: var(--rouge); }
.voyant-bleu { border-left-color: var(--bleu); }

.definitions { display: grid; grid-template-columns: 45% 55%; gap: .3rem 0; font-size: .9rem; margin: 0; }
.definitions dt { color: #55657a; font-weight: 600; }
.definitions dd { margin: 0; }
.attention { color: var(--rouge); font-weight: 600; }
.liste-cours { margin: .2rem 0 .6rem; padding-left: 1.1rem; }

.sous { color: #5b6b7c; font-size: .85rem; }
.vide { color: #7a8898; font-style: italic; padding: .6rem 0; }
.grand { font-size: 1.2rem; font-weight: 600; margin: .2rem 0; }

/* ---------- Connexion et formulaire public ---------- */

/* Pages publiques : colonne pleine hauteur, pied de page collé en bas de la
   fenêtre (connexion, mot de passe oublié, inscription, remerciement). */
body.page-connexion, body.page-public { min-height: 100vh; display: flex; flex-direction: column; }
.connexion { flex: 1; display: grid; place-items: center; padding: 1.5rem 1rem; }
.connexion .carte { width: min(430px, 100%); }
.connexion h1 { margin-bottom: .2rem; }
.public { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.entete-public { padding: 1rem 0; border-bottom: 3px solid var(--rouge); margin-bottom: 1rem; }
.entete-public h1 { font-size: 1.4rem; }
.entete-public p { color: #55657a; margin: .3rem 0 0; }
.merci { text-align: center; }

/* Marque centrée de la page de connexion : le produit, puis le club. */
.carte-connexion { padding: 1.6rem 1.4rem; }
.marque-connexion { text-align: center; margin-bottom: 1rem; }
.marque-connexion .logo { width: 52px; height: 52px; font-size: 1.25rem; margin: 0 auto .55rem; }
.marque-connexion h1 { font-size: 1.6rem; }
.marque-connexion .club {
  margin: .3rem 0 0; color: var(--rouge); font-weight: 600;
  font-size: .95rem; letter-spacing: .02em;
}
.carte-connexion form { margin-top: .4rem; }
.champ-secret { position: relative; display: block; }
.champ-secret input { padding-right: 6.8rem; }
.btn-voir {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
  min-height: 36px; padding: .25rem .55rem; border: 0; border-radius: 6px;
  background: #e6eef6; color: var(--bleu); font-size: .8rem; font-weight: 600;
  cursor: pointer;
}
.btn-voir:hover { background: #d3e1ee; }
.btn-large { width: 100%; margin-top: .3rem; }
.liens-connexion { text-align: center; font-size: .88rem; margin: .8rem 0 .3rem; }
.carte-connexion .sous { text-align: center; }

/* ---------- Pied de page ---------- */

.pied {
  text-align: center; font-size: .78rem; color: #6b7987;
  padding: 1.2rem; border-top: 1px solid var(--gris);
}
.page-erreur { display: grid; place-items: center; min-height: 100vh; }
.erreur { text-align: center; max-width: 460px; }

/* ---------- Téléphone ---------- */

/* Pointage au doigt sur téléphone : une carte par élève, boutons pleine largeur,
   aucune colonne hors écran. */
@media (max-width: 720px) {
  .tableau-pointage thead { display: none; }
  .tableau-pointage,
  .tableau-pointage tbody { display: block; overflow: visible; white-space: normal; }
  .tableau-pointage tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .35rem .5rem;
    align-items: center;
    border: 1px solid var(--gris);
    border-radius: 10px;
    padding: .6rem .7rem;
    margin-bottom: .6rem;
    white-space: normal;
  }
  .tableau-pointage td { display: block; border: 0; padding: 0; white-space: normal; }
  .tableau-pointage td:nth-child(1) { grid-column: 1; }
  .tableau-pointage td:nth-child(2) { grid-column: 2; text-align: right; font-weight: 600; }
  .tableau-pointage td:nth-child(3) { display: none; }
  .tableau-pointage td.pastilles { grid-column: 1 / -1; display: flex; gap: .35rem; }
  .tableau-pointage td:last-child { grid-column: 1 / -1; }
  .tableau-pointage .pastille-statut { flex: 1; font-size: .8rem; padding: .5rem .2rem; }
  .tableau-pointage input.motif { width: 100%; }
}

@media (max-width: 720px) {
  .entete { padding: .6rem .8rem; }
  .nav-haut { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav-haut a { white-space: nowrap; }
  .sortie { margin-left: auto; }
  .qui { display: none; }
  .contenu { padding: .9rem .7rem 4rem; }
  .grille-deux, .grille-champs { grid-template-columns: 1fr; }
  .tableau { display: block; overflow-x: auto; white-space: nowrap; }
  .btn-sm { min-height: 44px; padding: .5rem .7rem; font-size: .85rem; }
  .paiement-ligne input { flex: 1 1 100%; }
  .definitions { grid-template-columns: 1fr; }
  .definitions dt { margin-top: .4rem; }
}
