/* Transitions natives entre pages (API View Transitions, navigation
   cross-document) — le contenu s'estompe en douceur et la barre d'onglets
   reste stable, comme une vraie app. Safari 18+/WKWebView récent, Chrome 126+. */
@view-transition { navigation: auto; }

:root {
    --noir: #0a0f0c;
    --surface: #131a14;
    --surface-2: #1b241c;
    --ligne: rgba(255, 255, 255, .09);
    --accent: #34d399;
    --lime: #a3e635;
    --texte: #eefbf3;
    --texte-att: #7c8a80;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: var(--noir);
    color: var(--texte);
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-font-smoothing: antialiased;
}

.ecran { padding: 20px 20px 40px; max-width: 480px; margin: 0 auto; }

.marque { font-size: 20px; font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; }
.marque span { color: var(--accent); }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.entete h1 { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.retour { background: none; border: none; color: var(--texte); font-size: 22px; padding: 4px 6px 4px 0; cursor: pointer; }
.icone-btn { background: var(--surface); border: 1px solid var(--ligne); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.icone-btn svg { width: 18px; height: 18px; stroke: var(--texte); fill: none; stroke-width: 1.8; }

.bouton {
    display: block; width: 100%; background: var(--accent); color: #04140c; border: none;
    padding: 16px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    border-radius: 14px; cursor: pointer; margin-top: 8px; font-family: inherit;
}
.bouton:active { opacity: .85; }
.bouton-secondaire { background: var(--surface); color: var(--texte); border: 1px solid var(--ligne); }
.bouton-erreur { color: #f87171; font-size: 13px; margin-top: 12px; min-height: 16px; }

.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--texte-att); margin-bottom: 7px; }
.champ input {
    width: 100%; background: var(--surface); border: 1px solid var(--ligne); color: var(--texte);
    padding: 14px 15px; font-size: 15px; border-radius: 12px; font-family: inherit;
}
.champ input:focus { outline: none; border-color: var(--accent); }
.lien-discret { display: block; text-align: center; color: var(--texte-att); font-size: 13px; margin-top: 14px; text-decoration: none; }

/* ── Onboarding ─────────────────────────────────────────────────────────── */
.onboard-visuel {
    height: 320px; border-radius: 20px; margin-bottom: 26px; position: relative; overflow: hidden;
    background: linear-gradient(160deg, rgba(52,211,153,.22), var(--noir) 70%);
    border: 1px solid var(--ligne);
    display: flex; align-items: flex-end; padding: 22px;
}
.onboard-visuel h1 { font-size: 27px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.point-progression { display: flex; justify-content: center; gap: 6px; margin: 18px 0 26px; }
.point-progression span { width: 7px; height: 7px; border-radius: 50%; background: var(--ligne); }
.point-progression span.actif { background: var(--accent); width: 22px; border-radius: 4px; }

/* ── Onglets segmentés (haut) ──────────────────────────────────────────────
   Esprit tableau de bord plutôt qu'appli grand public : la navigation
   reste visible en haut, ancrée au défilement, pas planquée en bas comme
   les trois autres démos. */
.onglets {
    position: sticky; top: 0; z-index: 20;
    display: flex; gap: 3px;
    background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 14px;
    padding: 4px;
    margin: 0 0 22px;
    view-transition-name: barre-onglets;
}
.onglet { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: none; border: none; border-radius: 10px; color: var(--texte-att); font-family: inherit; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; cursor: pointer; flex: 1; padding: 8px 2px; transition: background .2s, color .2s; }
.onglet svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.onglet.actif { color: #04140c; background: var(--accent); }

/* ── Anneau de progression (dashboard) ─────────────────────────────────── */
.anneau-bloc { display: flex; align-items: center; gap: 22px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 20px; padding: 20px; margin-bottom: 20px; }
.anneau { width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.anneau svg { width: 88px; height: 88px; transform: rotate(-90deg); position: absolute; }
.anneau-valeur { font-size: 18px; font-weight: 900; }
.anneau-corps { flex: 1; }
.anneau-titre { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.anneau-sous { font-size: 12.5px; color: var(--texte-att); line-height: 1.5; }

.stats-rangee { display: flex; gap: 10px; margin-bottom: 24px; }
.stat-carte { flex: 1; background: var(--surface); border: 1px solid var(--ligne); border-radius: 16px; padding: 14px; }
.stat-entree { opacity: 0; transform: translateY(10px); animation: statEntree .55s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--delai, 0ms); }
@keyframes statEntree { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .stat-entree { animation: none; opacity: 1; transform: none; } }
.stat-carte-valeur { font-size: 20px; font-weight: 900; }
.stat-carte-label { font-size: 11px; color: var(--texte-att); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.stat-carte-valeur.accent { color: var(--accent); }

.section-titre { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 14px; }
.section-titre h3 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.section-titre a { font-size: 12px; color: var(--texte-att); text-decoration: none; }

/* ── Carte séance / programme ──────────────────────────────────────────── */
.carte-seance { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 14px; margin-bottom: 12px; cursor: pointer; align-items: center; }
.seance-visuel { width: 58px; height: 58px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.seance-visuel svg { width: 26px; height: 26px; stroke: #04140c; fill: none; stroke-width: 2; }
.seance-corps { flex: 1; }
.seance-nom { font-size: 14.5px; font-weight: 700; }
.seance-meta { font-size: 12px; color: var(--texte-att); margin-top: 3px; }
.badge-niveau { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 4px 9px; border-radius: 99px; background: rgba(52,211,153,.15); color: var(--accent); }

/* ── Détail programme ───────────────────────────────────────────────────── */
.programme-hero { height: 180px; border-radius: 20px; margin-bottom: 20px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 20px; background: linear-gradient(155deg, rgba(52,211,153,.3), var(--noir) 75%); }
.programme-hero h1 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.liste-exercices { display: flex; flex-direction: column; gap: 10px; }
.ligne-exercice { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: 13px; }
.exercice-num { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--texte-att); flex-shrink: 0; }
.exercice-corps { flex: 1; }
.exercice-nom { font-size: 14px; font-weight: 700; }
.exercice-meta { font-size: 12px; color: var(--texte-att); margin-top: 2px; }
.exercice-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ligne); flex-shrink: 0; }
.exercice-check.fait { background: var(--accent); border-color: var(--accent); position: relative; }
.exercice-check.fait::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #04140c; font-weight: 900; }

/* ── Séance en cours ────────────────────────────────────────────────────── */
.chrono-seance { text-align: center; padding: 20px 0 26px; }
.chrono-seance-valeur { font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.chrono-seance-label { font-size: 12px; color: var(--texte-att); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.exercice-actif { background: var(--surface); border: 1px solid var(--accent); border-radius: 20px; padding: 24px; text-align: center; margin-bottom: 20px; }
.exercice-actif-nom { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.exercice-actif-meta { font-size: 14px; color: var(--texte-att); margin-bottom: 20px; }
.rangee-series { display: flex; justify-content: center; gap: 10px; }
.serie-pastille { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--ligne); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--texte-att); }
.serie-pastille.fait { background: var(--accent); color: #04140c; border-color: var(--accent); }
.barre-seance { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: rgba(10,15,12,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--ligne); }
.barre-seance .bouton { margin-top: 0; }

/* ── Progression / graphiques ──────────────────────────────────────────── */
.filtres { display: flex; gap: 8px; margin-bottom: 20px; }
.puce-filtre { font-size: 12.5px; font-weight: 700; background: var(--surface); border: 1px solid var(--ligne); color: var(--texte-att); padding: 9px 16px; border-radius: 99px; cursor: pointer; }
.puce-filtre.actif { background: var(--accent); border-color: transparent; color: #04140c; }

.graphique-carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: 20px; padding: 20px; margin-bottom: 16px; }
.graphique-entete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.graphique-valeur { font-size: 24px; font-weight: 900; }
.graphique-delta { font-size: 12.5px; color: var(--accent); font-weight: 700; }
.graphique-barres { display: flex; align-items: flex-end; gap: 8px; height: 90px; }
.graphique-barres i { flex: 1; height: 0; background: linear-gradient(180deg, var(--accent), rgba(52,211,153,.15)); border-radius: 4px 4px 0 0; transition: height .6s cubic-bezier(.2,.8,.2,1); transition-delay: var(--delai, 0ms); }
.graphique-barres i.barre-poussee { height: var(--h); }
@media (prefers-reduced-motion: reduce) { .graphique-barres i { transition: none; height: var(--h); } }
.graphique-jours { display: flex; gap: 8px; margin-top: 8px; }
.graphique-jours span { flex: 1; text-align: center; font-size: 10.5px; color: var(--texte-att); }

.carte-record { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--ligne); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.record-nom { font-size: 13.5px; font-weight: 700; }
.record-sous { font-size: 11.5px; color: var(--texte-att); margin-top: 2px; }
.record-valeur { font-size: 16px; font-weight: 900; color: var(--accent); }

/* ── Coachs ─────────────────────────────────────────────────────────────── */
.carte-coach { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: 14px; margin-bottom: 12px; cursor: pointer; align-items: center; }
.coach-corps { flex: 1; }
.coach-nom { font-size: 14.5px; font-weight: 700; }
.coach-specialite { font-size: 12px; color: var(--texte-att); margin-top: 2px; }
.coach-note { font-size: 12px; color: var(--lime); font-weight: 700; margin-top: 4px; }

.coach-hero { text-align: center; padding: 10px 0 24px; }
.coach-hero .avatar { width: 88px; height: 88px; font-size: 28px; }
.coach-hero h1 { font-size: 20px; font-weight: 800; margin-top: 14px; }
.coach-hero p { font-size: 13px; color: var(--texte-att); margin-top: 4px; }

.grille-creneaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.creneau { text-align: center; padding: 13px 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--ligne); font-size: 13px; font-weight: 700; cursor: pointer; }
.creneau.actif { background: var(--accent); color: #04140c; border-color: var(--accent); }
.creneau.indispo { opacity: .3; pointer-events: none; text-decoration: line-through; }

/* ── Avatar / profil ────────────────────────────────────────────────────── */
.avatar { width: 74px; height: 74px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--ligne); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: var(--accent); margin: 0 auto 14px; }
.avatar-petit { width: 46px; height: 46px; font-size: 16px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.profil-nom { text-align: center; font-size: 19px; font-weight: 800; }
.profil-sous { text-align: center; font-size: 13px; color: var(--texte-att); margin-bottom: 22px; }

.badges-rangee { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.badge-trophee { width: 52px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--ligne); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.badge-trophee.acquis { background: rgba(163,230,53,.14); border-color: var(--lime); }

.ligne-option { display: flex; justify-content: space-between; align-items: center; padding: 15px 2px; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.ligne-option:last-child { border-bottom: none; }
.ligne-option-titre { font-size: 14.5px; font-weight: 600; }
.ligne-option-sous { font-size: 12px; color: var(--texte-att); margin-top: 2px; }
.interrupteur { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.interrupteur input { opacity: 0; width: 0; height: 0; }
.interrupteur-piste { position: absolute; inset: 0; background: var(--ligne); border-radius: 99px; transition: background .15s; cursor: pointer; }
.interrupteur-piste::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.interrupteur input:checked + .interrupteur-piste { background: var(--accent); }
.interrupteur input:checked + .interrupteur-piste::before { transform: translateX(18px); }

.etat-systeme { text-align: center; padding: 60px 24px; }
.etat-icone { width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--ligne); display: flex; align-items: center; justify-content: center; }
.etat-icone svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.etat-titre { font-size: 19px; font-weight: 900; margin-bottom: 9px; }
.etat-texte { font-size: 14px; color: var(--texte-att); line-height: 1.6; max-width: 300px; margin: 0 auto; }

.vide, .chargement { text-align: center; color: var(--texte-att); font-size: 14px; padding: 40px 0; }
