/* =========================================================
   Déclaration à France Judo — logo de marque, session de
   déclaration (choix du périmètre, carrousel, bilan).
   POC validé : design-poc/declaration-france-judo.html
   ========================================================= */

/* ---------------- Logo de marque (twig:Media:FranceJudoLogo) ----------------
   L'encre France Judo est un indigo profond : sur le fond sombre elle disparaît.
   On la pose donc toujours sur une pastille blanche, ce qui vaut aussi charte. */
.fj-logo {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.fj-logo img { display: block; width: auto; }
.fj-logo--xs { width: 19px; height: 19px; padding: 2px; border-radius: 5px; }
.fj-logo--xs img { height: 14px; }
.fj-logo--sm { width: 24px; height: 24px; padding: 2px; border-radius: 6px; }
.fj-logo--sm img { height: 19px; }
.fj-logo--badge { width: 44px; height: 44px; padding: 5px; border-radius: 12px; }
.fj-logo--badge img { height: 32px; }
/* Seule taille où le mot-symbole reste lisible : réservée aux en-têtes de modale. */
.fj-logo--hero { padding: 0.65rem 0.85rem; border-radius: 14px; }
.fj-logo--hero img { height: 62px; }

/* ---------------- Pastille de compteur dans un bouton ---------------- */
.ui-btn__count {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 0.3rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--warning-soft);
    color: var(--warning);
    border: 1px solid rgba(224, 171, 51, 0.35);
}

/* ---------------- La modale de session ----------------
   Plus large que les tailles du composant twig:Modal : une fiche fédérale tient
   mal en dessous, on relirait mal les valeurs qu'on recopie à côté. */
.modal-dialog.modal--xl { max-width: 760px; }
/* Le frame et son conteneur Stimulus s'effacent de la mise en page : l'en-tête, le
   corps et les pieds doivent rester enfants directs de la colonne .modal-content,
   sinon le corps défilant de Bootstrap n'a plus de hauteur à occuper. */
#federation-declaration-frame,
#federation-declaration-frame > .fj-session { display: contents; }

/* ---------------- Étape 1 : le périmètre ---------------- */
.fj-scopes { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.4rem 0 0.2rem; }
.fj-scope {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
a.fj-scope:hover { background: var(--surface-2-hov); border-color: var(--gold); color: var(--text); text-decoration: none; }
.fj-scope-nm { flex: 1 1 auto; font-size: 0.9rem; font-weight: 600; }
.fj-scope-nb {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid rgba(224, 171, 51, 0.3);
    border-radius: 999px;
    padding: 0.05rem 0.55rem;
}
.fj-scope .ui-ic { color: var(--text-faint); width: 14px; height: 14px; }
.fj-scope.is-all { background: var(--gold-soft); border-color: rgba(230, 201, 138, 0.3); }
.fj-scope.is-all .fj-scope-nm { color: var(--gold-strong); }
.fj-scope.is-static { opacity: 0.6; }
.fj-note { font-size: 0.8rem; color: var(--text-faint); margin: 0.9rem 0 0; }
.fj-hint { font-size: 0.78rem; color: var(--text-faint); }

/* ---------------- Étape 2 : la file ----------------
   Le carrousel masque et révèle par l'attribut HTML `hidden`, qui ne pèse rien face
   à un `display` d'auteur : les pieds (.modal-footer), les boutons (.ui-btn) et le
   drapeau « Déclaré » resteraient visibles. On le réaffirme sur tout le frame. */
#federation-declaration-frame [hidden] { display: none !important; }

.fj-rail { display: flex; align-items: center; gap: 0.28rem; flex-wrap: wrap; padding: 0 1.4rem 0.2rem; }
.fj-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    color: var(--text-faint);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fj-dot:hover { border-color: var(--gold); }
.fj-dot.is-done { background: var(--success-soft); border-color: rgba(79, 174, 139, 0.45); color: var(--success); }
.fj-dot.is-skip { opacity: 0.5; }
.fj-dot.is-current { background: var(--gold-fill); border-color: var(--gold-fill); color: var(--gold-ink); transform: scale(1.15); }
.fj-rail-sep { width: 1px; height: 16px; background: var(--border-strong); margin: 0 0.25rem; }

.fj-card { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; }
.fj-ident { display: flex; align-items: center; gap: 0.75rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border); }
.fj-av {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
}
.fj-nm { flex: 1 1 auto; min-width: 0; }
.fj-nm b { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.fj-nm span { font-size: 0.8rem; color: var(--text-muted); }
.fj-done-flag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--success); }
.fj-done-flag .ui-ic { width: 14px; height: 14px; }

.fj-grp { margin-top: 0.9rem; }
.fj-grp > h4 {
    font-size: 0.68rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
    margin: 0 0 0.3rem;
}
.fj-row { display: flex; align-items: baseline; gap: 0.7rem; padding: 0.28rem 0; border-top: 1px solid var(--border); }
.fj-grp > .fj-row:first-of-type { border-top: 0; }
.fj-lb { flex: 0 0 130px; font-size: 0.78rem; color: var(--text-faint); }
.fj-vl { flex: 1 1 auto; min-width: 0; font-size: 0.92rem; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.fj-vl small { display: block; font-size: 0.76rem; font-weight: 400; color: var(--text-faint); }
.fj-vl .m-stat { font-size: 0.88rem; }
.fj-vl .m-stat .ui-ic { width: 14px; height: 14px; }
/* Trou réel au dossier : l'extranet peut le réclamer. */
.fj-row.is-missing .fj-vl { color: var(--danger); font-size: 0.85rem; }
/* Donnée qu'EspaceClub ne collecte pas : information, pas anomalie. */
.fj-row.is-na .fj-vl { color: var(--text-faint); font-weight: 400; font-size: 0.85rem; }

/* Provenance : le club doit voir qu'il saisit le téléphone du parent, pas celui de l'enfant. */
.fj-from {
    display: inline-block;
    margin-left: 0.45rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid rgba(230, 201, 138, 0.28);
    border-radius: 999px;
    padding: 0.02rem 0.42rem;
    vertical-align: 0.1em;
}

.fj-cp {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.fj-row:hover .fj-cp { border-color: var(--border); }
.fj-cp:hover { color: var(--gold-strong); background: var(--gold-soft); border-color: var(--border-strong); }
.fj-cp.is-copied { color: var(--success); background: var(--success-soft); border-color: rgba(79, 174, 139, 0.4); }
.fj-cp .ui-ic { width: 13px; height: 13px; }

.fj-inp {
    display: inline-block;
    width: 100%;
    max-width: 250px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.28rem 0.55rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.fj-inp:focus { outline: none; border-color: var(--gold); background: var(--surface-2-hov); }
.fj-inp::placeholder { color: var(--text-faint); font-weight: 400; font-size: 0.82rem; }
.fj-saved { margin-left: 0.5rem; font-size: 0.74rem; color: var(--success); }

.fj-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0.9rem 0 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
    color: var(--warning);
    background: var(--warning-soft);
    border: 1px solid rgba(224, 171, 51, 0.3);
    border-radius: var(--radius-sm);
}
.fj-warn .ui-ic { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 0.15rem; }
.fj-warn a { color: var(--gold-strong); text-decoration: underline; }

.fj-actions { display: flex; align-items: center; gap: 0.6rem; }
.fj-keys { margin: -0.5rem 0 0; padding: 0 1.4rem 1.2rem; text-align: right; font-size: 0.75rem; color: var(--text-faint); }
.fj-keys kbd {
    font-family: inherit;
    font-size: 0.7rem;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    padding: 0.02rem 0.3rem;
    color: var(--text-muted);
}

/* ---------------- Étape 3 : le bilan ---------------- */
.fj-recap-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 0.5rem 0 1rem; }
.fj-recap-st { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; }
.fj-recap-st .n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.fj-recap-st .l { font-size: 0.74rem; color: var(--text-muted); }
.fj-recap-st.is-done .n { color: var(--success); }
.fj-recap-st.is-skip .n { color: var(--text-faint); }
.fj-recap-st.is-left .n { color: var(--gold-strong); }
.fj-recap-title { font-size: 0.8rem; color: var(--text-faint); margin: 0 0 0.45rem; }
.fj-recap-list { display: flex; flex-direction: column; gap: 0.3rem; }
.fj-recap-li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.fj-recap-li .nm { flex: 1 1 auto; }
.fj-recap-li .ct { font-size: 0.75rem; color: var(--text-faint); }

@media (max-width: 640px) {
    .fj-row { flex-wrap: wrap; }
    .fj-lb { flex: 1 1 100%; }
    .fj-recap-stats { grid-template-columns: 1fr; }
    .fj-keys { text-align: left; }
}
