/*
 * FitTrack - feuille de style globale
 * Posee par-dessus Bootstrap 5 : on redefinit les jetons de design
 * (couleurs, typographie, rayons) puis on habille les composants.
 */

:root {
    --ft-ink: #14161b;
    --ft-ink-soft: #3a3f4a;
    /* x0.95 de la valeur d'origine (#767055) : la premiere echouait de peu
       (4.42:1) sur le papier, seuil RGAA/WCAG AA pour du texte courant. */
    --ft-muted: #706a50;
    /* Canvas chaud : laisse les couleurs de groupe musculaire porter l'energie. */
    --ft-paper: #f6f1e7;
    --ft-surface: #ffffff;
    --ft-line: #e8e0d0;
    --ft-accent: #f5442e;
    --ft-accent-soft: #fdeae6;
    /*
     * --ft-accent (le rouge vif des boutons/du logo) ne passe pas 4.5:1 en
     * PETIT TEXTE sur un fond clair (papier, blanc, accent-soft) : 3.2 a
     * 3.65 selon le fond, verifie un a un. Il reste tel quel comme couleur
     * de FOND (le texte y est alors en encre, deja verifie ailleurs) ; des
     * qu'il sert de couleur de TEXTE sur un fond clair, on utilise cette
     * version assombrie a la place - meme teinte, mais accessible partout
     * ou elle est utilisee (verifie : >= 4.6:1 sur papier/blanc/accent-soft).
     */
    --ft-accent-text: #c43624;
    --ft-radius-lg: 28px;
    --ft-radius: 20px;
    --ft-radius-sm: 12px;

    --bs-body-bg: var(--ft-paper);
    --bs-body-color: var(--ft-ink);
    --bs-border-color: var(--ft-line);
    --bs-primary: var(--ft-ink);
    /*
     * Bootstrap 5.3 resolves link colours through the *-rgb custom properties,
     * so overriding --bs-link-color alone leaves the default blue in place.
     */
    --bs-link-color: var(--ft-ink);
    --bs-link-color-rgb: 20, 22, 27;
    --bs-link-hover-color: var(--ft-accent-text);
    --bs-link-hover-color-rgb: 196, 54, 36;
    --bs-link-decoration: none;
}

/* ---------- Liens ---------- */

/*
 * Pas de bleu souligne : l'encre du texte, plus un trait d'accent qui se
 * deroule sous le lien au survol.
 */
/*
 * :where() garde la specificite a (0,0,1) : c'est un defaut pour les liens de
 * contenu, que n'importe quel composant (header, footer, cartes) peut
 * surcharger avec une simple regle de classe.
 */
a:where(:not(.btn):not(.ex-card):not(.nav-link)) {
    color: var(--ft-ink);
    text-decoration: none;
    font-weight: 600;
    background-image: linear-gradient(var(--ft-accent), var(--ft-accent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 2px;
    padding-bottom: 1px;
    transition: background-size 0.22s ease, color 0.22s ease;
}

a:where(:not(.btn):not(.ex-card):not(.nav-link)):hover,
a:where(:not(.btn):not(.ex-card):not(.nav-link)):focus-visible {
    color: var(--ft-accent-text);
    background-size: 100% 2px;
}

a:focus-visible {
    outline: 2px solid var(--ft-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

body {
    background-color: var(--ft-paper);
    color: var(--ft-ink);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Typographie ---------- */

/*
 * Une seule famille pour tout, portee par le contraste de graisse : 800 pour
 * les titres (serre), 500-600 pour le texte courant.
 */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.08;
}

h1 {
    font-size: clamp(2.1rem, 1.3rem + 3vw, 3.4rem);
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.2rem;
}

/*
 * Repere de section en ton minuscule (jamais de capitales tracees) : un point
 * de couleur avant le texte suffit a signaler "vous etes ici", sans bandeau.
 */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ft-ink-soft);
    margin-bottom: 0.6rem;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--ft-accent);
}

.lead-muted {
    color: var(--ft-muted);
    max-width: 58ch;
}

/* ---------- Navigation ---------- */

/* Lien d'evitement : hors ecran, ramene au premier coup de Tab. */
.skip-link {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 100;
    transform: translate(-50%, -120%);
    padding: 0.7rem 1.2rem;
    border-radius: 0 0 var(--ft-radius-sm) var(--ft-radius-sm);
    background-color: var(--ft-accent);
    /* Encre plutot que blanc : blanc sur cet orange ne passe pas le contraste AA. */
    color: var(--ft-ink);
    font-weight: 600;
    background-image: none;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
    color: var(--ft-ink);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--ft-ink);
    color: #fff;
    padding: 0.95rem 0;
}

.site-header__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-header a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    /*
     * Fond sombre : on annule le trait d'accent des liens de contenu.
     * (Pas besoin d'un padding-bottom:0 en plus : le style des liens de
     * contenu est pose via a:where(...), qui reste a specificite (0,0,0) et
     * ne peut de toute facon pas battre ce selecteur. Un padding-bottom:0
     * ici ecrasait aussi celui des .btn places dans le header : c'etait la
     * cause du texte des boutons mal centre.)
     */
    background-image: none;
    transition: color 0.15s ease;
}

/*
 * .site-header a (1 classe + 1 type) bat .btn-accent (1 classe) sur la
 * specificite : sans cette regle, un .btn place dans le header heriterait
 * de la couleur muette du lien au lieu de son encre. .nav-link, lui, gagne
 * deja cette bataille tout seul (il combine 2 classes en etat actif) : on
 * ne touche pas a ce mecanisme, on ajoute juste le cas manquant.
 */
.site-header .btn {
    color: var(--ft-ink);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff !important;
    padding: 0.4rem 0;
}

.brand::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background-color: var(--ft-accent);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover::before {
    transform: rotate(45deg) scale(1.15);
}

.nav-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 1.5rem;
}

.site-nav,
.site-account {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ---------- Interrupteur son ---------- */

.nav-sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--ft-radius-sm);
    background: transparent;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-sound-toggle:hover,
.nav-sound-toggle:focus-visible {
    background-color: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- Liens de navigation ---------- */

/*
 * Chaque lien porte son propre soulignement anime : il part du centre au
 * survol, et reste affiche sur la page courante.
 */
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem 0.8rem;
    border: 0;
    border-radius: var(--ft-radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 0.93rem;
    font-weight: 500;
    /* Interligne serre : le trait anime se loge sous les jambages. */
    line-height: 1.25;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    /* Colle au bord bas de la pastille : le padding garantit l'ecart au texte. */
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background-color: var(--ft-accent);
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.07);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.nav-chevron {
    width: 10px;
    height: 6px;
    transition: transform 0.25s ease;
}

[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

/* ---------- Menus deroulants ---------- */

.nav-menu {
    position: relative;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 60;
    min-width: 230px;
    padding: 0.4rem;
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-sm);
    box-shadow: 0 16px 38px rgba(20, 22, 27, 0.18);
    animation: nav-drop 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

.nav-dropdown--end {
    left: auto;
    right: 0;
    transform-origin: top right;
}

@keyframes nav-drop {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown__item {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    color: var(--ft-ink) !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.nav-dropdown__item:hover,
.nav-dropdown__item:focus-visible {
    background-color: var(--ft-paper);
    transform: translateX(3px);
}

.nav-dropdown__item.is-active {
    color: var(--ft-accent-text) !important;
    background-color: var(--ft-accent-soft);
}

.nav-dropdown__label {
    margin: 0;
    padding: 0.5rem 0.7rem 0.6rem;
    border-bottom: 1px solid var(--ft-line);
    margin-bottom: 0.3rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--ft-muted);
}

/* ---------- Bouton de compte ---------- */

.nav-account {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.nav-account:hover,
.nav-account:focus-visible {
    background-color: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.nav-avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--ft-accent);
    /* Encre, pas blanc : blanc sur cet orange ne passe pas le contraste AA
       (meme raison que les boutons accent, cf assets/styles/app.css plus haut). */
    color: var(--ft-ink);
    font-size: 0.78rem;
    font-weight: 700;
    overflow: hidden;
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-account__name {
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Bouton burger ---------- */

.nav-burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--ft-radius-sm);
    background: transparent;
    cursor: pointer;
}

.nav-burger__box {
    display: grid;
    gap: 5px;
    width: 18px;
}

.nav-burger__line {
    height: 2px;
    border-radius: 2px;
    background-color: #fff;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

/* Les deux barres se croisent pour former la croix de fermeture. */
.nav-burger[aria-expanded="true"] .nav-burger__line:first-child {
    transform: translateY(3.5px) rotate(45deg);
}

.nav-burger[aria-expanded="true"] .nav-burger__line:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
}

/* ---------- Focus visible ---------- */

.site-header :focus-visible {
    outline: 2px solid var(--ft-accent);
    outline-offset: 2px;
}

/* ---------- Mobile ---------- */

@media (max-width: 860px) {
    .nav-burger {
        display: inline-flex;
    }

    .nav-panel {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.8rem 1rem 1.1rem;
        background-color: var(--ft-ink);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 18px 30px rgba(0, 0, 0, 0.25);
        animation: nav-slide 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-panel.is-open {
        display: flex;
    }

    @keyframes nav-slide {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .site-nav,
    .site-account {
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
    }

    .nav-link {
        padding: 0.7rem 0.8rem;
    }

    /* En pile, un menu deroulant flottant n'a plus de sens : on l'inline. */
    .nav-dropdown {
        position: static;
        margin: 0.2rem 0 0.4rem 0.8rem;
        box-shadow: none;
        animation: none;
    }

    .site-account {
        margin-top: 0.5rem;
        padding-top: 0.7rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-account {
        justify-content: flex-start;
    }

    .nav-account__name {
        max-width: none;
    }
}

/* ---------- Mouvement reduit ---------- */

@media (prefers-reduced-motion: reduce) {
    .skip-link,
    .brand::before,
    .nav-link,
    .nav-link::after,
    .nav-chevron,
    .nav-burger__line,
    .nav-dropdown__item {
        transition: none;
    }

    .nav-dropdown,
    .nav-panel {
        animation: none;
    }
}

/* ---------- Surfaces ---------- */

.panel {
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    padding: 1.6rem;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}

/*
 * Intro de page (eyebrow / h1 / texte de lead / bouton) : sur mobile le h1
 * passe sur plusieurs lignes et les marges par defaut (Bootstrap, 0.5rem)
 * suffisent plus a separer visuellement les blocs. On aere uniquement cette
 * zone, pas le reste de la mise en page.
 */
@media (max-width: 767px) {
    .page-head {
        gap: 1.1rem;
    }

    .page-head .eyebrow {
        margin-bottom: 0.75rem;
    }

    .page-head h1 {
        margin-bottom: 0.9rem;
    }

    .page-head .lead-muted {
        margin-top: 0.2rem;
    }
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 2.4rem 0 1rem;
}

.section-title h2 {
    margin: 0;
}

.section-title .count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ft-muted);
}

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

/* ---------- Ruban defilant ---------- */

/*
 * Seul mouvement non declenche par l'utilisateur de la page : un ruban qui
 * defile en continu, moment unique et volontaire plutot que des apparitions
 * eparpillees sur chaque section.
 */
.marquee {
    overflow: hidden;
    background-color: var(--ft-ink);
    border-radius: var(--ft-radius);
    margin: 2.5rem 0;
}

.marquee__track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 32s linear infinite;
}

.marquee__set {
    display: flex;
    align-items: center;
    flex: none;
}

.marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
}

.marquee__item::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--group-color, var(--ft-accent));
    flex: none;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee__track {
        animation: none;
    }

    .marquee {
        overflow-x: auto;
    }
}

/* ---------- Tuiles des groupes musculaires ---------- */

/*
 * Un bento colore : chaque groupe musculaire est une entree de la meme
 * couleur que ses cartes d'exercice plus bas sur la page, pour que la
 * couleur code une categorie reelle plutot que decorer au hasard.
 */
.muscle-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin: 2rem 0 3rem;
}

@media (max-width: 860px) {
    .muscle-bento {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .muscle-bento {
        grid-template-columns: 1fr;
    }
}

.muscle-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.6rem;
    padding: 1.3rem 1.4rem;
    min-height: 128px;
    border-radius: var(--ft-radius);
    background-color: var(--group-color, var(--ft-ink));
    /*
     * --group-text est calcule cote serveur (MuscleGroup::getTextColor()) :
     * noir ou blanc pur, celui qui contraste le plus avec --group-color.
     * La couleur du groupe est modifiable par un admin (color picker) ; une
     * couleur de texte figee casserait le contraste RGAA selon la teinte
     * choisie, alors que ce calcul reste correct quoi qu'il choisisse.
     */
    color: var(--group-text, var(--ft-ink));
    text-decoration: none;
    background-image: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.muscle-tile:hover,
.muscle-tile:focus-visible {
    color: var(--group-text, var(--ft-ink));
    transform: translateY(-4px) rotate(-0.6deg);
    box-shadow: 6px 6px 0 rgba(20, 22, 27, 0.16);
}

.muscle-tile__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.muscle-tile__count {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    /* --group-badge-overlay : voir MuscleGroup::getBadgeOverlay(). */
    background-color: var(--group-badge-overlay, rgba(20, 22, 27, 0.12));
}

.muscle-tile__arrow {
    width: 18px;
    height: 18px;
    flex: none;
    transition: transform 0.2s ease;
}

.muscle-tile:hover .muscle-tile__arrow {
    transform: translate(2px, -2px);
}

.muscle-tile__name {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
    .muscle-tile {
        transition: none;
    }
}

/* ---------- Cartes exercice ---------- */

/*
 * Flex plutot que grid : a 2 ou 3 cartes, une derniere ligne incomplete
 * reste centree, ce qu'un grid aligne a gauche ne fait pas.
 */
.card-grid {
    --card-gap: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--card-gap);
}

.card-grid > .ex-card {
    flex: 0 1 calc((100% - 3 * var(--card-gap)) / 4);
    min-width: 0;
}

@media (max-width: 992px) {
    .card-grid > .ex-card {
        flex-basis: calc((100% - 2 * var(--card-gap)) / 3);
    }
}

@media (max-width: 768px) {
    .card-grid > .ex-card {
        flex-basis: calc((100% - var(--card-gap)) / 2);
    }
}

@media (max-width: 480px) {
    .card-grid > .ex-card {
        flex-basis: 100%;
    }
}

.ex-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

/* Liseret de la couleur du groupe : la carte reste rattachee a sa categorie. */
.ex-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background-color: var(--group-color, var(--ft-accent));
    z-index: 1;
}

.ex-card:hover {
    transform: translateY(-3px);
    border-color: var(--ft-ink);
    box-shadow: 0 12px 28px rgba(20, 22, 27, 0.10);
    color: inherit;
}

/*
 * Les deux photos du mouvement (depart / arrivee) sont superposees ; au
 * survol on fait aller-retour entre les deux pour animer le geste.
 */
.ex-card__media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #e9ebf0;
}

.ex-card__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ex-card__frame--end {
    opacity: 0;
}

.ex-card:hover .ex-card__frame--end,
.ex-card:focus-visible .ex-card__frame--end {
    animation: ex-play 1.1s ease-in-out infinite alternate;
}

@keyframes ex-play {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ex-card__hint {
    position: absolute;
    left: 0.6rem;
    bottom: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background-color: rgba(20, 22, 27, 0.72);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ex-card:hover .ex-card__hint,
.ex-card:focus-visible .ex-card__hint {
    opacity: 1;
    transform: translateY(0);
}

.ex-card__body {
    display: block;
    padding: 0.9rem 1rem 1.1rem;
    text-align: center;
}

.ex-card__title {
    display: block;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.ex-card__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--ft-muted);
}

.ex-card__meta::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background-color: var(--group-color, var(--ft-accent));
}

@media (prefers-reduced-motion: reduce) {
    .ex-card:hover .ex-card__frame--end,
    .ex-card:focus-visible .ex-card__frame--end {
        animation: none;
        opacity: 1;
    }
}

/*
 * Un ecran tactile n'a pas d'etat :hover - sans ca, le geste "depart <->
 * arrivee" ne se declenchait jamais sur mobile, et l'indice "Survolez pour
 * voir le mouvement" etait impossible a suivre au doigt. Sur ce type
 * d'appareil (hover: none), l'animation tourne directement, sans attendre
 * une interaction.
 */
@media (hover: none) {
    .ex-card__frame--end {
        animation: ex-play 1.1s ease-in-out infinite alternate;
    }

    .ex-card__hint {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: none) and (prefers-reduced-motion: reduce) {
    .ex-card__frame--end {
        animation: none;
        opacity: 1;
    }
}

/* ---------- Fiche exercice ---------- */

.exercise-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    overflow: hidden;
}

/* Meme principe que la vignette : deux photos superposees, animees au survol. */
.exercise-hero__media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #e9ebf0;
}

.exercise-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.exercise-hero__media:hover .ex-card__frame--end {
    animation: ex-play 1.1s ease-in-out infinite alternate;
}

.exercise-hero__media:hover .ex-card__hint {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .exercise-hero__media:hover .ex-card__frame--end {
        animation: none;
        opacity: 1;
    }
}

@media (hover: none) {
    .exercise-hero__media .ex-card__frame--end {
        animation: ex-play 1.1s ease-in-out infinite alternate;
    }

    .exercise-hero__media .ex-card__hint {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: none) and (prefers-reduced-motion: reduce) {
    .exercise-hero__media .ex-card__frame--end {
        animation: none;
        opacity: 1;
    }
}

.exercise-hero__content {
    padding: 2rem 2rem 2rem 0;
}

@media (max-width: 767px) {
    .exercise-hero {
        grid-template-columns: 1fr;
    }

    .exercise-hero__content {
        padding: 1.5rem;
    }
}

/*
 * Couleur de groupe musculaire, posee via --group-color en style inline.
 * L'encre (jamais blanc) garde un contraste AA sur les six teintes de la
 * palette, verifie une a une plutot que suppose.
 */
.tag {
    display: inline-block;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    background-color: var(--group-color, var(--ft-accent-soft));
    /* Voir la note sur --group-text dans .muscle-tile : calcule cote serveur. */
    color: var(--group-text, var(--ft-ink));
    font-size: 0.82rem;
    font-weight: 700;
}

/* ---------- Statistiques ---------- */

.stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    background-color: var(--ft-ink);
    color: #fff;
    border-radius: var(--ft-radius);
    padding: 1.9rem 1.8rem;
}

.stat__section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat__divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.14);
}

.stat__section--row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem 2rem;
}

.stat__cell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat__label {
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.stat__value {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat__value span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ft-accent);
}

.stat__count {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
}

/* ---------- Boutons ---------- */

.btn {
    --bs-btn-border-radius: var(--ft-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.55rem 1.1rem;
    border-radius: var(--ft-radius-sm);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/*
 * Pilule pleine couleur, texte encre : le traitement du bouton "Book your
 * Unit" du site de reference (fond sature, texte noir, jamais blanc - le
 * blanc sur cet orange ne passait meme pas le contraste AA).
 * Au survol : une vague de couleur remonte depuis le bas du bouton, echo du
 * "liquid fill" du site de reference, en CSS pur (pas de SVG/JS a charger
 * pour un aller-retour de couleur).
 */
.btn-accent,
.btn-primary {
    position: relative;
    overflow: hidden;
    background-color: var(--ft-accent);
    border: 1px solid var(--ft-accent);
    border-radius: 999px;
    color: var(--ft-ink);
    padding: 0.7rem 1.5rem;
    isolation: isolate;
}

.btn-accent::before,
.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #ffb020;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: -1;
}

.btn-accent:hover,
.btn-primary:hover {
    color: var(--ft-ink);
}

.btn-accent:hover::before,
.btn-primary:hover::before {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .btn-accent::before,
    .btn-primary::before {
        transition: none;
    }
}

.btn-dark {
    background-color: var(--ft-ink);
    border-color: var(--ft-ink);
}

.btn-ghost {
    background-color: transparent;
    border: 1px solid var(--ft-line);
    color: var(--ft-ink);
}

.btn-ghost:hover {
    border-color: var(--ft-ink);
    background-color: #fff;
    color: var(--ft-ink);
}

.btn-danger-ghost {
    background-color: transparent;
    border: 1px solid var(--ft-line);
    color: var(--ft-accent-text);
}

.btn-danger-ghost:hover {
    border-color: var(--ft-accent);
    background-color: var(--ft-accent-soft);
    color: var(--ft-accent-text);
}

.btn-sm {
    padding: 0.32rem 0.7rem;
    font-size: 0.82rem;
}

/* ---------- Tableaux ---------- */

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > thead th {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ft-muted);
    border-bottom: 1px solid var(--ft-line);
    padding-bottom: 0.7rem;
}

.table > tbody td {
    border-bottom: 1px solid var(--ft-line);
    padding: 0.85rem 0.5rem;
    vertical-align: middle;
}

.table > tbody tr:last-child td {
    border-bottom: 0;
}

.table .row-highlight td {
    background-color: var(--ft-accent-soft);
}

/* Tableau "Mes séances" : texte plus grand, lignes plus compactes. */
.table--workouts > tbody td {
    padding: 0.5rem 0.5rem;
    font-size: 1.05rem;
}

.table--workouts > tbody td strong {
    font-size: 1.15rem;
}

/* Colonne "Exercice" (nom + groupe musculaire en dessous) dans un tableau
   de séance : largeur laissée libre (les noms d'exercice varient), mais le
   contenu interne reste strictement aligné a gauche, sans le centrage de
   .ex-card__meta (pensé pour les cartes, pas pour une cellule de tableau). */
.table-exercise-col {
    min-width: 11rem;
}

.table-exercise-col__group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--ft-muted);
}

.table-exercise-col__group::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background-color: var(--group-color, var(--ft-accent));
}

/*
 * Tableau "Mes séances" : sur mobile, une ligne de tableau classique
 * (date / nom / nb d'exercices / bouton) finit toujours trop tassee et
 * le bouton "Ouvrir" trop petit pour un doigt. En dessous de 640px on
 * reorganise chaque <tr> en petite carte verticale a la place, sans
 * toucher au balisage semantique du tableau.
 */
@media (max-width: 640px) {
    .table--workouts thead {
        display: none;
    }

    .table--workouts,
    .table--workouts tbody,
    .table--workouts tr,
    .table--workouts td {
        display: block;
        width: 100%;
    }

    .table--workouts tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        column-gap: 0.75rem;
        row-gap: 0.3rem;
        padding: 1rem 0;
    }

    .table--workouts td {
        border-bottom: 0;
        padding: 0;
        vertical-align: baseline;
    }

    .table--workouts td:nth-child(1) {
        order: 2;
        font-size: 0.82rem;
        color: var(--ft-muted);
    }

    .table--workouts td:nth-child(2) {
        order: 1;
        flex-basis: 100%;
        font-size: 1.08rem;
    }

    .table--workouts td:nth-child(3) {
        order: 3;
        font-size: 0.82rem;
        color: var(--ft-muted);
    }

    .table--workouts td:last-child {
        order: 4;
        flex-basis: 100%;
        margin-top: 0.5rem;
    }

    .table--workouts td:last-child .btn {
        display: flex;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

.table-wrap {
    position: relative;
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    padding: 0.6rem 1.2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /*
     * Ombres de defilement : indiquent qu'il reste du contenu a gauche/a
     * droite sans JS, via le classique duo degrade-opaque (masque le bord)
     * + degrade-ombre (attache en "scroll" donc toujours visible a l'extremite
     * tant qu'il y a plus a voir dans cette direction). Inutile si le tableau
     * tient dans la largeur : les deux ombres se chevauchent et disparaissent.
     */
    background-image:
        linear-gradient(to right, var(--ft-surface) 50%, rgba(255, 255, 255, 0)),
        linear-gradient(to left, var(--ft-surface) 50%, rgba(255, 255, 255, 0)),
        linear-gradient(to right, rgba(20, 22, 27, 0.14), rgba(20, 22, 27, 0)),
        linear-gradient(to left, rgba(20, 22, 27, 0.14), rgba(20, 22, 27, 0));
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-size: 28px 100%, 28px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
}

/*
 * Indication textuelle du defilement horizontal, affichee uniquement sur
 * petit ecran : sur desktop le tableau tient generalement dans la largeur,
 * et le texte serait un bruit inutile.
 */
.table-scroll-hint {
    display: none;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ft-muted);
}

.table-scroll-hint__arrow {
    display: inline-block;
    animation: table-scroll-hint-nudge 1.4s ease-in-out infinite;
}

@keyframes table-scroll-hint-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .table-scroll-hint__arrow {
        animation: none;
    }
}

@media (max-width: 767px) {
    .table-scroll-hint {
        display: inline-flex;
    }
}

/* ---------- Formulaires ---------- */

form label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ft-muted);
    margin-bottom: 0.35rem;
    display: block;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="url"],
form input[type="datetime-local"],
form input[type="date"],
form textarea,
form select {
    width: 100%;
    max-width: 460px;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-sm);
    background-color: #fff;
    color: var(--ft-ink);
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
}

form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    border-color: var(--ft-ink);
    box-shadow: 0 0 0 3px rgba(20, 22, 27, 0.08);
}

form textarea {
    min-height: 120px;
    resize: vertical;
}

/*
 * Les boutons generes par Symfony (sans classe) reprennent exactement le
 * style .btn-accent : meme couleur, meme pilule, meme texte encre. Un
 * <input type="submit"> ne peut pas porter de ::before (element remplace),
 * il se contente donc d'un assombrissement au survol.
 */
form button[type="submit"]:not(.btn),
form input[type="submit"]:not(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--ft-accent);
    border: 1px solid var(--ft-accent);
    color: var(--ft-ink);
    font-weight: 600;
    line-height: 1.2;
    padding: 0.7rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
}

form button[type="submit"]:not(.btn) {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

form button[type="submit"]:not(.btn)::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #ffb020;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: -1;
}

form button[type="submit"]:not(.btn):hover {
    color: var(--ft-ink);
}

form button[type="submit"]:not(.btn):hover::before {
    transform: translateY(0);
}

form input[type="submit"]:not(.btn):hover {
    background-color: #d93a26;
    border-color: #d93a26;
}

@media (prefers-reduced-motion: reduce) {
    form button[type="submit"]:not(.btn)::before {
        transition: none;
    }
}

.form-inline-delete {
    display: inline;
}

ul.form-error-message,
.form-error-message {
    list-style: none;
    padding: 0;
    margin: -0.8rem 0 1rem;
    color: var(--ft-accent-text);
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Alertes ---------- */

.alert {
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius-sm);
    border-left: 4px solid var(--ft-ink);
    background-color: var(--ft-surface);
    color: var(--ft-ink);
    font-size: 0.92rem;
}

.alert-danger {
    border-left-color: var(--ft-accent);
    background-color: var(--ft-accent-soft);
    color: #8f2417;
}

.alert-success {
    border-left-color: var(--ft-ink);
}

/* ---------- Authentification ---------- */

.auth-card {
    max-width: 420px;
    margin: 3rem auto;
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    padding: 2rem;
}

.auth-card form input {
    max-width: 100%;
}

.auth-card button[type="submit"] {
    width: 100%;
    margin-top: 0.4rem;
}

/* ---------- Compte ---------- */

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 767px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
}

.account-grid h2 {
    margin-bottom: 0.3rem;
}

.account-grid form {
    margin-top: 1.2rem;
}

.account-avatar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.account-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--ft-accent);
    color: var(--ft-ink);
    font-size: 1.6rem;
    font-weight: 700;
    overflow: hidden;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-avatar-hint {
    font-size: 0.82rem;
}

/* ---------- Pied de page ---------- */

.site-footer {
    position: relative;
    overflow: hidden;
    margin-top: 4rem;
    padding: 3rem 0 1.6rem;
    background-color: var(--ft-ink);
    color: rgba(255, 255, 255, 0.55);
}

.site-footer__wordmark {
    margin: 0 0 2rem;
    font-size: clamp(3rem, 1.5rem + 9vw, 7.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #fff;
}

/* Six points, un par groupe musculaire : la meme palette qu'ailleurs sur le site. */
.site-footer__dots {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.site-footer__dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--dot-color);
}

.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
}

/* ---------- Pop-up "Installer FitTrack" ---------- */

/*
 * Sticky bas-droite, mobile comme desktop : le controleur JS decide seul
 * quand l'afficher (beforeinstallprompt reel, ou geste manuel iOS), aucune
 * raison de la re-limiter par largeur d'ecran ici. Masquee par defaut via
 * [hidden] ; le controleur retire cet attribut puis ajoute .is-visible une
 * frame plus tard pour jouer l'entree.
 */
.pwa-install {
    /* Fixed (pas sticky) : reste au meme endroit a l'ecran quoi qu'il arrive
       au scroll, ne suit ni ne rebondit - elle flotte, point final. */
    position: fixed;
    right: 1.5rem;
    bottom: 4rem;
    z-index: 80;
    width: min(340px, calc(100vw - 3rem));
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.1rem 1.2rem 1.2rem;
    background-color: var(--ft-surface);
    border: 1px solid rgba(20, 22, 27, 0.06);
    border-radius: var(--ft-radius);
    /* Ombre large et diffuse plutot qu'une bordure marquee : la carte se
       detache du fond comme posee au-dessus, pas collee a un bord d'ecran. */
    box-shadow: 0 28px 60px -12px rgba(20, 22, 27, 0.32), 0 8px 20px rgba(20, 22, 27, 0.12);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-install.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .pwa-install {
        transition: opacity 0.15s ease;
        transform: none;
    }
}

.pwa-install__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ft-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pwa-install__close svg {
    width: 12px;
    height: 12px;
}

.pwa-install__close:hover,
.pwa-install__close:focus-visible {
    background-color: var(--ft-paper);
    color: var(--ft-ink);
}

.pwa-install__icon img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.pwa-install__title {
    margin: 0 0 0.25rem;
    padding-right: 1.4rem;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.pwa-install__text {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--ft-muted);
}

.pwa-install__actions {
    display: flex;
    gap: 0.5rem;
}

.pwa-install__actions .btn {
    flex: 1;
}

/* ==========================================================================
   Classement (rangs Bronze -> Ultimate)
   ========================================================================== */

.rank-user {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.rank-user__avatar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--ft-ink);
    color: var(--ft-paper);
    font-size: 0.78rem;
    font-weight: 700;
}

.rank-user__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    white-space: nowrap;
    text-decoration: none;
    isolation: isolate;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20, 22, 27, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
}

a.rank-badge:hover,
a.rank-badge:focus-visible {
    color: #ffffff;
    transform: translateY(-2px) scale(1.05);
}

/* Reflet au survol : meme principe que le chatoiement permanent de
   l'Ultimate (plus bas), mais joue une seule fois au passage de la souris
   plutot qu'en boucle - un signal de plus pour les paliers "normaux". */
.rank-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.45) 48%, transparent 66%);
    background-size: 220% 100%;
    background-position: 140% 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

a.rank-badge:hover::after,
a.rank-badge:focus-visible::after {
    opacity: 1;
    animation: badge-sweep 0.7s ease forwards;
}

@keyframes badge-sweep {
    from { background-position: 140% 0; }
    to   { background-position: -40% 0; }
}

/* Degrades legerement plus riches qu'un aplat, sans toucher au contraste
   verifie (meme teinte de depart, luminance equivalente ou plus sombre a
   l'autre bout du degrade - jamais plus claire). */
/* background-color en secours : si le degrade echoue pour une raison ou
   une autre, le badge garde une couleur pleine du meme ton plutot que de
   retomber transparent (texte blanc invisible sur fond clair herite). */
.rank-badge.rank-bronze   { background-color: #6a3c14; background-image: linear-gradient(135deg, #8c5726, #6a3c14); }
.rank-badge.rank-argent   { background-color: #47494e; background-image: linear-gradient(135deg, #686d74, #47494e); }
.rank-badge.rank-or       { background-color: #6e5300; background-image: linear-gradient(135deg, #9c7a0a, #6e5300); }
.rank-badge.rank-platine  { background-color: #2c525e; background-image: linear-gradient(135deg, #497c8c, #2c525e); }
.rank-badge.rank-diamant  { background-color: #1c4572; background-image: linear-gradient(135deg, #2f68a8, #1c4572); }
.rank-badge.rank-master   { background-color: #452670; background-image: linear-gradient(135deg, #6c3fa8, #452670); }

/* Ultimate : seul palier avec un degrade anime en continu (teintes qui
   glissent lentement) en plus du reflet qui balaie deja le badge plus bas -
   la "rarete legendaire" du classement, volontairement le seul traitement
   aussi charge pour qu'il reste un signal rare, pas le bruit de fond. */
.rank-badge.rank-ultimate {
    background-color: #9c1d1d;
    background-image: linear-gradient(100deg, #9c1d1d, #c43624, #e0632f, #c43624, #9c1d1d);
    background-size: 300% 100%;
    animation: ultimate-gradient 5s ease-in-out infinite;
}

.rank-badge.rank-ultimate::before {
    content: "✦";
    font-size: 0.74em;
}

@keyframes ultimate-gradient {
    0%, 100% { background-position: 0% 0; }
    50%      { background-position: 100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .rank-badge.rank-ultimate {
        animation: none;
    }

    a.rank-badge:hover,
    a.rank-badge:focus-visible {
        transform: none;
    }
}

/*
 * Le badge "pop" avec un leger rebond juste apres que sa ligne se soit
 * revelee (voir [data-reveal] plus loin) - les deux s'enclenchent sur le
 * meme toggle .is-revealed, sans JS dedie pour le badge.
 *
 * La chaine d'ancetres est enveloppee dans :where(...) pour ne compter que
 * pour 0 en specificite : seule la classe .rank-badge pese, exactement
 * comme la regle a.rank-badge:hover plus haut - sans ca, cette regle
 * (quatre classes/attributs d'ancetres + la cible) l'emporterait toujours
 * sur le survol et le bloquerait apres la premiere revelation.
 */
:where(html.has-js [data-reveal]) .rank-badge {
    transform: scale(0.4);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--reveal-delay, 0s) + 0.12s);
}

:where(html.has-js [data-reveal].is-revealed) .rank-badge {
    transform: scale(1);
    /* Revient a la transition rapide normale (.rank-badge) une fois le pop
       joue, pour que le survol qui suit reagisse au quart de tour plutot
       que d'heriter du ressort lent + delai de l'entree. */
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
    :where(html.has-js [data-reveal]) .rank-badge {
        transform: none;
        transition: none;
    }
}

.exercise-picker {
    max-width: 360px;
}

@media (max-width: 480px) {
    .exercise-picker {
        max-width: none;
    }
}

/* ==========================================================================
   Animations de finition
   ========================================================================== */

/* ---------- Boutons : retour tactile au clic ---------- */

.btn {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
    .btn:active {
        transform: none;
    }
}

/* ---------- Messages flash : entrée en douceur ---------- */

.alert {
    animation: alert-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .alert {
        animation: none;
    }
}

/* ---------- Revele au scroll (reveal_controller.js) ---------- */

/*
 * Etat initial masque uniquement derriere .has-js (voir base.html.twig) :
 * sans JS, [data-reveal] est un selecteur sans effet, tout reste visible.
 *
 * `html.has-js` et `.is-revealed` sont enveloppes dans :where(...) : sans
 * ca, ce selectionneur (element + 2 classes/attributs) aurait une
 * specificite superieure a des regles comme .ex-card:hover ou
 * .muscle-tile:hover (1 classe + 1 pseudo-classe) et les ecraserait apres
 * la revelation (transform fige a translateY(0), hover sans effet).
 * :where() ramene toute cette chaine a specificite 0 : seul l'element
 * revele lui-meme (.ex-card, .muscle-tile, tr...) pese, exactement comme
 * s'il portait directement la regle.
 */
:where(html.has-js [data-reveal]) {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--reveal-delay, 0s);
}

:where(html.has-js [data-reveal].is-revealed) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Variante : entree laterale plutot que depuis le bas (ex. media d'une
   fiche exercice, cote a cote avec son texte qui monte normalement). */
:where(html.has-js [data-reveal][data-reveal-from="left"]) {
    transform: translateX(-32px) scale(0.98);
}

:where(html.has-js [data-reveal][data-reveal-from="left"].is-revealed) {
    transform: translateX(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
    :where(html.has-js [data-reveal]) {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Podium (3 premiers du classement général) ---------- */

.podium-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    font-weight: 700;
    color: var(--ft-muted);
}

.podium-position--1,
.podium-position--2,
.podium-position--3 {
    font-size: 1.15rem;
    font-weight: 800;
}

.podium-position--1 { color: #a6790a; }
.podium-position--2 { color: #5b5f66; }
.podium-position--3 { color: #8c5a2b; }

.podium-row td:first-child {
    position: relative;
}

.podium-row td:first-child::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 2px;
}

.podium-row--1 td:first-child::before { background-color: #a6790a; }
.podium-row--2 td:first-child::before { background-color: #5b5f66; }
.podium-row--3 td:first-child::before { background-color: #8c5a2b; }

/* ==========================================================================
   Bilan (/bilan) : banniere de rythme, tuiles KPI, calendrier, volume
   ========================================================================== */

/* ---------- Banniere "rythme en dessous de l'objectif" ---------- */

.nudge-banner__inner {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    background-color: var(--ft-accent-soft);
    border: 1px solid #f0c3ba;
    border-radius: var(--ft-radius);
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.8rem;
}

.nudge-banner__icon {
    flex: none;
    width: 30px;
    height: 30px;
    color: var(--ft-accent-text);
}

.nudge-banner__text {
    flex: 1 1 280px;
}

.nudge-banner__title {
    margin: 0 0 0.2rem;
    font-weight: 800;
    color: var(--ft-accent-text);
}

.nudge-banner__body {
    margin: 0;
    color: var(--ft-ink-soft);
    font-size: 0.92rem;
}

@media (max-width: 480px) {
    .nudge-banner__inner {
        padding: 1rem;
    }

    .nudge-banner__inner .btn {
        width: 100%;
    }
}

/* ---------- Tuiles KPI ---------- */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 860px) {
    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}

.kpi-tile {
    background-color: var(--ft-ink);
    color: #fff;
    border-radius: var(--ft-radius);
    padding: 1.6rem 1.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-top: 3px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.kpi-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(20, 22, 27, 0.22);
}

.kpi-tile--good { border-top-color: #4caf6f; }
.kpi-tile--warning { border-top-color: var(--ft-accent); }

.kpi-tile__label {
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.kpi-tile__value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
}

.kpi-tile__unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ft-accent);
    margin-left: 0.2rem;
}

.kpi-tile__meta {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
}

.kpi-tile__gauge {
    height: 6px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.kpi-tile__gauge-fill {
    height: 100%;
    width: var(--fill, 0%);
    border-radius: inherit;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-tile__gauge-fill.is-good { background-color: #4caf6f; }
.kpi-tile__gauge-fill.is-low { background-color: var(--ft-accent); }

@media (prefers-reduced-motion: reduce) {
    .kpi-tile:hover {
        transform: none;
    }
}

/* ---------- Calendrier ---------- */

.calendar-card {
    background-color: var(--ft-surface);
    border: 1px solid var(--ft-line);
    border-radius: var(--ft-radius);
    padding: 1.5rem 1.6rem 1.2rem;
    margin-bottom: 2rem;
}

/* Sur grand ecran, le conteneur fait toute la largeur de page : sans borne,
   7 colonnes etirees donnent des cases enormes. On resserre la carte. */
@media (min-width: 576px) {
    .calendar-card {
        max-width: 460px;
    }
}

.calendar-card__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1.1rem;
}

.calendar-card__title {
    min-width: 11ch;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: capitalize;
}

.calendar-nav {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    color: var(--ft-ink);
    border: 1px solid var(--ft-line);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.calendar-nav svg {
    width: 9px;
    height: 14px;
}

.calendar-nav:hover {
    background-color: var(--ft-paper);
    border-color: var(--ft-ink);
    color: var(--ft-ink);
    transform: scale(1.08);
}

.calendar-nav--disabled {
    opacity: 0.3;
    pointer-events: none;
}

.calendar-grid__weekdays {
    display: grid;
    /* minmax(0, 1fr), pas juste 1fr : sinon la largeur "min-content" de
       chaque colonne (qui depend elle-meme du contenu de .calendar-day,
       variable selon qu'il affiche un point de seance ou non) influence
       la piste, et les 7 colonnes ne font plus la meme largeur d'une
       semaine a l'autre - desalignant le numero sous son jour de la
       semaine, surtout visible sur la derniere colonne. */
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 0.4rem;
}

.calendar-grid__weekdays span {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ft-muted);
}

.calendar-grid__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    border-radius: var(--ft-radius-sm);
    transition: background-color 0.2s ease;
}

.calendar-grid__week + .calendar-grid__week {
    margin-top: 6px;
}

.calendar-grid__week.is-under-trained {
    background-color: var(--ft-accent-soft);
}

.calendar-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    aspect-ratio: 1;
    border-radius: var(--ft-radius-sm);
    color: var(--ft-ink);
    text-decoration: none;
    font-size: 0.86rem;
    transition: background-color 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calendar-day__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    line-height: 1;
}

.calendar-day.is-outside {
    color: var(--ft-muted);
    opacity: 0.4;
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px var(--ft-ink);
    font-weight: 800;
}

.calendar-day.has-session {
    background-color: var(--ft-ink);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.calendar-day.has-session.is-today {
    box-shadow: inset 0 0 0 2px var(--ft-accent);
}

.calendar-day.has-session:hover,
.calendar-day.has-session:focus-visible {
    transform: scale(1.08);
    background-color: var(--ft-accent);
    color: var(--ft-ink);
    z-index: 2;
}

.calendar-day__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--ft-accent);
}

.calendar-day.has-session:hover .calendar-day__dot,
.calendar-day.has-session:focus-visible .calendar-day__dot {
    background-color: var(--ft-ink);
}

/*
 * Jour sans seance, passe, present ou futur (planifier une sortie salle) :
 * case a cocher invisible posee sur toute la cellule (`:has()` pilote le
 * style depuis son etat coche), pour selectionner plusieurs jours avant de
 * valider en une fois avec le bouton "Enregistrer" sous le calendrier. Le
 * "+" reste discret au repos, se confirme au survol/focus, et devient une
 * coche pleine une fois coche.
 */
.calendar-day--add {
    cursor: pointer;
}

.calendar-day__checkbox {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.calendar-day--add .calendar-day__plus {
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--ft-muted);
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.calendar-day--add:hover,
.calendar-day--add:focus-within {
    background-color: var(--ft-accent-soft);
}

.calendar-day--add:hover .calendar-day__plus,
.calendar-day--add:focus-within .calendar-day__plus {
    color: var(--ft-accent-text);
    opacity: 1;
}

.calendar-day--add:has(.calendar-day__checkbox:checked) {
    background-color: var(--ft-accent);
    color: var(--ft-ink);
}

.calendar-day--add:has(.calendar-day__checkbox:checked) .calendar-day__plus {
    color: var(--ft-ink);
    opacity: 1;
}

.calendar-day--add:has(.calendar-day__checkbox:focus-visible) {
    outline: 2px solid var(--ft-ink);
    outline-offset: 2px;
}

.calendar-card__actions {
    display: flex;
    justify-content: center;
    margin-top: 1.1rem;
}

/*
 * "+" dessine en CSS (deux barres), pas en texte : un glyphe "+" seul
 * dans une boite flex se centre mal (metriques de police asymetriques
 * verticalement), ce qui le decalait visiblement en haut a gauche. Deux
 * barres positionnees en `top/left:50% + translate(-50%,-50%)` se
 * centrent au pixel pres, independamment de toute police.
 */
.legend-plus {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px dashed var(--ft-muted);
    flex: none;
}

.legend-plus::before,
.legend-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background-color: var(--ft-muted);
    transform: translate(-50%, -50%);
}

.legend-plus::before {
    width: 7px;
    height: 1.5px;
}

.legend-plus::after {
    width: 1.5px;
    height: 7px;
}

.calendar-card__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ft-line);
    font-size: 0.8rem;
    color: var(--ft-muted);
}

.calendar-card__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--ft-ink);
    flex: none;
}

.legend-tint {
    width: 14px;
    height: 9px;
    border-radius: 3px;
    background-color: var(--ft-accent-soft);
    border: 1px solid #f0c3ba;
    flex: none;
}

@media (max-width: 520px) {
    .calendar-card {
        padding: 1.2rem 0.9rem 1rem;
    }

    .calendar-grid__weekdays,
    .calendar-grid__week {
        gap: 4px;
    }

    .calendar-grid__week + .calendar-grid__week {
        margin-top: 4px;
    }

    .calendar-day {
        font-size: 0.76rem;
    }

    .calendar-card__title {
        font-size: 0.98rem;
        min-width: 9ch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-day,
    .calendar-nav {
        transition: none;
    }
}


/* ---------- Champ mot de passe : bouton "oeil" ---------- */

/*
 * Le wrapper et le bouton sont crees par
 * assets/controllers/password_reveal_controller.js, jamais par les
 * templates : rien ici ne s'affiche si le JS ne tourne pas, et le champ
 * reste un champ mot de passe normal.
 */
.password-field {
    position: relative;
    /* La largeur du champ est geree par la regle generique des formulaires
       (max-width: 460px) ; le wrapper s'y aligne pour que le bouton tombe
       bien sur le bord droit de l'input, pas sur celui du conteneur. */
    width: 100%;
    max-width: 460px;
}

/*
 * Le wrapper annule les marges du champ pour les reprendre a son compte :
 * sinon l'espacement vertical se jouerait a l'interieur du positionnement
 * relatif et le bouton serait decale vers le haut.
 */
/*
 * Les deux selecteurs sont necessaires, et c'est une affaire de
 * specificite : la regle generique des formulaires cible
 * `form input[type="password"]` (0,2,1 - un selecteur d'attribut compte
 * comme une classe), donc un simple `.password-field input` (0,1,1)
 * perdait. Le champ conservait sa marge basse de 1.1rem, le wrapper etait
 * plus haut que lui, et le bouton - centre sur toute la hauteur du
 * wrapper - tombait sous le milieu du champ. Meme cause pour
 * padding-right, qui laissait le texte saisi passer sous l'icone.
 */
form .password-field input,
.password-field input {
    margin-bottom: 0;
    /* Place pour le bouton, pour que le texte saisi ne passe pas dessous. */
    padding-right: 3rem;
}

/* La marge basse retiree au champ est reprise par le wrapper : sa hauteur
   vaut alors exactement celle du champ, et le centrage du bouton tombe
   juste. */
.password-field:has(input) {
    margin-bottom: 1.1rem;
}

.password-field__eye {
    position: absolute;
    /* Calee sur les quatre bords plutot qu'en hauteur relative : le bouton
       fait exactement la hauteur du champ quel que soit son padding, et
       `place-items: center` centre l'icone dedans dans les deux axes. */
    top: 0;
    bottom: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 2.9rem;
    padding: 0;
    border: 0;
    border-radius: 0 var(--ft-radius-sm) var(--ft-radius-sm) 0;
    background: none;
    color: var(--ft-muted);
    cursor: pointer;
    /* Supprime le delai de 300 ms et le zoom au double-tap sur mobile :
       l'appui maintenu doit reveler tout de suite. */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    transition: color 0.15s ease;
}

.password-field__eye:hover,
.password-field__eye:focus-visible {
    color: var(--ft-ink);
}

.password-field__eye:focus-visible {
    outline: 2px solid var(--ft-ink);
    outline-offset: -2px;
    border-radius: var(--ft-radius-sm);
}

.password-field__eye svg {
    width: 20px;
    height: 20px;
}

/*
 * La barre oblique n'est visible que lorsque le mot de passe est MASQUE :
 * l'icone annonce alors l'action disponible ("afficher"), et disparait une
 * fois le mot de passe en clair.
 */
.password-field.is-revealed .password-field__slash {
    opacity: 0;
}

.password-field__slash {
    transition: opacity 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
    .password-field__eye,
    .password-field__slash {
        transition: none;
    }
}

/*
 * Les labels de formulaire sont en petites capitales (regle generique
 * ci-dessus) : lisible sur "Adresse email", illisible sur une phrase
 * entiere. Un label de case a cocher EST une phrase - il reprend donc la
 * typographie du texte courant, celle de .lead-muted.
 */
form .form-check-label {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.5;
    text-transform: none;
    color: var(--ft-muted);
}

/* ---------- Inscription : mention reCAPTCHA ---------- */

/*
 * Le badge flottant de reCAPTCHA v3 est masque : il se pose en bas a droite,
 * exactement la ou vit deja la carte "Installer FitTrack". Google autorise ce
 * masquage a condition d'afficher la mention en toutes lettres - c'est
 * .auth-card__recaptcha-notice, rendu juste sous le bouton d'inscription.
 */
.grecaptcha-badge {
    visibility: hidden;
}

.auth-card__recaptcha-notice {
    margin: 1rem 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ft-muted);
}

/* ---------- Pied de page : liens legaux ---------- */

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.site-footer__legal a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-footer__legal a:hover,
.site-footer__legal a:focus-visible {
    color: #fff;
    border-bottom-color: var(--ft-accent);
}

/* ---------- Pages legales ---------- */

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.legal-nav__link {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--ft-line);
    border-radius: 999px;
    background-color: var(--ft-surface);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

.legal-nav__link.is-active {
    border-color: var(--ft-ink);
    background-color: var(--ft-ink);
    color: #fff;
}

/*
 * Colonne de lecture etroite : un texte juridique se lit en continu, et
 * au-dela d'environ 70 caracteres par ligne l'oeil perd la ligne suivante.
 */
.legal-prose {
    max-width: 68ch;
}

.legal-prose h2 {
    margin-top: 2.6rem;
    margin-bottom: 0.8rem;
    font-size: 1.35rem;
}

.legal-prose h3 {
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
    font-size: 1.05rem;
}

.legal-prose p,
.legal-prose li {
    line-height: 1.7;
}

.legal-prose ul {
    padding-left: 1.2rem;
}

.legal-prose li {
    margin-bottom: 0.5rem;
}

.legal-prose code {
    padding: 0.1em 0.4em;
    border-radius: 6px;
    background-color: rgba(20, 22, 27, 0.06);
    color: var(--ft-ink);
    font-size: 0.9em;
}

.legal-callout {
    margin-bottom: 2rem;
    padding: 1.2rem 1.4rem;
    border-left: 4px solid var(--ft-accent);
    border-radius: var(--ft-radius-sm);
    background-color: var(--ft-accent-soft);
}

.legal-callout p {
    line-height: 1.7;
}

.legal-dl {
    display: grid;
    grid-template-columns: minmax(10rem, max-content) 1fr;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0;
}

.legal-dl dt {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ft-muted);
    /* Aligne l'intitule sur la premiere ligne de sa valeur, dont la hauteur
       de ligne est plus grande. */
    padding-top: 0.15rem;
}

.legal-dl dd {
    margin: 0;
}

@media (max-width: 575px) {
    .legal-dl {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .legal-dl dd {
        margin-bottom: 0.9rem;
    }
}

/* Un paragraphe qui suit une liste de definitions a besoin d'air : colle a
   la derniere valeur, il semblerait en faire partie. */
.legal-prose .legal-dl + p {
    margin-top: 1.75rem;
}

/* Un tableau juridique ne se plie pas : il defile horizontalement plutot que
   d'ecraser ses colonnes sur mobile. */
.legal-table-wrap {
    overflow-x: auto;
    margin: 1.2rem 0;
}

.legal-table {
    width: 100%;
    min-width: 32rem;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--ft-line);
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
}

.legal-table thead th {
    border-bottom-width: 2px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ft-muted);
}

.legal-updated {
    margin-top: 3rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--ft-line);
    font-size: 0.85rem;
    color: var(--ft-muted);
}

/*
 * Valeur non renseignee dans config/packages/legal.yaml. Volontairement
 * voyante : des mentions legales incompletes mises en ligne, ca ne doit pas
 * pouvoir passer inapercu.
 */
.legal-todo {
    padding: 0.1em 0.45em;
    border-radius: 6px;
    background-color: var(--ft-accent);
    color: #fff;
    font-size: 0.85em;
    font-weight: 600;
}

/* ---------- Compte : zone de suppression ---------- */

.panel--danger {
    border-color: rgba(245, 68, 46, 0.45);
}

.panel--danger h2 {
    color: var(--ft-accent-text);
}

.account-delete-form {
    margin-top: 1.4rem;
}

.account-delete-form__check {
    max-width: 460px;
    margin-bottom: 1.2rem;
}

/* Reprend la casse normale : la regle generique des formulaires met les
   labels en capitales, illisible sur une phrase entiere de confirmation. */
.account-delete-form__check .form-check-label {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ft-ink);
}
