/* =========================================================
   Page "Tarifs & réductions" (hub Paramètres du club) — barème de réduction famille.
   Réutilise .pc-* (parametres-club.css), .switch (course-details.css), .ui-* (button.css).
   Tokens : tokens.css.
   ========================================================= */

.cfr-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.1rem; align-items: start; }
.cfr-card { margin-bottom: 1.1rem; }
.cfr-sub { font-size: 0.84rem; color: var(--text-muted); margin: 0.2rem 0 1rem; }

/* Interrupteur d'activation */
.cfr-switch-row {
    display: flex; align-items: center; gap: 0.7rem; cursor: pointer;
    padding: 0.2rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.cfr-switch-label { font-size: 0.92rem; font-weight: 500; }
.cfr-switch-label small { display: block; font-size: 0.78rem; color: var(--text-faint); font-weight: 400; }

/* Barème désactivé : on grise sans masquer, le club voit ce qu'il réactiverait */
.cfr-scale-block.is-off { opacity: 0.45; }

/* Lignes de paliers */
.cfr-scale { display: flex; flex-direction: column; gap: 0.55rem; }
.cfr-tier {
    position: relative; display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
    background: var(--surface-3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.6rem 0.7rem;
}
.cfr-grp { display: inline-flex; align-items: center; gap: 0.45rem; }
.cfr-lbl { font-size: 0.86rem; color: var(--text-muted); }
.cfr-push { margin-left: auto; }

.cfr-num {
    display: inline-flex; align-items: center;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: 8px; overflow: hidden;
}
.cfr-num input {
    width: 54px; background: transparent; border: 0; color: var(--text);
    text-align: center; padding: 0.42rem 0.2rem; font: inherit; font-size: 0.92rem; font-weight: 600;
    -moz-appearance: textfield;
}
.cfr-num input::-webkit-outer-spin-button,
.cfr-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cfr-num input:focus { outline: none; }
.cfr-num:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.cfr-num .unit { font-size: 0.82rem; color: var(--text-faint); padding-right: 0.55rem; }

.cfr-del {
    display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto;
    border-radius: 8px; background: transparent; border: 1px solid transparent;
    color: var(--text-faint); cursor: pointer;
}
.cfr-del:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-strong); }
.cfr-del .ui-ic { width: 14px; height: 14px; }
/* Un seul palier : il ne se supprime pas (l'interrupteur sert à vider le barème) */
.cfr-scale.is-single .cfr-del { visibility: hidden; }

.cfr-add {
    display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.7rem;
    font: inherit; font-size: 0.85rem; font-weight: 500; color: var(--gold-strong);
    background: transparent; border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm); padding: 0.5rem 0.85rem; cursor: pointer;
}
.cfr-add:hover { background: var(--hover); border-color: var(--gold); }
.cfr-add .ui-ic { width: 14px; height: 14px; }
.cfr-add[disabled] { opacity: 0.4; cursor: not-allowed; }

.cfr-note {
    display: flex; gap: 0.55rem; font-size: 0.8rem; color: var(--text-muted); margin: 1rem 0 0;
    background: var(--surface-3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.65rem 0.8rem;
}
.cfr-note .ui-ic { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 3px; color: var(--gold); }
.cfr-note strong { color: var(--text); font-weight: 600; }

/* Phrase de synthèse : ce que verront les familles */
.cfr-summary {
    margin-top: 1.1rem; padding: 0.85rem 1rem; border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(230, 201, 138, 0.09), rgba(230, 201, 138, 0.03));
    border: 1px solid var(--border-strong); font-size: 0.88rem;
}
.cfr-summary-title {
    font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--gold); font-weight: 700; margin-bottom: 0.25rem;
}
.cfr-summary-value b { color: var(--gold-strong); }

.cfr-actions { margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }

/* Simulation */
.cfr-sim-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.cfr-sim-head .pc-card-title { margin-right: auto; }
.cfr-stepper {
    display: inline-flex; align-items: center; background: var(--surface-3);
    border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden;
}
.cfr-stepper button {
    width: 28px; height: 28px; background: transparent; border: 0;
    color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1;
}
.cfr-stepper button:hover { background: var(--hover); color: var(--text); }
.cfr-stepper .val { min-width: 2.3rem; text-align: center; font-size: 0.86rem; font-weight: 600; }

.cfr-sim-rows { display: flex; flex-direction: column; gap: 0.35rem; }
.cfr-sim-row {
    display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem;
    padding: 0.45rem 0.6rem; border-radius: 8px; background: var(--surface-3);
}
.cfr-sim-row .who { display: flex; align-items: center; gap: 0.5rem; }
.cfr-sim-row .rk {
    width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px;
    display: grid; place-items: center; font-size: 0.7rem; font-weight: 700;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted);
}
.cfr-sim-row.has-cut .rk { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-strong); }
.cfr-sim-row .cut { margin-left: auto; color: var(--gold-strong); font-weight: 600; }
.cfr-sim-row .pay { min-width: 4.2rem; text-align: right; font-weight: 600; }

.cfr-sim-total {
    display: flex; align-items: baseline; gap: 0.6rem;
    margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid var(--border);
}
.cfr-sim-total .lbl { font-size: 0.85rem; color: var(--text-muted); }
.cfr-sim-total .amt { margin-left: auto; font-size: 1.25rem; font-weight: 700; }
.cfr-sim-eco { border-top: 0; margin-top: 0.15rem; padding-top: 0; }
.cfr-sim-eco .amt { font-size: 0.95rem; color: var(--success); }
.cfr-sim-note { font-size: 0.76rem; color: var(--text-faint); margin: 0.7rem 0 0; }
.cfr-sim-note strong { color: var(--text-muted); font-weight: 600; }

/* Pass Sport : rappel en lecture seule */
.cfr-readonly { background: var(--surface-3); border-style: dashed; }
.cfr-ro-title { font-size: 0.95rem; }
.cfr-ro-tag {
    margin-left: auto; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-faint); font-weight: 600; border: 1px solid var(--border);
    border-radius: 5px; padding: 0.1rem 0.4rem;
}
.cfr-ro-line { display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem; color: var(--text-muted); }
.cfr-ro-line .amt { margin-left: auto; font-weight: 600; color: var(--gold-strong); }
.cfr-ro-sub { margin: 0.6rem 0 0; }

@media (max-width: 1100px) {
    .cfr-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    /* 2 lignes propres (rang / montant), corbeille dans l'angle */
    .cfr-tier { gap: 0.45rem 0.5rem; padding-right: 2.5rem; }
    .cfr-push { display: none; }
    .cfr-del { position: absolute; top: 0.4rem; right: 0.35rem; }
    .cfr-actions .ui-btn { width: 100%; justify-content: center; }
}
