/* ---------- Mise en page ---------- */
.conteneur { max-width: 1300px; margin: 0 auto; padding: 0 1.25rem; }
main.conteneur { padding-top: var(--esp-3); padding-bottom: var(--esp-4); }

.grille { display: grid; gap: var(--esp-3); }
.grille-cartes { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grille-2 { grid-template-columns: 1.5fr 1fr; align-items: start; }
.grille-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (max-width: 860px) { .grille-2 { grid-template-columns: 1fr; } }

.surtitre {
  font-family: var(--font-titre); font-weight: 700; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--vert-texte);
  margin: 0 0 .5rem;
}
.intro { color: var(--texte-doux); max-width: 46rem; }
.retour { display: inline-block; margin-bottom: var(--esp-2); font-weight: 700; }

/* ---------- En-tête ---------- */
.entete { background: var(--blanc); border-bottom: 1px solid var(--bord); }
.entete-interieur {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  max-width: 1300px; margin: 0 auto; padding: .9rem 1.25rem;
}
.logo {
  font-family: var(--font-titre); font-weight: 700; font-size: 1.75rem;
  color: var(--vert-texte); text-decoration: none;
}
.logo small { font-size: .7rem; color: var(--texte-doux); font-weight: 600; margin-left: .5rem; }
.nav { display: flex; gap: .5rem; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: .6rem 1.2rem; border-radius: var(--rayon-pilule); text-decoration: none;
  color: var(--texte); font-family: var(--font-titre); font-weight: 600; font-size: .95rem;
}
.nav a:hover { background: var(--fond); }
.nav a[aria-current="page"] { background: var(--menthe); color: var(--vert-texte); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.5rem; padding: .75rem 1.75rem; border: 0; cursor: pointer;
  border-radius: var(--rayon-pilule); background: var(--turquoise); color: #fff;
  font-family: var(--font-titre); font-weight: 600; font-size: 1.05rem;
  text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--turquoise-fonce); }
.btn-secondaire { background: var(--menthe); color: var(--vert-texte); }
.btn-secondaire:hover { background: #cbe9db; }
.btn-petit { min-height: 3rem; padding: .5rem 1.2rem; font-size: .95rem; }
.btn-danger { background: var(--alerte-fond); color: var(--alerte); }
.btn-danger:hover { background: #f9d6d2; }
.btn-bloc { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--blanc); border-radius: var(--rayon-carte);
  padding: var(--esp-3); box-shadow: var(--ombre);
}
.carte-menthe { background: var(--menthe); box-shadow: none; }
.carte-lien {
  display: block; text-decoration: none; color: inherit;
  border: 3px solid transparent; transition: border-color .15s, transform .15s;
}
.carte-lien:hover { border-color: var(--vert); transform: translateY(-2px); }
.carte h2, .carte h3 { margin-bottom: .75rem; }

.patient-carte { display: flex; flex-direction: column; gap: .6rem; }
.patient-carte-tete { display: flex; align-items: center; gap: 1rem; }
.patient-carte .nom { font-family: var(--font-titre); font-weight: 700; font-size: 1.25rem; margin: 0; }
.patient-carte .meta { margin: 0; color: var(--texte-doux); font-size: 1rem; }
.avatar {
  flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--menthe); color: var(--vert-texte);
  font-family: var(--font-titre); font-weight: 700; font-size: 1.15rem;
}
.avatar-grand { width: 5rem; height: 5rem; font-size: 1.6rem; }

/* ---------- Pastilles ---------- */
.pastille {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .9rem; border-radius: var(--rayon-pilule);
  background: var(--blanc); font-family: var(--font-titre); font-weight: 600; font-size: .9rem;
  border: 1px solid var(--bord);
}
.pastille .point {
  width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.35);
}
.pastille-epaule .point { background: var(--capteur-epaule); }
.pastille-genou .point { background: var(--capteur-genou); }
.pastille-dos .point { background: var(--capteur-dos); }
.pastille-cheville .point { background: var(--capteur-cheville); }
.pastille-cervical .point { background: var(--capteur-cervical); }
.pastille-alerte { background: var(--alerte-fond); color: var(--alerte); border-color: transparent; }
.pastille-attention { background: var(--attention-fond); color: var(--attention); border-color: transparent; }
.pastille-ok { background: var(--menthe); color: var(--vert-texte); border-color: transparent; }

/* ---------- Formulaires ---------- */
label { font-family: var(--font-titre); font-weight: 600; font-size: .95rem; display: block; margin-bottom: .35rem; }
input, select, textarea {
  width: 100%; min-height: 3.25rem; padding: .6rem 1rem; font: inherit;
  border: 2px solid var(--bord); border-radius: var(--rayon-champ);
  background: #fff; color: var(--texte);
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--turquoise); }
.champ { margin-bottom: var(--esp-2); }
.case { display: flex; align-items: center; gap: .75rem; font-family: var(--font-texte); font-weight: 400; font-size: 1rem; }
.case input { width: 1.6rem; height: 1.6rem; min-height: 0; accent-color: var(--turquoise); }
.recherche { max-width: 28rem; margin-bottom: var(--esp-3); }

/* ---------- Statistiques ---------- */
.stat { padding: 1.1rem 1.4rem; }
.stat .valeur { font-family: var(--font-titre); font-weight: 700; font-size: 1.9rem; color: var(--vert-texte); line-height: 1.1; }
.stat .libelle { color: var(--texte-doux); font-size: .95rem; margin: .25rem 0 0; }

/* ---------- Calendrier ---------- */
.cal-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: var(--esp-2); }
.cal-tete h2 { margin: 0; text-transform: capitalize; }
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.cal-nomjour { text-align: center; font-family: var(--font-titre); font-weight: 600; font-size: .8rem; color: var(--texte-doux); padding-bottom: .25rem; }
.jour {
  aspect-ratio: 1 / 1; min-height: 3rem; display: grid; place-items: center;
  border-radius: 16px; font-family: var(--font-titre); font-weight: 600; font-size: 1rem;
  background: var(--fond); color: var(--texte-doux); text-decoration: none; border: 3px solid transparent;
  position: relative;
}
.jour-vide { background: transparent; }
.jour-aujourdhui { border-color: var(--texte); }
.jour-seance { background: var(--vert); color: #10241a; cursor: pointer; }
.jour-seance:hover { background: #3aa877; }
.jour-prevu { background: #fff; border: 3px dashed var(--turquoise); color: var(--turquoise-fonce); }
.jour-seance .alerte-point {
  position: absolute; top: 4px; right: 4px; width: .6rem; height: .6rem; border-radius: 50%; background: var(--alerte);
  border: 2px solid #fff;
}
.legende { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: var(--esp-2); font-size: .95rem; color: var(--texte-doux); }
.legende span { display: inline-flex; align-items: center; gap: .5rem; }
.legende i { width: 1.1rem; height: 1.1rem; border-radius: 6px; display: inline-block; }
.leg-seance { background: var(--vert); }
.leg-prevu { border: 3px dashed var(--turquoise); }
.leg-auj { border: 3px solid var(--texte); }

/* ---------- Séance / exercices ---------- */
.exo-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.mesures { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin: var(--esp-2) 0; }
.mesure { background: var(--fond); border-radius: 16px; padding: .75rem 1rem; }
.mesure b { display: block; font-family: var(--font-titre); font-size: 1.4rem; color: var(--vert-texte); }
.mesure span { font-size: .9rem; color: var(--texte-doux); }
.graphique { position: relative; height: 260px; }
.graphique-haut { height: 320px; }
.pile { display: flex; flex-direction: column; gap: var(--esp-3); }
.nav-seances { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: var(--esp-3); }

/* ---------- Préparation du programme ---------- */
.biblio-item, .prog-item {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  padding: 1rem; border-radius: 18px; background: var(--fond); margin-bottom: .75rem;
}
.biblio-item p { margin: 0; font-size: .95rem; color: var(--texte-doux); }
.biblio-item strong, .prog-item strong { font-family: var(--font-titre); font-weight: 600; }
.prog-item { flex-direction: column; align-items: stretch; background: #fff; border: 2px solid var(--bord); }
.prog-tete { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.prog-actions { display: flex; gap: .4rem; }
.prog-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .75rem; }
.btn-icone { min-height: 2.75rem; min-width: 2.75rem; padding: 0 .8rem; }
.vide { color: var(--texte-doux); text-align: center; padding: var(--esp-3); border: 3px dashed var(--bord); border-radius: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--texte); color: #fff; padding: 1rem 1.75rem; border-radius: var(--rayon-pilule);
  font-family: var(--font-titre); font-weight: 600; z-index: 20;
}

/* ---------- Aide / vidéos ---------- */
.video {
  aspect-ratio: 16 / 9; border-radius: 20px; display: grid; place-items: center; text-align: center;
  background: linear-gradient(135deg, var(--turquoise), var(--vert)); color: #fff; padding: 1rem;
}
.video .lecture {
  width: 4.5rem; height: 4.5rem; border-radius: 50%; background: #fff; color: var(--turquoise);
  display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto .5rem; padding-left: .3rem;
}
.video p { margin: 0; font-family: var(--font-titre); font-weight: 600; }
.video small { opacity: .9; }
details.faq { background: #fff; border-radius: 20px; margin-bottom: .75rem; box-shadow: var(--ombre); }
details.faq summary {
  cursor: pointer; padding: 1.1rem 1.4rem; font-family: var(--font-titre); font-weight: 600; font-size: 1.1rem;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 3.5rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.6rem; color: var(--turquoise); }
details.faq[open] summary::after { content: "–"; }
details.faq .contenu { padding: 0 1.4rem 1.4rem; display: grid; gap: var(--esp-2); }
.transcription { background: var(--fond); border-radius: 16px; padding: .75rem 1rem; font-size: 1rem; }
.transcription summary { cursor: pointer; font-family: var(--font-titre); font-weight: 600; font-size: .95rem; }

.etape { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.etape .num {
  width: 3rem; height: 3rem; border-radius: 50%; background: var(--vert); color: #10241a;
  display: grid; place-items: center; font-family: var(--font-titre); font-weight: 700; font-size: 1.3rem;
}
.etape h3 { margin-top: .5rem; font-size: 1.4rem; }
.etape .grille { margin-top: var(--esp-2); }

/* ---------- Forum ---------- */
.forum-compte { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.forum-compte .champ { flex: 1; min-width: 14rem; margin: 0; }
.forum-outils { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: var(--esp-3); }
.filtres { display: flex; flex-wrap: wrap; gap: .5rem; }
.filtre {
  min-height: 3rem; padding: .4rem 1.1rem; border-radius: var(--rayon-pilule); border: 2px solid var(--bord);
  background: #fff; color: var(--texte); font-family: var(--font-titre); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.filtre[aria-pressed="true"] { background: var(--turquoise); border-color: var(--turquoise); color: #fff; }
.post-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.auteur { display: flex; align-items: center; gap: .8rem; line-height: 1.3; }
.meta-petit { font-size: .85rem; color: var(--texte-doux); }
.post-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.reactions { display: flex; gap: .5rem; }
.reac {
  min-height: 2.75rem; min-width: 4.5rem; padding: .3rem 1rem; border-radius: var(--rayon-pilule);
  border: 2px solid var(--bord); background: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.reac:hover { border-color: var(--vert); }
.reac[aria-pressed="true"] { background: var(--menthe); border-color: var(--vert-texte); color: var(--vert-texte); }
.reac-non[aria-pressed="true"] { background: var(--alerte-fond); border-color: var(--alerte); color: var(--alerte); }
.commentaires { margin-top: var(--esp-2); padding-top: var(--esp-2); border-top: 2px solid var(--fond); }
.commentaire { background: var(--fond); border-radius: 16px; padding: .8rem 1rem; margin-bottom: .75rem; }

/* ---------- Manuel ---------- */
.manuel { display: grid; grid-template-columns: 16rem 1fr; gap: var(--esp-3); align-items: start; }
.sommaire { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding: 1.25rem; }
.sommaire h2 { font-size: 1.05rem; }
.sommaire ol { list-style: none; margin: 0 0 var(--esp-2); padding: 0; }
.sommaire a { display: block; padding: .4rem .6rem; border-radius: 12px; text-decoration: none; color: var(--texte); font-size: .9rem; }
.sommaire a:hover { background: var(--menthe); }
.sommaire .partie { font-family: var(--font-titre); font-weight: 700; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--vert-texte); margin: var(--esp-2) 0 .25rem; }
.manuel-contenu { display: flex; flex-direction: column; gap: var(--esp-3); min-width: 0; }
.manuel-contenu section { scroll-margin-top: 1rem; }
.manuel-contenu h2 { font-size: 1.4rem; }
.manuel-contenu h3 { font-size: 1.05rem; margin-top: var(--esp-2); }
.manuel-contenu ul, .manuel-contenu ol { padding-left: 1.4rem; margin: 0 0 var(--esp-2); }
.manuel-contenu li { margin-bottom: .35rem; }
.manuel-partie { background: var(--turquoise); color: #fff; border-radius: var(--rayon-carte); padding: 1.25rem 1.5rem; }
.manuel-partie h2 { color: #fff; margin: 0; font-size: 1.6rem; }
.manuel-partie p { margin: .35rem 0 0; opacity: .95; }
.encart { background: var(--menthe); border-radius: 16px; padding: 1rem 1.25rem; margin: var(--esp-2) 0; font-size: .95rem; }
.encart-attention { background: var(--attention-fond); color: #4d3200; }
.encart-danger { background: var(--alerte-fond); color: #7a1b12; }
.encart strong:first-child { font-family: var(--font-titre); }
.tableau-conteneur { overflow-x: auto; margin: var(--esp-2) 0; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th, .tableau td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau th { font-family: var(--font-titre); font-weight: 600; background: var(--fond); }
@media (max-width: 900px) {
  .manuel { grid-template-columns: 1fr; }
  .sommaire { position: static; max-height: none; }
}

/* ---------- Mascottes ---------- */
.mascotte { height: auto; flex: none; width: 9rem; }
.page-tete { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.page-tete h1 { margin-bottom: .5rem; }
.illustration-mascotte {
  display: block; height: 15rem; width: auto; max-width: 100%; object-fit: contain;
  background: var(--menthe); border-radius: 20px; padding: 1rem 2rem; margin: var(--esp-2) 0;
}
.hero-mascotte {
  width: min(100%, 26rem); aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  background: var(--menthe); display: grid; place-items: center;
}
.hero-mascotte img { height: 86%; width: auto; max-width: 90%; object-fit: contain; }
.vide-mascotte { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.vide-mascotte p { margin: 0; }
.toast { display: flex; align-items: center; gap: .75rem; }
.toast-mascotte { height: 4.5rem; width: auto; margin: -2rem 0 -.8rem; }
@media (max-width: 640px) { .page-tete .mascotte { width: 5.5rem; } }

/* ---------- Images ---------- */
.illustration { display: block; width: 100%; max-width: 26rem; height: auto; border-radius: 20px; margin: var(--esp-2) 0; }
.vignette { flex: none; width: 4.5rem; height: auto; border-radius: 16px; }
.figure-casque { margin: var(--esp-2) 0; }
.figure-casque img { max-width: 28rem; }
.figure-casque figcaption { font-size: .95rem; color: var(--texte-doux); margin-top: .5rem; }
.zones-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: var(--esp-2); margin: var(--esp-2) 0; }
.zones-figures figure { margin: 0; text-align: center; }
.zones-figures img { width: 100%; max-width: 9rem; height: auto; border-radius: 18px; }
.zones-figures figcaption { margin-top: .4rem; font-family: var(--font-titre); font-weight: 600; font-size: .9rem; }

/* ---------- Connexion ---------- */
.connexion-grille { display: grid; grid-template-columns: 1fr minmax(0, 30rem); gap: 2.5rem; align-items: center; width: 100%; max-width: 75rem; }
.connexion-illu img { width: 100%; max-width: 34rem; height: auto; display: block; margin: 0 auto; }
.connexion-illu p { text-align: center; margin: var(--esp-2) auto 0; }
@media (max-width: 900px) {
  .connexion-grille { grid-template-columns: 1fr; justify-items: center; }
  .connexion-illu { order: 2; }
  .connexion-illu img { max-width: 18rem; }
}
.connexion-page { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.connexion { width: 100%; max-width: 30rem; padding: 2rem; }
.connexion .logo { display: block; font-size: 2.4rem; margin-bottom: 1.25rem; }
.connexion h1 { font-size: 1.8rem; }
.erreur { background: var(--alerte-fond); color: var(--alerte); border-radius: 16px; padding: .75rem 1rem; font-weight: 700; margin-bottom: var(--esp-2); }
.demo-info { margin-top: var(--esp-3); font-size: .9rem; }
.demo-info code { font-family: var(--font-titre); font-weight: 600; background: #fff; padding: .1rem .5rem; border-radius: 8px; }
.connexion-lien { text-align: center; margin: var(--esp-2) 0 0; }
