/* Portail parent — mêmes couleurs et polices que le site public (site/base.py). */
:root {
  --navy: #0B3A7E; --ink: #13223F; --muted: #4a5878; --orange: #FF7A00; --orange-ink: #b45400;
  --cta: #C65300; --cta-ink: #ffffff;   /* bouton principal : orange foncé, texte blanc lisible (contraste 4,5:1) */
  --bg: #F4F6F9; --surface: #ffffff; --tint: #e6edf8; --line: #dbe3f0;
  --ok: #1f7a46; --ok-bg: #e2f3e8; --err: #b42318; --err-bg: #fde8e6; --warn: #8a5300; --warn-bg: #fff1dc;
  --display: "Archivo", "Arial Narrow", sans-serif; --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --navy: #8fb2ff; --ink: #eef2fa; --muted: #a9b6dc; --orange: #ff8f2e; --orange-ink: #ffb370; --cta: #ff8f2e; --cta-ink: #0A1640;
    --bg: #0a1530; --surface: #111f42; --tint: #1a2b55; --line: #253866;
    --ok: #74d39b; --ok-bg: #12321f; --err: #ff9b8f; --err-bg: #3a1714; --warn: #ffc56b; --warn-bg: #3a2a0c; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
a { color: var(--navy); }
h1, h2 { font-family: var(--display); font-style: italic; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(26px, 6vw, 34px); color: var(--navy); }
h2 { font-size: 24px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 6px 0 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
#main:focus { outline: none; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 22px; }
.brand small { color: var(--muted); font-size: 13px; border-left: 1px solid var(--line); padding-left: 8px; }
.top nav { gap: 16px; font-weight: 600; font-size: 15px; }
.top nav a { text-decoration: none; }

.page { max-width: 760px; margin: 0 auto; padding: 24px 16px 96px; display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } .brand small { display: none; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card.narrow { max-width: 460px; width: 100%; margin: 4vh auto 0; }
.back { font-weight: 600; text-decoration: none; font-size: 15px; align-self: flex-start; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
label.check { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; row-gap: 2px; align-items: start; font-weight: 400; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; }
label.check .hint { grid-column: 2; }
.hint { font-weight: 400; font-size: 13px; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; }
legend { font-weight: 600; font-size: 15px; padding: 0 6px; }
input, select, textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 16px var(--body); border-radius: 12px;
  padding: 11px 18px; min-height: 46px; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--cta); color: var(--cta-ink); }
.btn.primary:hover { filter: brightness(0.95); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.danger { background: var(--err); color: #fff; }
.btn.big { font-size: 17px; min-height: 52px; }
.btn.sm { font-size: 14px; min-height: 38px; padding: 7px 12px; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); text-decoration: underline; cursor: pointer; }

.msg { border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.msg.err { background: var(--err-bg); color: var(--err); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.tag { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--tint); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

/* Accueil */
.child header h2 { color: var(--navy); }
.credits { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 6px 10px; border-radius: 14px; background: var(--tint); color: var(--navy); font-size: 13px; font-weight: 600; }
.credits .n { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 34px; line-height: 1; }
.credits.zero { background: var(--warn-bg); color: var(--warn); }
.credits.sm .n { font-size: 26px; }
/* (anciennes listes) */
.bks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.bk { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.bk:first-child { border-top: 0; }
.bk > div { display: flex; flex-direction: column; gap: 2px; }

/* Barre de l'enfant sélectionné */
.kid { position: sticky; top: 53px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  background: var(--navy); color: #fff; }
.kid .av { width: 34px; height: 34px; border-radius: 50%; background: var(--cta); color: var(--cta-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.kid .who { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.kid .who small { opacity: 0.8; }
.kid .cr { background: rgba(255,255,255,0.14); border-radius: 999px; padding: 4px 10px; font-size: 14px; white-space: nowrap; }
.kid .cr b { font-size: 16px; }
.kid .cr.zero { background: var(--warn-bg); color: var(--warn); }
.kid .btn.ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
@media (prefers-color-scheme: dark) { .kid { background: #0f2a63; } }

/* Onglets du bas */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current] { color: var(--navy); }
body.with-tabs .page { padding-bottom: 110px; }
body.with-tabs .toast { bottom: 84px; }

/* Bande des jours */
.strip { display: grid; grid-template-columns: 28px repeat(7, 1fr) 28px; align-items: center; gap: 4px; }
.strip .wk { font-size: 26px; text-decoration: none; color: var(--navy); text-align: center; line-height: 1; }
.strip .d { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 0 8px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.strip .d small { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.strip .d b { font-size: 20px; line-height: 1.1; }
.strip .d.on { background: var(--navy); color: #fff; }
.strip .d.on small { color: rgba(255,255,255,0.8); }
.strip .d.past { opacity: 0.35; }
.strip .dot { position: absolute; bottom: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.dayh { font-size: 22px; color: var(--ink); scroll-margin-top: 120px; }

/* Cours (horaire et réservations) */
.classes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cls { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; cursor: pointer; }
.cls:hover { border-color: var(--navy); }
.cls img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.cls .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cls .t { font-size: 20px; line-height: 1.1; }
.cls .p { font-weight: 600; }
.cls .s:empty { display: none; }
.cls .chev { font-size: 26px; color: var(--muted); padding: 0 4px; }
.cls.mine { border-color: var(--ok); }
.cls.past, .cls.full { opacity: 0.55; }
.cls.bk { cursor: default; }
.cls.bk .t { font-size: 17px; }

/* Réservations */
.wallet { flex-direction: row; align-items: center; gap: 16px; }
.wallet > div:last-child { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* Progrès et bilan */
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hero { flex-direction: row; align-items: center; gap: 18px; border-top: 6px solid var(--tier); }
.hero .badge { flex: none; }
@media (max-width: 480px) { .hero .badge { width: 72px; } }
.hero-txt { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.hero h1 { color: var(--tier); }
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--ink); } }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.stats b { font-size: 18px; }
.flame { width: 20px; height: 20px; vertical-align: -3px; }
.streak-s { display: inline-flex; align-items: center; gap: 3px; }
.rankbar { height: 12px; border-radius: 999px; background: var(--tint); overflow: hidden; }
.rankbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1fbf5b, #ffc21a, #ff7a00); }
.badge-empty { display: grid; place-items: center; border-radius: 16px; background: var(--tint); color: var(--muted); font-size: 28px; font-weight: 800; }
.cls.rc { grid-template-columns: 1fr auto auto; }
.when-d { display: flex; flex-direction: column; }
.torate { color: var(--orange-ink); font-weight: 700; white-space: nowrap; }
.rated { color: #e8a800; letter-spacing: 1px; white-space: nowrap; }
.awards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.awards .card { gap: 2px; padding: 14px 16px; }
.award { display: flex; flex-direction: column; gap: 2px; background: #fff6d6; color: #5c4300; border-radius: 14px; padding: 12px 14px; }
@media (prefers-color-scheme: dark) { .award { background: #3a2f0c; color: #ffe08a; } }
.recap-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.streak { display: flex; align-items: center; gap: 6px; background: var(--tint); border-radius: 14px; padding: 8px 12px; }
.streak .flame { width: 28px; height: 28px; }
.streak b { font-size: 26px; }
.recap-rank { display: flex; align-items: center; gap: 10px; }
.recap-rank > div { display: flex; flex-direction: column; }
.recap-rank .up { color: var(--orange-ink); }
.rate { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.stars { display: flex; gap: 4px; }
.star { font-size: 38px; line-height: 1; background: none; border: 0; color: var(--line); cursor: pointer; padding: 2px; }
.star.on { color: #ffb400; }
.rate textarea { min-height: 0; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff6d6; color: #5c4300; border-radius: 14px; padding: 10px 14px; }
@media (prefers-color-scheme: dark) { .banner { background: #3a2f0c; color: #ffe08a; } }

/* Famille */
.kids { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.kidcard.on { border-color: var(--navy); }
.kidcard h2 { color: var(--navy); }
.consents { display: flex; flex-direction: column; gap: 6px; }

/* Fiche qui monte du bas */
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 0; }
.sheet-in { position: relative; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; background: var(--tint); color: var(--ink); border-radius: 50%; font-size: 22px; cursor: pointer; }
.sheet-img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }
.sheet h2 { font-size: 26px; color: var(--navy); }
.pick { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pick .btn { width: 100%; }

/* Panneau du personnel */
.staff summary { font-weight: 700; cursor: pointer; }
.progs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.progs li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.progs li:first-child { border-top: 0; }
.progs li > div { display: flex; flex-direction: column; gap: 2px; }

/* Aide */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq summary { font-weight: 700; cursor: pointer; font-size: 17px; }
.faq ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 20;
  padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(11, 58, 126, 0.18); }
.toast.ok { background: var(--ink); color: var(--bg); }
.toast.err { background: var(--err); color: #fff; }
dialog { border: 0; border-radius: var(--r); padding: 0; max-width: min(420px, calc(100% - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 21, 48, 0.5); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font-size: 22px; }

/* Horaire : rappel des progrès de l'enfant (rang, séances, série), lien vers l'onglet Progrès. */
.miniprog { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.miniprog:hover { border-color: var(--navy); }
.miniprog > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.miniprog b { color: var(--navy); }
.miniprog small { color: var(--muted); font-size: 14px; }
.miniprog i { font-style: normal; font-size: 24px; color: var(--muted); }
.miniprog .badge-empty { font-size: 18px; }

/* Téléphone : une seule barre en haut ; « Déconnexion » est dans l'onglet Famille. */
@media (max-width: 600px) { .top #out { display: none; } }
