:root {
  --ink: #090b18;
  --navy: #111c3d;
  --navy-2: #182651;
  --line-dark: #26325a;
  --blue: #146afb;
  --blue-dark: #0b4fc4;
  --blue-soft: #eaf1ff;
  --bg: #f4f5f8;
  --line: #e4e7ef;
  --muted: #5a6280;
  --muted-dark: #b9c1d9;
  --warn: #a3480f;
  --shadow: 0 1px 2px rgba(9, 11, 24, .04), 0 8px 24px rgba(9, 11, 24, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Figtree, system-ui, sans-serif; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: Saira, system-ui, sans-serif; margin: 0; letter-spacing: -.01em; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
@media (min-width: 560px) { body { background: #e9ebf1; } .app { box-shadow: 0 0 60px rgba(9, 11, 24, .08); } }
.dark { background: var(--ink); color: #fff; }

/* Marque */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .logo { width: 34px; height: auto; display: block; }
.wordmark { font: 600 16px/1.1 Saira, sans-serif; white-space: nowrap; }
.wordmark b { font-weight: 600; color: var(--blue); }
.dark .wordmark b, .login .wordmark b { color: #6fa1ff; }
.eyebrow { font: 600 12px Saira, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--blue); margin: 0; }
.dark .eyebrow { color: #8db4ff; }

/* Boutons et champs */
.btn { height: 54px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font-weight: 600; font-size: 16px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background .15s, transform .1s; }
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn:active { transform: scale(.98); }
.btn.ink { background: var(--ink); }
.btn.white { background: #fff; color: var(--ink); }
.btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .28); color: #fff; }
.btn.outline { background: #fff; border: 1px solid var(--ink); color: var(--ink); }
.btn.small { height: 44px; font-size: 14px; border-radius: 12px; }
.btn.danger { background: #fff; border: 1px solid var(--warn); color: var(--warn); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; }
.input { height: 54px; border-radius: 14px; padding: 0 16px; font-size: 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); width: 100%; }
.dark .input, .login .input { border-color: rgba(255, 255, 255, .22); background: rgba(9, 11, 24, .55); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.login .input::placeholder { color: #8d97b5; }
textarea.input { height: auto; min-height: 90px; padding: 12px 16px; }

.lang { display: flex; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; color: #c9d0e4; padding: 8px 13px; min-height: 36px; font-size: 13px; font-weight: 600; }
.lang button[aria-pressed="true"] { background: #fff; color: var(--ink); }

.card { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.msg { font-size: 14px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: var(--ink); margin: 0; line-height: 1.45; }
.msg.err { background: #fdeee6; color: var(--warn); }

/* Connexion */
.login { flex: 1; position: relative; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: calc(env(safe-area-inset-top) + 22px) 22px calc(env(safe-area-inset-bottom) + 26px); background: var(--ink) url(img/login.webp) var(--photo-pos, 43% 0) / var(--photo-size, auto 60%) no-repeat; }
.login::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 11, 24, .55) 0%, rgba(9, 11, 24, .25) 28%, rgba(9, 11, 24, .88) 58%, #090b18 78%); }
.login > * { position: relative; }
.login h1 { font-size: 40px; line-height: 1.02; font-weight: 700; }
.login p.lead { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted-dark); }

.login.psy-on { background: #07080d; }
.login.psy-on { isolation: isolate; }
.login .psy { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; display: block; }
.login.psy-on::before { background: linear-gradient(180deg, rgba(7, 8, 13, .3) 0%, rgba(7, 8, 13, 0) 14%, rgba(7, 8, 13, 0) 30%, rgba(7, 8, 13, .72) 44%, rgba(7, 8, 13, .94) 60%, #07080d 74%); }

/* Accueil */
.hero { padding: calc(env(safe-area-inset-top) + 20px) 22px 28px; border-radius: 0 0 28px 28px; }
.ring { width: 76px; height: 76px; flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bgc { stroke: var(--line-dark); }
.ring .fg { stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset .5s; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font: 700 18px Saira, sans-serif; fill: #fff; }
.today { background: var(--navy); border: 1px solid var(--line-dark); border-radius: 20px; padding: 16px 18px; display: flex; align-items: center; gap: 16px; }

.section { padding: 26px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.exo { display: flex; align-items: center; gap: 14px; background: #fff; border: 0; border-radius: 18px; padding: 14px 16px; text-align: left; color: var(--ink); width: 100%; box-shadow: var(--shadow); transition: transform .1s; }
.exo:active { transform: scale(.985); }
.exo .num { font: 700 22px Saira, sans-serif; color: var(--blue); width: 30px; flex-shrink: 0; }
.exo.is-done .num { color: #b4bcd2; }
.exo.is-done .name { color: var(--muted); }
.exo .name { font-weight: 600; font-size: 16px; }
.play { width: 40px; height: 40px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.play.on { background: var(--blue); }
.note { border-left: 3px solid var(--blue); }
.appt { background: var(--navy); color: #fff; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; padding: 26px 18px calc(env(safe-area-inset-bottom) + 28px); font-size: 14px; }
.foot a, .foot button { color: var(--muted); background: none; border: 0; padding: 10px 4px; text-decoration: none; }

/* Exercice */
.video { background: var(--ink); width: 100%; aspect-ratio: 4 / 5; max-height: 62vh; display: flex; align-items: center; justify-content: center; position: relative; }
.video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.back { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 14px; width: 44px; height: 44px; border-radius: 999px; border: 0; background: rgba(9, 11, 24, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2; }
.sheet { background: var(--bg); border-radius: 24px 24px 0 0; margin-top: -22px; position: relative; padding: 24px 18px calc(env(safe-area-inset-bottom) + 28px); display: flex; flex-direction: column; gap: 18px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; font-size: 14px; }
.pain { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.pain button { height: 44px; border-radius: 10px; border: 0; background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); padding: 0; }
.pain button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.pain-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
@media (max-width: 360px) { .pain { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

/* ---------- Panneau coach ---------- */
.coach { display: flex; flex-wrap: wrap; min-height: 100vh; }
.coach nav { flex: 1 1 220px; background: var(--ink); color: #fff; padding: 24px 18px; display: flex; flex-direction: column; gap: 24px; }
.coach nav .links { display: flex; flex-direction: column; gap: 4px; }
.coach nav .links button, .coach nav .links a { background: none; border: 0; color: var(--muted-dark); text-align: left; padding: 12px 14px; border-radius: 10px; text-decoration: none; font-size: 15px; }
.coach nav .links [aria-current="page"] { background: var(--navy); color: #fff; font-weight: 600; }
.coach main { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.list { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; flex: 1 1 280px; }
.list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; background: #fff; border: 0; border-top: 1px solid var(--line); padding: 14px 18px; text-align: left; color: var(--ink); }
.list button:first-child { border-top: 0; }
.list button[aria-current="true"] { background: #eef3ff; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.bars div { flex: 1; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars div.none { background: var(--line); }
.stack { display: flex; flex-direction: column; gap: 12px; }
dialog { border: 0; border-radius: 16px; padding: 24px; width: min(520px, 92vw); }
dialog::backdrop { background: rgba(9, 11, 24, .5); }
