/* Gym Hyperactif — feuille de style unique (pas de compilation : servie telle quelle).
   Mobile d'abord (390 px), colonne centrée sur grand écran. Reprend la maquette (maquette/index.html). */
/* Polices hébergées localement (Loi 25 : aucun appel à Google Fonts). Licences OFL dans public/fonts/. */
@font-face { font-family: "Quantico"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/quantico-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Quantico"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/quantico-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); }

:root {
  --green: #52ce05;
  --green-dim: rgba(82, 206, 5, .14);
  --bg: #0b0b0b;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --line: #2a2a2a;
  --text: #f3f3f3;
  --muted: #a3a3a3;
  --violet: #b06bff;
  --red: #ff4d5e;
  --amber: #ffb020;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Inter", system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.45; }
a { color: var(--green); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.q, h1, h2 { font-family: "Quantico", sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: rgba(11, 11, 11, .94); backdrop-filter: blur(8px); }
.topbar .icon { width: 30px; height: 30px; flex-shrink: 0; }
.topbar .t { flex: 1; min-width: 0; }
.topbar .t small { display: block; color: var(--muted); font-size: 12px; }
/* Titre : jusqu'à 2 lignes plutôt que coupé (« Séance du jour » doit tenir à 360 px). */
.topbar .t b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.topbar form { display: contents; }
/* Zones tactiles d'au moins 44 x 44 px (usage au gym). */
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.chip:hover { color: var(--text); border-color: #444; }
.chip svg { width: 20px; height: 20px; }

@media (max-width: 380px) {
  .topbar { gap: 8px; padding: 12px; }
  .topbar .t b { font-size: 15px; }
}

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }

/* ---------- Pages invité (connexion) ---------- */
.guest { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.guest .logo { width: 220px; height: auto; max-width: 70%; margin-bottom: 28px; }
.card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 18px; }
.card h1 { font-size: 20px; margin-bottom: 6px; }
.card p.intro { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input[type=email], .field input[type=password], .field input[type=text] {
  width: 100%; min-height: 48px; padding: 12px 14px; font-size: 16px; /* 16px : pas de zoom auto sur iPhone */
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.field input:focus { border-color: var(--green); outline: none; }
.help-line { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.pw-toggle { margin-bottom: 12px; min-height: 44px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.error { color: var(--red); font-size: 13px; margin-top: 6px; }
.status { background: var(--green-dim); color: var(--green); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.links { margin-top: 16px; text-align: center; font-size: 14px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.lang-guest { margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none; }
.btn.g { background: var(--green); color: #000; }
.btn.g:hover { filter: brightness(1.08); }
.btn.full { width: 100%; }

/* ---------- Tableau de bord coach ---------- */
.page-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.page-h h1 { font-size: 20px; }
.clients { list-style: none; display: grid; gap: 10px; }
.client { display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 72px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; }
.client:hover { border-color: #3a3a3a; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); border: 2px solid var(--green); font-family: Quantico, sans-serif; font-weight: 700; font-size: 15px; }
.client .n { flex: 1; min-width: 0; }
.client .n b { display: block; font-size: 15px; }
.client .n small { display: block; color: var(--muted); font-size: 13px; }
.client .chev { color: var(--muted); font-size: 20px; }
.client .badge { display: inline-block; margin-top: 6px; }
.badge { background: #c81e2f; color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 8px; white-space: nowrap; }
/* Pages d'erreur */
.error-card { text-align: center; }
.error-code { font-size: 44px; font-weight: 700; color: var(--green); line-height: 1; margin-bottom: 10px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }

/* ---------- Séance ---------- */
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: none; margin-bottom: 4px; }
.week-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 12px; }
.week-h h1 { font-size: 18px; }
.daypick { display: flex; gap: 8px; margin-bottom: 14px; }
.daypick a { flex: 1; min-height: 56px; padding: 8px 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; text-decoration: none; }
.daypick a b { display: block; font-size: 15px; color: var(--text); }
.daypick a[aria-current="page"] { border-color: var(--green); background: var(--green-dim); }
.daypick a.done b::after { content: " ✓"; color: var(--green); }
.info { font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.warmup { font-size: 14px; color: var(--muted); margin: 0 2px 12px; }

.pill { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.g { background: var(--green-dim); color: var(--green); }
.pill.a { background: rgba(255, 176, 32, .12); color: var(--amber); }

.block { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 14px; overflow: hidden; }
.block-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; }
.block-h .letter { width: 30px; height: 30px; border-radius: 9px; background: var(--green); color: #000; display: grid; place-items: center; font-family: Quantico, sans-serif; font-weight: 700; flex-shrink: 0; }
.block-h .bt { flex: 1; min-width: 0; }
.block-h .bt h2 { font-size: 15px; letter-spacing: .02em; }
.block-h .bt small { color: var(--muted); font-size: 12px; }
.ex { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-top: 1px solid var(--line); }
.ex .n { flex: 1; min-width: 0; }
.ex .n b { font-size: 15px; overflow-wrap: anywhere; }
.ex .n small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.ex .cn { font-size: 13px; font-style: italic; color: #cfcfcf; margin-top: 6px; }
.ex .req { font-size: 13px; color: var(--red); margin-top: 6px; }
/* Valeurs saisies par l'athlète (reps / temps / poids d'un exercice), aussi sur la page coach (sans client.css). */
/* Valeurs reps / temps / poids d'un exercice (partials/exercise-values) : UN carré vert, mêmes mesures qu'une série
   consignée (.set.done de client.css), sur la largeur d'une colonne de la grille des séries. Commun athlète et coach
   (coach.css ne charge pas client.css) ; sélecteurs à 2 classes pour passer devant « .ex .n small / b ». */
.ex-vals { margin-top: 10px; }
/* Coach (partials/program-day) : le carré est un enfant direct de la carte .ex (rangée flex) -> ligne entière sous le texte et ▶. */
.ex > .ex-vals { flex: 0 0 100%; margin-top: 0; }
.ex:has(> .ex-vals) { flex-wrap: wrap; }
.ex-vals .ex-vals-who { display: block; margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.ex-vals .ex-vals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ex-vals .ex-val { position: relative; display: grid; align-content: center; justify-items: center; min-width: 0; min-height: 56px; padding: 8px 2px;
  border-radius: 12px; border: 1.5px solid var(--green); background: var(--green-dim); text-align: center; }
.ex-vals .ex-val small { display: block; margin: 0; font-size: 12px; color: var(--muted); }
.ex-vals .ex-val b { display: block; font-size: 15px; font-weight: 700; color: var(--green); white-space: nowrap; overflow-wrap: normal; }
.ex-vals .ex-val b.long { font-size: 13px; }
.ex-vals .ex-val b.xlong { font-size: 11px; letter-spacing: -.01em; white-space: normal; line-height: 1.2; }
.ex-vals .ex-val .ld { margin-top: 1px; font-size: 12px; font-weight: 700; color: var(--green); white-space: nowrap; }
/* Petites lignes longues : même réduction que la valeur ; au-delà de 8 caractères, « lb » peut passer à la ligne. */
.ex-vals .ex-val .ld.long { font-size: 11px; }
.ex-vals .ex-val .ld.xlong { font-size: 10.5px; letter-spacing: -.01em; white-space: normal; line-height: 1.2; }
.ex-vals .ex-val > * { max-width: 100%; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #555; vertical-align: middle; margin-right: 4px; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; color: var(--muted); text-decoration: none; }
.play:hover { color: var(--green); border-color: var(--green); }
.note { margin: 4px 14px 14px; padding: 10px 12px; border-left: 3px solid var(--green); background: var(--surface-2); border-radius: 8px; font-size: 13px; font-style: italic; color: #cfcfcf; }
.note b { font-style: normal; color: var(--green); }
.block .req { margin: 0 14px 14px; font-size: 13px; color: var(--red); }

/* ---------- Composants communs coach + client (menu du bas, bandeaux d'erreur, bouton contour) ---------- */
/* L'attribut hidden doit l'emporter sur les display: flex / grid (champs masqués des formulaires et feuilles). */
[hidden] { display: none !important; }
/* Résumé d'un bloc (partials/block-summary) : « 10-12 rounds », « repos 2 min », « RPE 8/10 » jamais coupés. */
.bs-nw { white-space: nowrap; }
.btn.o { border: 1px solid var(--line); background: transparent; color: var(--text); }
.btn.o:hover { border-color: #555; }
/* Bandeau d'erreur : .errors (client, liste) et .alert (coach, message seul). */
.errors, .alert { background: rgba(255, 77, 94, .1); border: 1px solid var(--red); color: #ffd0d5; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.errors ul { margin: 4px 0 0 18px; }
/* Menu du bas : .ctabs (client) et .tabs (coach). */
body:has(.ctabs, .tabs) .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.ctabs, .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; gap: 4px; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(14, 14, 14, .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.ctabs a, .tabs a { flex: 1; max-width: 180px; min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 10px; }
.ctabs a svg, .tabs a svg { width: 22px; height: 22px; }
.ctabs a[aria-current="page"], .tabs a[aria-current="page"] { color: var(--green); }
.ctabs a:hover, .tabs a:hover { color: var(--text); }

@media (min-width: 720px) {
  .wrap { padding-top: 24px; }
  .page-h h1 { font-size: 24px; }
}

/* ---------- Messages : badge des non-lus sur l'onglet « Messages » du menu du bas (le reste : messages.css) ---------- */
.ctabs a.has-badge, .tabs a.has-badge { position: relative; }
.tab-badge { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 18px; height: 19px; padding: 0 5px; border-radius: 99px; background: #c81e2f; color: #fff; font-size: 12px; font-weight: 700; line-height: 19px; text-align: center; }
/* ---------- fin Messages ---------- */

/* Navigation de semaines (athlète /seance et fiche athlète coach, partials/week-nav) : titre centré HORS du <nav>,
   flèches de 48 px superposées de chaque côté (le <nav> ne contient que les flèches). */
.weeknav { position: relative; margin: 2px 0 12px; }
.weeknav .wk-mid { min-height: 48px; padding: 0 56px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.weeknav .wk-mid h1, .weeknav .wk-mid h2 { font-size: 18px; }
.weeknav .wk-mid small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.weeknav .wk-arrows { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.weeknav .wk-arrow { pointer-events: auto; flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 26px; line-height: 1; text-decoration: none; }
.weeknav a.wk-arrow:hover, .weeknav a.wk-arrow:focus-visible { border-color: var(--green); color: var(--green); }
.weeknav .wk-arrow.off { opacity: .35; }
.wk-st { font-weight: 700; }
.wk-st.current { color: var(--green); }
.wk-st.future { color: var(--violet); }
.wk-title { margin: -4px 0 12px; text-align: center; }
.wk-ro a { display: flex; width: fit-content; align-items: center; min-height: 44px; margin-bottom: -8px; color: var(--green); font-weight: 600; }
