/* ==================================================================
   AMA V2 — STYLE UNIQUE (couleurs de l'espace Animateur)
   ================================================================== */
:root {
  --vert: #0F5A3C;  --vert2: #0A3F2A;  --vertpale: #E2EEE6;
  --or: #D99A2B;    --or2: #B47E1E;
  --creme: #F6EFE3; --papier: #FFFDF8; --encre: #22242B;
  --gris: #6F6B5C;  --trait: #E4DCC8;  --rouge: #B3402A;
  --titre: "Fraunces", Georgia, "Times New Roman", serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--texte); font-size: 16px; line-height: 1.45;
  color: var(--encre); background: var(--creme);
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Le bandeau tissé : la signature visuelle AMA, sous chaque en-tête */
.tisse {
  height: 6px;
  background:
    repeating-linear-gradient(90deg, var(--or) 0 10px, var(--vert2) 10px 14px,
      var(--creme) 14px 18px, var(--vert2) 18px 22px);
}

/* ------------------------------------------------------------------
   CONNEXION
   ------------------------------------------------------------------ */
.page-connexion { min-height: 100%; display: flex; flex-direction: column; }
.page-connexion header {
  background: var(--vert); color: var(--papier);
  padding: calc(28px + var(--haut)) 24px 26px;
}
.page-connexion h1 { font-family: var(--titre); font-weight: 900; font-size: 2rem; line-height: 1.1; margin: 0; }
.page-connexion header p { margin: 6px 0 0; color: #CFE3D6; }
.carte-connexion {
  width: 100%; max-width: 420px; margin: 28px auto; padding: 0 20px 40px;
}
.carte-connexion h2 { font-family: var(--titre); font-size: 1.35rem; margin: 0 0 4px; }
.carte-connexion .aide { color: var(--gris); margin: 0 0 20px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 14px 14px; font-size: 1.05rem;
  border: 2px solid var(--trait); border-radius: 12px; background: var(--papier);
}
input:focus { border-color: var(--vert); outline: none; }
.bouton {
  display: block; width: 100%; margin-top: 22px; padding: 15px;
  border: 0; border-radius: 12px; background: var(--vert); color: var(--papier);
  font-weight: 700; font-size: 1.05rem;
}
.bouton:disabled { opacity: .6; }
.lien {
  background: none; border: 0; padding: 8px 0; color: var(--vert);
  text-decoration: underline; text-underline-offset: 3px;
}
.message { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; display: none; }
.message.on { display: block; }
.message.ko { background: #F7E3DE; color: var(--rouge); }
.message.ok { background: var(--vertpale); color: var(--vert2); }
.cache { display: none !important; }
[hidden] { display: none !important; }
.pied-connexion { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--trait); text-align: center; }

/* ------------------------------------------------------------------
   SALLE : deux vues (liste / conversation). Sur grand écran, côte à côte.
   ------------------------------------------------------------------ */
.salle { height: 100%; display: flex; }
.vue { height: 100%; display: flex; flex-direction: column; width: 100%; min-width: 0; }
.vue-conv { display: none; }
body.conv-ouverte .vue-liste { display: none; }
body.conv-ouverte .vue-conv { display: flex; }
@media (min-width: 900px) {
  .vue-liste { width: 360px; flex: none; border-right: 1px solid var(--trait); display: flex !important; }
  .vue-conv { display: flex; }
}

.entete {
  background: var(--vert); color: var(--papier);
  padding: calc(12px + var(--haut)) 14px 12px;
  display: flex; align-items: center; gap: 12px; min-height: 60px;
}
.entete h1 { font-family: var(--titre); font-size: 1.3rem; font-weight: 900; margin: 0; }
.entete .qui { font-size: .85rem; color: #CFE3D6; }
.entete .espace { flex: 1; min-width: 0; }
.entete button, .bouton-entete {
  background: rgba(255,255,255,.12); border: 0; color: var(--papier);
  border-radius: 10px; padding: 8px 12px; text-decoration: none;
}
.retour { font-size: 1.3rem; line-height: 1; padding: 6px 10px !important; }
@media (min-width: 900px) { .retour { display: none; } }
.titre-conv { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sous-titre-conv { font-size: .85rem; color: #CFE3D6; }

/* Liste des salons */
.liste { flex: 1; overflow-y: auto; background: var(--papier); padding-bottom: var(--bas); }
/* Titres de section : bien visibles (bandeau vert, liseré or) */
.groupe {
  margin: 18px 12px 8px; padding: 11px 14px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--vert), var(--vert2)); color: #fff;
  border-left: 6px solid var(--or); border-radius: 12px; box-shadow: 0 3px 10px rgba(10, 63, 42, .18);
  font-family: var(--titre); font-weight: 900; font-size: 1.12rem; letter-spacing: .03em; text-transform: uppercase;
}
.groupe .ic { font-size: 1.15rem; }
.groupe:first-child { margin-top: 12px; }
/* Titre d'une formation, au-dessus de ses tuiles Cours / Discussion */
.formation {
  margin: 14px 14px 4px; padding: 0 2px 5px; font-weight: 800; font-size: 1.02rem; color: var(--vert);
  display: flex; gap: 8px; align-items: center; border-bottom: 2px solid var(--or);
}
/* Deux tuiles côte à côte */
.rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 12px 4px; }
.rangee:has(> :only-child) { grid-template-columns: 1fr; }
.salon.tuile {
  position: relative; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 10px 10px 9px; border: 1px solid var(--trait); border-radius: 14px; background: #fff;
  min-width: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.salon.tuile.dedans { padding-left: 10px; }
.salon.tuile.actif { background: var(--vertpale); border-color: var(--vert); }
.salon.tuile .pastille { width: 34px; height: 34px; font-size: 1.05rem; }
.salon.tuile .corps { width: 100%; }
.salon.tuile .nom { font-weight: 700; }
.salon.tuile .apercu { font-size: .8rem; }
.salon.tuile .droite { position: absolute; top: 8px; right: 8px; font-size: .7rem; }
.salon {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--trait);
  padding: 11px 16px;
}
.salon.dedans { padding-left: 34px; }
.salon.actif { background: var(--vertpale); }
.pastille {
  width: 42px; height: 42px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem; background: var(--creme);
}
.salon .corps { flex: 1; min-width: 0; }
.salon .nom { font-weight: 600; }
.salon .apercu { color: var(--gris); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salon .droite { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .78rem; color: var(--gris); }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--or); color: var(--encre); font-weight: 800; font-size: .78rem;
  display: grid; place-items: center;
}
.vide { padding: 28px 20px; color: var(--gris); }

/* Conversation */
.fil {
  flex: 1; overflow-y: auto; padding: 12px 10px 16px; position: relative;
  background-color: var(--creme);
  background-image: radial-gradient(rgba(15,90,60,.07) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
}
.plus-anciens { display: block; margin: 4px auto 12px; background: var(--papier); border: 1px solid var(--trait); border-radius: 999px; padding: 6px 14px; font-size: .88rem; }
.jour-sep { text-align: center; margin: 14px 0 8px; }
.jour-sep span { background: var(--papier); border: 1px solid var(--trait); border-radius: 999px; padding: 3px 12px; font-size: .8rem; color: var(--gris); }
.msg { display: flex; gap: 8px; margin: 3px 0; align-items: flex-end; max-width: 100%; }
.msg.moi { justify-content: flex-end; }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--papier); font-weight: 700; font-size: .8rem;
  background-size: cover; background-position: center;
}
.bulle {
  max-width: min(78%, 560px); background: var(--papier); border-radius: 4px 14px 14px 14px;
  padding: 7px 11px 5px; box-shadow: 0 1px 0 var(--trait);
}
.msg.moi .bulle { background: var(--vertpale); border-radius: 14px 4px 14px 14px; }
.msg.suite .avatar { visibility: hidden; }
.msg.suite .auteur { display: none; }
.auteur { font-weight: 700; font-size: .85rem; margin-bottom: 1px; }
.texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { display: flex; justify-content: flex-end; gap: 8px; font-size: .72rem; color: var(--gris); margin-top: 2px; }
.meta .suppr { background: none; border: 0; color: var(--rouge); padding: 0; font-size: .72rem; text-decoration: underline; }
.meta .repondre { background: none; border: 0; color: var(--vert); padding: 0; font-size: .78rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; margin-right: auto; }
.msg.masque .bulle { opacity: .55; border: 1px dashed var(--gris); }
.etiquette-masque { font-size: .78rem; font-weight: 700; color: var(--gris); margin-bottom: 2px; }
.msg.echec .bulle { outline: 2px solid var(--rouge); }

/* Zone de saisie */
.saisie {
  display: flex; gap: 8px; align-items: flex-end; background: var(--papier);
  border-top: 1px solid var(--trait); padding: 8px 10px calc(8px + var(--bas));
}
.saisie textarea {
  flex: 1; resize: none; max-height: 140px; min-height: 44px; padding: 11px 14px;
  border: 2px solid var(--trait); border-radius: 22px; background: var(--papier); line-height: 1.35;
}
.saisie textarea:focus { border-color: var(--vert); outline: none; }
.envoyer {
  width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%;
  background: var(--vert); color: var(--papier); font-size: 1.2rem;
}
.lecture-seule { background: var(--papier); border-top: 1px solid var(--trait); padding: 14px 16px calc(14px + var(--bas)); color: var(--gris); text-align: center; font-size: .92rem; }
.accueil-conv { flex: 1; display: grid; place-items: center; color: var(--gris); padding: 24px; text-align: center; }
.etat-reseau { background: var(--or); color: var(--encre); text-align: center; font-size: .82rem; padding: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + var(--bas)); transform: translateX(-50%) translateY(20px);
  background: var(--encre); color: var(--papier); padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; z-index: 10;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------------
   ESPACE ADMIN : inscrire et gérer les élèves
   ------------------------------------------------------------------ */
.page-admin { min-height: 100%; background: var(--creme); }
.admin-corps { max-width: 760px; margin: 0 auto; padding: 16px 14px calc(40px + var(--bas)); }
.panneau { background: var(--papier); border: 1px solid var(--trait); border-radius: 16px; padding: 18px 16px 20px; margin-bottom: 18px; }
.panneau h2 { font-family: var(--titre); font-size: 1.3rem; margin: 0 0 4px; color: var(--vert); }
.panneau .aide { color: var(--gris); margin: 0 0 6px; font-size: .92rem; }
.deux { display: grid; gap: 0 14px; }
@media (min-width: 620px) { .deux { grid-template-columns: 1fr 1fr; } }
input[type=date], input[type=search], select {
  width: 100%; padding: 12px 14px; font-size: 1rem;
  border: 2px solid var(--trait); border-radius: 12px; background: var(--papier);
}
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix label { margin: 0; font-weight: 500; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix span {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 2px solid var(--trait); border-radius: 999px; background: var(--papier); cursor: pointer;
}
.choix input:checked + span { border-color: var(--vert); background: var(--vertpale); font-weight: 700; }
.choix input:focus-visible + span { outline: 3px solid var(--or); outline-offset: 2px; }
.mode-aide { font-size: .85rem; color: var(--gris); margin: 6px 0 0; }
.ligne-code { display: flex; gap: 8px; }
.ligne-code input { flex: 1; }
.petit-bouton {
  border: 2px solid var(--trait); background: var(--papier); border-radius: 10px;
  padding: 8px 12px; font-size: .9rem; white-space: nowrap;
}
.petit-bouton.vert { background: var(--vert); border-color: var(--vert); color: var(--papier); }
.petit-bouton.rouge { color: var(--rouge); }
.partage { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--vertpale); display: none; }
.partage.on { display: block; }
.partage pre { white-space: pre-wrap; font-family: var(--texte); margin: 8px 0 12px; }
.partage .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eleve { border-top: 1px solid var(--trait); padding: 12px 0; }
.eleve:first-of-type { border-top: 0; }
.eleve .tete { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.eleve .nom { font-weight: 700; }
.eleve .details { color: var(--gris); font-size: .88rem; }
.eleve.inactif .nom { text-decoration: line-through; color: var(--gris); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.puce { display: inline-flex; align-items: center; gap: 4px; background: var(--creme); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: .88rem; }
.puce button { border: 0; background: none; line-height: 1; }
.puce .puce-x { color: var(--rouge); font-size: 1rem; padding: 2px 6px; }
.puce .puce-nom { color: var(--encre); padding: 2px 2px; text-align: left; font-size: .88rem; }
.puce .puce-nom small { display: block; color: var(--gris); font-size: .75rem; }
.puce .puce-nom[aria-expanded="true"] { font-weight: 700; }
.puce.attente { background: #FFF4DA; }
.reglage { margin: 4px 0 10px; padding: 12px; border: 1px solid var(--trait); border-radius: 12px; background: var(--creme); }
.reglage .actions { margin: 10px 0 2px; }
.reglage input[type=text] { margin-top: 8px; padding: 10px 12px; font-size: 1rem; }
.reglage .bouton { margin-top: 14px; padding: 12px; }
.eleve .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.eleve .actions select { width: auto; padding: 7px 10px; font-size: .9rem; }
.compteur { color: var(--gris); font-size: .9rem; margin: 10px 0 4px; }

/* ------------------------------------------------------------------
   COURS : jours, modules et médias
   ------------------------------------------------------------------ */
.cours { padding-bottom: 6px; }
.jour-cours { text-align: center; margin: 18px 0 10px; scroll-margin-top: 8px; }
.jour-cours span {
  display: inline-block; background: var(--vert); color: var(--papier);
  border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: .92rem;
}
.module-cours {
  margin: 12px auto 8px; max-width: 560px; background: #FFF4DA; color: #5A4210;
  border-left: 4px solid var(--or); border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: .92rem;
}
.cours-msg .bulle { max-width: min(88%, 560px); }
.media-img { display: block; max-width: 100%; max-height: 420px; border-radius: 8px; cursor: zoom-in; background: var(--creme); }
.media-audio { display: block; width: 280px; max-width: 100%; }
.media-video { display: block; width: 100%; max-height: 420px; border-radius: 8px; background: #000; }
.media-img + .texte, .media-audio + .texte, .media-video + .texte, .lien-doc + .texte { margin-top: 6px; }
.lien-doc { display: inline-block; padding: 8px 12px; border-radius: 10px; background: var(--creme); color: var(--vert); font-weight: 600; text-decoration: none; }
.texte a { color: var(--vert); }
.verrou-cours {
  margin: 16px auto; max-width: 440px; text-align: center; background: var(--papier);
  border: 1px dashed var(--or2); border-radius: 12px; padding: 12px 14px; color: var(--encre);
}

/* Séance en direct : messages à venir cachés, « Coach Marcel écrit… », arrivée en douceur */
.a-venir { display: none !important; }
.arrive { animation: arrive .45s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ecrit-cours { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.ecrit-cours .avatar { width: 28px; height: 28px; font-size: .72rem; }
.ecrit-cours .points { background: var(--papier); border-radius: 14px; padding: 9px 12px; display: flex; gap: 4px; box-shadow: 0 1px 0 var(--trait); }
.ecrit-cours .points i { width: 7px; height: 7px; border-radius: 50%; background: var(--gris); animation: point 1.2s infinite; }
.ecrit-cours .points i:nth-child(2) { animation-delay: .2s; }
.ecrit-cours .points i:nth-child(3) { animation-delay: .4s; }
.ecrit-cours span { font-size: .85rem; color: var(--gris); font-style: italic; }
@keyframes point { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .arrive, .ecrit-cours .points i { animation: none; } }
.heure-cours { margin-top: 3px; }

/* Attestation de fin de formation */
.bloc-att {
  margin: 22px auto 14px; max-width: 460px; text-align: center; background: var(--papier);
  border: 2px solid var(--or); border-radius: 16px; padding: 18px 16px; box-shadow: 0 4px 14px rgba(10, 63, 42, .12);
}
.bloc-att .att-icone { font-size: 2.2rem; line-height: 1; }
.bloc-att h3 { font-family: var(--titre); color: var(--vert); margin: 8px 0 6px; font-size: 1.2rem; }
.bloc-att p { margin: 0 0 12px; color: var(--encre); }
.bloc-att .btn-att { display: block; margin-top: 4px; text-decoration: none; text-align: center; box-sizing: border-box; }
.bloc-att .message { text-align: left; }
.att-resultat:empty { display: none; }
.att-apercu { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--trait); margin: 12px 0 10px; }

/* Bulles des jours en haut du cours */
.jours-nav {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px;
  background: var(--papier); border-bottom: 1px solid var(--trait);
  scrollbar-width: none;
}
.jours-nav::-webkit-scrollbar { display: none; }
.jour-bulle {
  flex: none; border: 2px solid var(--vert); background: var(--papier); color: var(--vert);
  border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: .88rem;
}
.jour-bulle.actif { background: var(--vert); color: var(--papier); }
.jour-bulle.ferme { border-color: var(--trait); color: var(--gris); font-weight: 600; }

/* Zone de saisie : pièces jointes et vocal */
.icone-saisie {
  width: 42px; height: 46px; flex: none; border: 0; background: none;
  font-size: 1.35rem; border-radius: 50%;
}
.icone-saisie:hover { background: var(--creme); }
.barre-vocal {
  display: flex; align-items: center; gap: 10px; background: var(--papier);
  border-top: 1px solid var(--trait); padding: 8px 12px calc(8px + var(--bas));
}
.barre-vocal .espace { flex: 1; color: var(--gris); }
.point-rouge { width: 12px; height: 12px; border-radius: 50%; background: var(--rouge); animation: clignote 1s infinite; }
@keyframes clignote { 50% { opacity: .25; } }
#dureeVocal { font-variant-numeric: tabular-nums; font-weight: 700; }
.bulle .media-img, .bulle .media-video, .bulle .media-audio, .bulle .lien-doc { margin-bottom: 4px; }
.msg .bulle > .media-img { max-width: min(100%, 320px); }

/* Options d'un message : ⋮, menu, modification */
.meta { align-items: center; }
.meta .modifie { font-style: italic; }
.plus-msg { background: none; border: 0; color: var(--gris); font-size: 1rem; line-height: 1; padding: 0 2px 0 4px; }
.menu-msg { display: flex; flex-direction: column; margin-top: 6px; border-top: 1px solid var(--trait); padding-top: 4px; }
.menu-msg button { background: none; border: 0; text-align: left; padding: 8px 4px; font-size: .92rem; border-radius: 8px; }
.menu-msg button:hover { background: var(--creme); }
.edition { width: 100%; min-width: 220px; border: 2px solid var(--vert); border-radius: 10px; padding: 8px 10px; resize: vertical; background: var(--papier); }
.actions-edition { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

.detail-erreur { display: block; margin-top: 10px; font-size: .78rem; color: var(--rouge); overflow-wrap: anywhere; }

/* Autres formations : cartes comme sur la page d'accueil */
.carte-formation {
  width: calc(100% - 24px); margin: 6px 12px; display: flex; gap: 12px; align-items: flex-start;
  text-align: left; background: var(--papier); border: 1px solid var(--trait);
  border-left: 5px solid var(--c, var(--vert)); border-radius: 12px; padding: 12px;
}
.carte-formation.actif { background: var(--vertpale); }
.carte-formation .corps { flex: 1; min-width: 0; }
.carte-formation .categorie { font-size: .75rem; font-weight: 700; color: var(--c, var(--vert)); }
.carte-formation .nom { font-weight: 700; margin: 1px 0 3px; }
.carte-formation .description {
  font-size: .86rem; color: var(--gris);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.carte-formation .voir { margin-top: 6px; font-size: .85rem; font-weight: 700; color: var(--vert); text-decoration: underline; text-underline-offset: 3px; }

/* La fiche du site, affichée dans AMA Connect */
.vue-fiche { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; background: #fff; }
.vue-fiche iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.chargement-fiche { position: absolute; inset: 40px 0 auto; text-align: center; color: var(--gris); margin: 0; }
.fiche-externe { display: block; text-align: center; font-size: .82rem; padding: 8px calc(8px + var(--bas)); background: var(--papier); border-top: 1px solid var(--trait); color: var(--vert); }

/* Présence (admin) */
.en-ligne { font-weight: 700; }
.panneau-presence { background: var(--papier); border-bottom: 2px solid var(--vert); padding: 6px 14px 12px; max-height: 55vh; overflow-y: auto; }
.panneau-presence h2 { font-family: var(--titre); font-size: 1rem; color: var(--vert); margin: 10px 0 6px; }
.vide-presence { color: var(--gris); margin: 4px 0; font-size: .92rem; }
.ligne-presence { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--trait); }
.ligne-presence .corps { flex: 1; min-width: 0; }
.ligne-presence .nom { font-weight: 600; }
.ligne-presence .ou { font-size: .84rem; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.point-vert { position: relative; }
.point-vert::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  border-radius: 50%; background: #22A559; border: 2px solid var(--papier);
}

/* Petits écrans : l'en-tête reste sur une ligne */
.entete h1 { white-space: nowrap; }
@media (max-width: 420px) {
  .entete { gap: 8px; }
  .entete h1 { font-size: 1.12rem; }
  .entete button, .bouton-entete { padding: 7px 9px; font-size: .92rem; }
}

/* Import depuis le Google Sheet */
.panneau-pliable > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panneau-pliable > summary::-webkit-details-marker { display: none; }
.panneau-pliable > summary h2 { margin: 0; }
.panneau-pliable > summary::after {
  content: "▾"; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--creme); color: var(--vert); font-size: 1.1rem; transition: transform .2s;
}
.panneau-pliable[open] > summary::after { transform: rotate(180deg); }
.panneau-pliable[open] > summary { margin-bottom: 8px; }
.panneau-pliable:not([open]) { padding-bottom: 18px; }
.compte-titre { font-family: var(--texte); font-size: .9rem; color: var(--gris); font-weight: 600; }
.etapes-import { margin: 12px 0 4px; padding-left: 20px; color: var(--encre); }
.etapes-import li { margin: 4px 0; }
input[type=file] { width: 100%; padding: 10px; border: 2px dashed var(--trait); border-radius: 12px; background: var(--creme); }
.imp-bilan { margin: 14px 0 6px; font-weight: 600; }
.imp-alertes { margin: 8px 0; background: #FFF4DA; border-radius: 10px; padding: 8px 12px; }
.imp-alertes summary { cursor: pointer; font-weight: 700; }
.imp-alertes p { margin: 4px 0; font-size: .88rem; }

/* Bandeau « Installe AMA Connect » */
.bandeau-install {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px calc(10px + var(--bas));
  background: var(--papier); border-top: 3px solid var(--or);
}
.carte-connexion .bandeau-install { margin-top: 22px; border: 1px solid var(--trait); border-top: 3px solid var(--or); border-radius: 12px; }
.bandeau-install img { border-radius: 10px; flex: none; }
.bandeau-install .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .88rem; color: var(--gris); }
.bandeau-install .corps strong { color: var(--encre); font-size: .95rem; }
.fermer-install { background: none; border: 0; font-size: 1.4rem; color: var(--gris); padding: 4px 6px; }

/* Vidéo du cours : ⬇ télécharger · ✕ annuler · ▶ sur le téléphone */
.vid-hl {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: min(100%, 360px); aspect-ratio: 16 / 10; border: 0; border-radius: 10px; color: #fff;
  background: #1c2a24 center / cover no-repeat; overflow: hidden;
}
.vid-hl::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.vid-rond {
  position: relative; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--or) calc(var(--p, 0) * 1%), rgba(255,255,255,.25) 0);
}
.vid-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); font-size: 1.3rem; }
.vid-etat { position: relative; font-size: .85rem; font-weight: 600; background: rgba(0,0,0,.5); padding: 3px 10px; border-radius: 999px; }
.vid-hl.garde .vid-ic { background: var(--vert); }
.vid-joue { width: min(100%, 360px); }
.vid-note { font-size: .78rem; color: var(--vert); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.vid-note.ko { color: var(--rouge); }
.lien-suppr { background: none; border: 0; padding: 0; color: var(--gris); text-decoration: underline; font-size: .78rem; }

.gerer-place { display: block; margin: 18px 12px 24px; background: none; border: 1px dashed var(--trait); border-radius: 10px; padding: 10px; width: calc(100% - 24px); color: var(--gris); font-size: .88rem; }

/* ================= TABLEAU DE BORD DU COACH (coach.html) ================= */
body.page-coach {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; margin: 0; overflow: hidden;
}
.page-coach .entete, .page-coach .tisse { flex: none; }
.coach-message { flex: 1; overflow: auto; padding: 18px 14px; max-width: 640px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.coach-message .bouton { display: inline-block; text-align: center; text-decoration: none; margin-top: 10px; }
.cadre-coach { flex: 1; width: 100%; border: 0; display: block; background: #FBF7EF; }
.cadre-coach.cache, .coach-message.cache { display: none; }
#lienCoach { font-size: 1.05rem; }

/* ================= ANIMATEURS ================= */
.sous-titre-panneau { font-size: 1rem; margin: 18px 0 6px; color: var(--vert); }
.case { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 10px 0; }
.case input { width: auto; margin: 0; }
.badge-type { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--vertpale); color: var(--vert); }
.badge-type.independant { background: #F6E7C8; color: #7A4E00; }
.tuiles-anim { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tuile-anim { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px;
  border: 1px solid var(--trait); border-left: 5px solid var(--or); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.tuile-anim .ic { font-size: 1.6rem; }
.tuile-anim .tx { flex: 1; display: flex; flex-direction: column; }
.tuile-anim small { color: var(--gris); }
.tuile-anim .fl { font-size: 1.4rem; color: var(--gris); }
.bientot { opacity: .85; }
.retour-menu { margin-bottom: 8px; }
.couleurs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.pastille-couleur { margin: 0; cursor: pointer; }
.pastille-couleur input { position: absolute; opacity: 0; pointer-events: none; }
.pastille-couleur span { display: block; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--trait); }
.pastille-couleur input:checked + span { box-shadow: 0 0 0 3px var(--or); }
.pastille-couleur input:focus-visible + span { outline: 3px solid var(--or); outline-offset: 2px; }
.images-id { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.image-id { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px dashed var(--trait); border-radius: 12px; text-align: center; }
.image-id .vignette { width: 100%; height: 70px; display: grid; place-items: center;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 14px 14px; border-radius: 8px; }
.image-id .vignette img { max-width: 100%; max-height: 70px; }
.apercu-att { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.12); margin: 6px 0 10px; display: block; }

/* ================= ATTESTATIONS (étape 2) ================= */
.message.on.att { background: #FFF4DC; color: #7A4E00; }
.modes-att { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-att { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; border: 1px solid var(--trait);
  border-radius: 14px; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.mode-att .ic { font-size: 1.8rem; }
.mode-att small { color: var(--gris); }
.ligne-demande, .part { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 2px; border: 0;
  border-top: 1px solid var(--trait); background: none; font: inherit; color: inherit; text-align: left; }
.ligne-demande { cursor: pointer; }
.ligne-demande:first-child, .part:first-child { border-top: 0; }
.ligne-demande .nm, .part .nm { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.ligne-demande small { color: var(--gris); font-weight: 400; }
.part .idx { width: 26px; height: 26px; border-radius: 50%; background: var(--vertpale); color: var(--vert);
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.etq { font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 0; white-space: nowrap; }
.etq.ok { background: var(--vertpale); color: var(--vert); }
button.etq.ok { background: var(--vert); color: #fff; cursor: pointer; }
.etq.no { background: #F8E1DC; color: var(--rouge); }
.etq.att { background: #FFF4DC; color: #7A4E00; }
.etq.vide { background: #EEE; color: var(--gris); }
.part .sup { border: 0; background: none; color: var(--gris); font-size: 1rem; cursor: pointer; padding: 4px 8px; }
.jauge { color: var(--gris); font-size: .9rem; margin: 6px 0; }
#zoneColler textarea { width: 100%; box-sizing: border-box; }
#lienPdf { text-align: center; text-decoration: none; }
.noms-demande summary { cursor: pointer; color: var(--vert); font-size: .9rem; }
.noms-demande ol { margin: 6px 0 4px 18px; padding: 0; }

/* ================= INSCRIPTIONS PAR LES ANIMATEURS (étape 3) ================= */
.stats-anim { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.stats-anim div { background: var(--vertpale); border-radius: 12px; padding: 12px; text-align: center; }
.stats-anim strong { display: block; font-size: 1.5rem; color: var(--vert); }
.stats-anim span { font-size: .8rem; color: var(--gris); }
.inscrit { border-top: 1px solid var(--trait); padding: 12px 0; }
.inscrit:first-child { border-top: 0; }
.inscrit .tt { display: flex; align-items: flex-start; gap: 10px; }
.inscrit .nm { flex: 1; min-width: 0; }
.inscrit .nm b { display: block; }
.inscrit .nm span { display: block; font-size: .8rem; color: var(--gris); margin-top: 3px; }
.inscrit .px { font-weight: 900; color: var(--vert); white-space: nowrap; }
.inscrit .cod { margin-top: 8px; background: #FFF6E0; border: 1.5px dashed var(--or); border-radius: 9px;
  padding: 8px; text-align: center; font-family: "Courier New", monospace; font-weight: 900; font-size: 1.1rem; color: #0A3F2A; }
.inscrit .bx { display: flex; gap: 7px; margin-top: 9px; }
.inscrit .bx button { flex: 1; border-radius: 10px; padding: 10px; font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; }
.inscrit .bx .bwa { border: 0; background: var(--vert); color: #fff; }
.inscrit .bx .bre { border: 1px solid var(--trait); background: #fff; color: var(--vert); }
.choix input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.choix input[type=checkbox]:checked + span { border-color: var(--vert); background: var(--vertpale); font-weight: 700; }

/* ================= MES ACTIVITÉS (étape 4) ================= */
.mois-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mois-nav h2 { flex: 1; text-align: center; margin: 0; font-size: 1.1rem; }
.mois-nav .petit-bouton { min-width: 42px; font-size: 1.2rem; }
.mois-nav .petit-bouton:disabled { opacity: .35; }
.stats-anim { grid-template-columns: 1fr 1fr; }
.objectif-anim { background: var(--vert2, #0A3F2A); color: #fff; border-radius: 14px; padding: 16px; margin: 12px 0; }
.objectif-anim .h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.objectif-anim .h .l { font-size: .8rem; opacity: .85; }
.objectif-anim .h .v { font-size: 1.5rem; font-weight: 900; }
.objectif-anim .h .v small { font-size: .55em; opacity: .7; font-weight: 700; }
.objectif-anim .rail { height: 9px; border-radius: 20px; background: rgba(255,255,255,.18); margin: 11px 0 8px; overflow: hidden; }
.objectif-anim .rail i { display: block; height: 100%; width: 0; border-radius: 20px; background: linear-gradient(90deg, var(--or), #F0C766); transition: width .3s; }
.objectif-anim .m { font-size: .8rem; opacity: .9; }
.objectif-anim .fixer { width: 100%; margin-top: 11px; border: 1px dashed rgba(255,255,255,.4); background: none; color: #fff;
  border-radius: 10px; padding: 10px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.bilan-anim { font-size: .85rem; color: var(--vert); background: var(--vertpale); border-radius: 10px; padding: 8px 10px; margin: 8px 0 4px; }
.part .nm small { font-weight: 400; color: var(--gris); font-size: .82rem; }

/* ================= RÉACTIONS 👍 ❤️ 👎 ================= */
.reactions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.reaction { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; min-height: 30px;
  border: 1px solid var(--trait); border-radius: 999px; background: rgba(255, 255, 255, .7);
  font: inherit; font-size: .85rem; cursor: pointer; opacity: .75; }
.reaction .e { font-size: 1rem; line-height: 1; }
.reaction .n { font-weight: 700; font-size: .78rem; color: var(--encre); }
.reaction.a { opacity: 1; }
.reaction.moi { opacity: 1; background: var(--vertpale); border-color: var(--vert); }
.reaction:disabled { cursor: default; }
.msg.moi .reactions { justify-content: flex-end; }
