/* =========================================================
   Page « Inscrire une personne » (Mon espace) — qui inscrire
   + dans quel club sur un seul écran.
   POC validé : design-poc/inscrire-une-personne.html
   Tokens : tokens.css
   ========================================================= */

.register-person .rp-lead {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 76ch;
    margin: 0 0 1.3rem;
}

.rp-empty {
    border: 1px solid var(--border);
    background: var(--surface-1);
    border-radius: var(--radius);
    padding: 1.2rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ---- Inscription déjà en cours : un seul brouillon par compte ---- */
.rp-pending {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--gold);
    background: var(--surface-1);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
}
.rp-pending > .ui-ic { flex: 0 0 auto; color: var(--gold-strong); width: 18px; height: 18px; }
.rp-pending-text { flex: 1 1 260px; font-size: 0.82rem; color: var(--text-muted); }
.rp-pending-text b { display: block; color: var(--text); font-size: 0.88rem; }

/* ---- Les deux panneaux ---- */
.rp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1rem;
    align-items: start;
}

.rp-panel {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 1rem 1.05rem 1.1rem;
}
.rp-panel-h { display: flex; align-items: baseline; gap: 0.5rem; margin: 0 0 0.15rem; }
.rp-panel-h h2 { font-size: 0.98rem; margin: 0; }
.rp-num {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold-ink);
    background: var(--gold-fill);
}
.rp-hint { font-size: 0.78rem; color: var(--text-faint); margin: 0.35rem 0 0.85rem; }
.rp-sub {
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 700;
    margin: 1.1rem 0 0.5rem;
}
.rp-panel .rp-sub:first-of-type { margin-top: 0; }

/* ---- Carte sélectionnable (personne ou club) ---- */
.rp-pick {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.7rem;
    transition: border-color 0.15s, background-color 0.15s;
}
.rp-pick + .rp-pick { margin-top: 0.45rem; }
.rp-pick:hover { background: var(--surface-2-hov); border-color: var(--border-strong); }
.rp-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.rp-pick--new { align-items: flex-start; }

.rp-dot-radio {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    position: relative;
}
.rp-dot-radio.is-hidden { visibility: hidden; }
.rp-pick:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.rp-pick:has(input:checked) .rp-dot-radio { border-color: var(--gold); }
.rp-pick:has(input:checked) .rp-dot-radio::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--gold);
}
.rp-pick:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Raccourcis « Vos clubs » : ce sont des boutons (deux radios de même nom ne peuvent pas
   être cochées ensemble), leur état suit la sélection de la liste. */
.rp-quick { font-family: inherit; text-align: left; color: inherit; }
.rp-pick.is-on { border-color: var(--gold); background: var(--gold-soft); }
.rp-pick.is-on .rp-dot-radio { border-color: var(--gold); }
.rp-pick.is-on .rp-dot-radio::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--gold);
}

/* Le filtre masque par l'attribut `hidden`, que le display:flex de la carte emporterait. */
.rp-pick[hidden],
.rp-club-empty[hidden] { display: none; }

.rp-body { flex: 1 1 auto; min-width: 0; }
.rp-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-size: 0.86rem;
    font-weight: 600;
}
.rp-meta { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.05rem; }
.rp-dot { color: var(--text-faint); margin: 0 0.25rem; }

.rp-av,
.rp-ico,
.rp-club-pill {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--gold-strong);
    background: var(--gold-soft);
    border: 1px solid var(--border-strong);
}
.rp-av { width: 34px; height: 34px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; }
.rp-ico { width: 30px; height: 30px; border-radius: 8px; }
.rp-ico .ui-ic { width: 16px; height: 16px; }
.rp-club-pill {
    position: relative;
    overflow: hidden;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.78rem;
    font-weight: 700;
}
.rp-club-pill img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.rp-rel {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.02rem 0.45rem;
}

.rp-state {
    flex: 0 0 auto;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.08rem 0.5rem;
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    background: var(--surface-3);
}
.rp-state.renew { color: var(--warning); background: var(--warning-soft); border-color: rgba(224, 171, 51, 0.35); }
.rp-state.ok { color: var(--success); background: var(--success-soft); border-color: rgba(79, 174, 139, 0.35); }

/* Carte non sélectionnable : licence déjà à jour, ou inscription à reprendre. */
.rp-pick.is-off { cursor: default; background: transparent; border-style: dashed; }
.rp-pick.is-off:hover { background: transparent; border-color: var(--border); }
.rp-pick.is-off .rp-name,
.rp-pick.is-off .rp-meta { opacity: 0.8; }

.rp-see { flex: 0 0 auto; font-size: 0.72rem; color: var(--text-faint); }
.rp-see:hover { color: var(--gold-strong); }

/* ---- Sélecteur de club : recherche, filtres, liste ---- */
.rp-search { position: relative; margin-top: 0.2rem; }
.rp-search .ui-ic {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-faint);
}
.rp-search input {
    width: 100%;
    font-family: inherit;
    font-size: 0.84rem;
    color: var(--text);
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem 0.5rem 2.1rem;
}
.rp-search input:focus { outline: none; border-color: var(--gold); }
.rp-search input::placeholder { color: var(--text-faint); }

.rp-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.6rem 0 0.7rem; }
.rp-chip {
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    cursor: pointer;
}
.rp-chip:hover { color: var(--text); background: var(--surface-2-hov); }
.rp-chip.is-on { color: var(--gold-strong); background: var(--gold-soft); border-color: var(--gold); }

.rp-club-list { max-height: 330px; overflow: auto; padding-right: 0.2rem; }
.rp-club-row .rp-body { min-width: 0; }
.rp-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.25rem; }
.rp-tag {
    font-size: 0.66rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.02rem 0.4rem;
}
.rp-club-empty { font-size: 0.8rem; color: var(--text-faint); padding: 0.9rem 0.2rem; }

/* ---- Barre de lancement ---- */
.rp-bar {
    position: sticky;
    bottom: 0;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-1);
    box-shadow: var(--shadow);
    padding: 0.75rem 0.95rem;
}
.rp-recap { font-size: 0.84rem; min-width: 0; color: var(--text-muted); }
.rp-recap b { color: var(--text); }
.rp-recap .rp-todo { color: var(--text-faint); }
.rp-recap .rp-recap-sub { display: block; font-size: 0.74rem; color: var(--text-faint); margin-top: 0.1rem; }
.rp-acts { display: flex; gap: 0.5rem; }

@media (max-width: 860px) {
    .rp-grid { grid-template-columns: 1fr; }
    .rp-bar { flex-direction: column; align-items: stretch; }
    .rp-acts { justify-content: flex-end; }
}

/* Téléphone : la pastille d'état (ou l'action) passe sous le texte, sinon le nom
   et les méta se retrouvent compressés sur une colonne d'un mot. */
@media (max-width: 560px) {
    .rp-pick { flex-wrap: wrap; row-gap: 0.4rem; }
    .rp-pick .rp-body { flex: 1 1 calc(100% - 74px); }
    .rp-pick .rp-state,
    .rp-pick .rp-see,
    .rp-pick > .ui-btn { order: 3; margin-left: auto; }
    .rp-club-list { max-height: none; }
}
