/*
 * Identité visuelle MAGICFIT (§5 du cahier des charges).
 *
 * DM Sans et Playfair Display sont auto-hébergées, jamais chargées depuis
 * Google Fonts : la CSP l'interdit (font-src 'self') et le RGPD le déconseille.
 * Les @font-face vivent dans fonts.css, chargée seulement si les fichiers sont
 * présents (voir public/fonts/LISEZ-MOI.md). Les piles ci-dessous replient donc
 * proprement sur les polices système tant qu'ils ne sont pas déposés.
 */
:root {
    --accent: #b0c41f;
    --accent-dark: #8ea016;
    --fond: #f4f6ed;
    --texte: #1a1a1a;
    --gris: #6b6f5e;
    --danger: #e74c3c;
    --vide: #e8eadf;
    --blanc: #ffffff;
    --rayon: 12px;
    --ombre: 0 1px 3px rgba(26, 26, 26, 0.08);

    --police-texte: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --police-titre: "Playfair Display", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--police-texte);
    font-size: 16px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
    font-family: var(--police-titre);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

h1 {
    font-size: 1.75rem;
}

a {
    color: var(--accent-dark);
}

/* Mobile d'abord : les coachs utilisent l'app sur téléphone, en salle. */
.conteneur {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.carte {
    background: var(--blanc);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.entete {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--blanc);
    border-bottom: 3px solid var(--accent);
}

.entete__titre {
    font-family: var(--police-titre);
    font-size: 1.25rem;
    margin: 0;
}

.pastille {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--texte);
    font-size: 0.8rem;
    font-weight: 600;
}

.pastille--vide {
    background: var(--vide);
    color: var(--gris);
}

.discret {
    color: var(--gris);
    font-size: 0.9rem;
}

.liste-etapes {
    margin: 0;
    padding-left: 1.1rem;
}

.liste-etapes li {
    margin-bottom: 0.35rem;
}

.bouton {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    border: 0;
    border-radius: var(--rayon);
    background: var(--accent);
    color: var(--texte);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    /* Cible tactile confortable */
    min-height: 44px;
}

.bouton:hover,
.bouton:focus {
    background: var(--accent-dark);
}

/* Formulaires */
.champ {
    display: block;
    margin-bottom: 1rem;
}

.champ > span {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.champ input {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--vide);
    border-radius: var(--rayon);
    background: var(--blanc);
    color: var(--texte);
    font-family: inherit;
    font-size: 1rem;
    /* 44 px de haut minimum : saisie confortable sur téléphone. */
    min-height: 44px;
}

.champ input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.case {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Message neutre par défaut : sans modificateur, il doit tout de même ressembler
   à un message et non à un paragraphe légèrement décalé. */
.message {
    padding: 0.7rem 0.9rem;
    border-radius: var(--rayon);
    border-left: 4px solid var(--gris);
    background: var(--fond);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}

.message--succes {
    background: var(--vide);
    border-left: 4px solid var(--accent);
}

.message--erreur {
    background: #fdecea;
    border-left: 4px solid var(--danger);
    color: #8c2f26;
}

.qr-code {
    display: inline-block;
    padding: 0.75rem;
    background: var(--blanc);
    border: 1px solid var(--vide);
    border-radius: var(--rayon);
    margin-bottom: 1rem;
}

.qr-code svg {
    display: block;
    width: 180px;
    height: 180px;
}

/* Navigation du personnel */
.navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--blanc);
    border-bottom: 1px solid var(--vide);
}

.navigation a,
.navigation .lien-bouton {
    font-weight: 600;
    font-size: 0.95rem;
}

.navigation form {
    margin-left: auto;
}

/* Bouton d'apparence lien, pour les formulaires d'action */
.lien-bouton {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-dark);
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.bouton--danger {
    background: var(--danger);
    color: var(--blanc);
}

.bouton--danger:hover,
.bouton--danger:focus {
    background: #c0392b;
}

.carte__entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.carte__entete h1,
.carte__entete h2 {
    margin: 0;
}

/* Les tableaux larges défilent dans leur conteneur, jamais la page. */
.tableau-defilant {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tableau th,
.tableau td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--vide);
    vertical-align: top;
}

.tableau th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gris);
}

.tableau .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.tableau .detail {
    max-width: 22rem;
    color: var(--gris);
}

.pastille--danger {
    background: var(--danger);
    color: var(--blanc);
}

.filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.filtres .actif {
    font-weight: 700;
    text-decoration: none;
}

.recherche {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.recherche .champ {
    flex: 1 1 14rem;
    margin-bottom: 0;
}

.champ select {
    display: block;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--vide);
    border-radius: var(--rayon);
    background: var(--blanc);
    color: var(--texte);
    font-family: inherit;
    font-size: 1rem;
    min-height: 44px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

/* Carte de fidélité */
.tampons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.tampon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--vide);
    color: var(--gris);
    font-weight: 700;
    font-size: 0.95rem;
}

.tampon--valide {
    background: var(--accent);
    color: var(--texte);
}

.compteur {
    margin: 0 0 0.75rem;
    font-family: var(--police-titre);
    font-size: 2.2rem;
    line-height: 1;
}

/* Trois compteurs de synthèse côte à côte (espace client).
   Mobile d'abord : ils tiennent sur une ligne de téléphone et se replient
   proprement si la largeur manque. */
.synthese {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

.synthese__bloc {
    flex: 1 1 6rem;
    padding: 0.75rem 0.5rem;
    background: var(--fond);
    border-radius: var(--rayon);
    text-align: center;
}

.synthese__valeur {
    display: block;
    font-family: var(--police-titre);
    font-size: 1.8rem;
    line-height: 1.1;
}

.synthese__libelle {
    display: block;
    margin-top: 0.2rem;
    color: var(--gris);
    font-size: 0.85rem;
}

.citation {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    background: var(--fond);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-style: italic;
}

.actions-carte {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.activite {
    margin: 0 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--vide);
    font-size: 0.95rem;
}

/* Grille du plan repas */
.tableau textarea {
    width: 100%;
    min-width: 12rem;
    padding: 0.5rem;
    border: 1px solid var(--vide);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.tableau textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.macros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Grille d'édition d'un programme : champs compacts dans un tableau. */
.tableau input[type="text"],
.tableau input[type="number"] {
    width: 100%;
    min-width: 6rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--vide);
    border-radius: 8px;
    background: var(--blanc);
    color: var(--texte);
    font-family: inherit;
    font-size: 0.9rem;
}

.tableau input[type="text"] {
    min-width: 9rem;
}

.tableau input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.macros .champ {
    flex: 1 1 8rem;
    margin-bottom: 0;
}

.seance {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--vide);
}

.seance:last-of-type {
    border-bottom: 0;
}

.seance p {
    margin: 0 0 0.5rem;
}

.seance .actions-carte {
    margin: 0;
}

.activite:last-child {
    border-bottom: 0;
}

/* Formulaire posé dans le fil du texte (bouton « relancer » d'une ligne).
   En classe et non en style= : la CSP interdit les styles en ligne. */
.en-ligne {
    display: inline;
}

/* Commande à recopier dans un terminal (écran des sauvegardes).
   Défile dans son cadre : une commande longue ne doit pas élargir la page. */
.commande {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    overflow-x: auto;
    background: var(--fond);
    border: 1px solid var(--vide);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Administration du dossier ---------------------------------------------
   Transfert, export, anonymisation, suppression : des gestes rares, dont deux
   sont irréversibles. Sans distinction, ils défilaient avec exactement le même
   poids visuel que la carte de fidélité ou le carnet d'entraînement. */
.zone-admin {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--vide);
}

.zone-admin__titre {
    margin: 0 0 0.25rem;
    font-family: var(--police-titre);
    font-size: 1.15rem;
}

.zone-admin__intro {
    margin: 0 0 1rem;
    color: var(--gris);
    font-size: 0.9rem;
}

/* Fond de page plutôt que blanc : ces cartes reculent d'un plan. */
.carte--admin {
    background: var(--fond);
    border: 1px solid var(--vide);
    box-shadow: none;
}

/* Irréversible : liseré rouge, pour qu'on voie où l'on met les doigts. */
.carte--danger {
    border-left: 4px solid var(--danger);
}

h3 {
    margin-top: 1.5rem;
    font-size: 1.05rem;
}

@media (min-width: 768px) {
    .conteneur {
        padding: 2rem 1.5rem 4rem;
    }

    h1 {
        font-size: 2.1rem;
    }
}
