/* Global custom styles. Per-subdomain styles live in templates' own asset entrypoints. */

body {
    min-height: 100vh;
}

/* Required-field marker.
 * Symfony's bootstrap_5_layout form theme adds the "required" class on the <label> of any
 * field whose constraint resolves to required (default true unless 'required' => false on
 * the field). Project rule: every required field shows a red asterisk after its label.
 * Single source of truth — no per-template tweak needed. */
label.required::after,
.form-label.required::after,
legend.required::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}

/* …but not on the per-option labels of an expanded choice (radios / checkboxes).
 * The asterisk belongs on the field label only, not on every "Secondes / Répétitions / …"
 * choice. Bootstrap 5 form theme tags those with .form-check-label. */
.form-check-label.required::after,
.form-check label.required::after {
    content: none;
}

/* Input readonly piloté par un controller Stimulus de liaison (ex.
 * ascent-descent-link). Visuel "verrouillé" qui se distingue d'un input
 * vide normal sans utiliser :disabled (qui empêcherait la soumission de
 * la valeur côté form Symfony). */
input.field-locked {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}
input.field-locked:focus {
    box-shadow: none;
    border-color: #e5e7eb;
}

/* === Combobox — sélecteur filtrant (wrap d'un <select> natif) ========
 * Composant PARTAGÉ : utilisé dans tous les modules via le controller
 * Stimulus `combobox`. Le CSS vit ici (global) et non dans un CSS de
 * module — sinon le combobox apparaît non stylé (liste à puces brute)
 * sur les pages d'un autre module. Couleurs neutres via les variables
 * Bootstrap (dark mode géré automatiquement). */
.bk-combobox { position: relative; }
.bk-combobox__input {
    width: 100%;
    cursor: text;
}
.bk-combobox__list {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1080; /* au-dessus du corps d'une modale Bootstrap */
    max-height: 18rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.bk-combobox__group {
    padding: 0.35rem 0.75rem 0.3rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color, #6c757d);
    font-weight: 700;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-top: 1px solid var(--bs-border-color, #dee2e6);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
.bk-combobox__group:first-child { border-top: 0; }
.bk-combobox__item {
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--bs-body-color, #212529);
}
.bk-combobox__item:hover,
.bk-combobox__item.is-active {
    background: var(--bs-tertiary-bg, #f1f3f5);
    color: var(--bs-emphasis-color, #000);
}
/* Nœud parent non sélectionnable (arbre de comptes / catégories). */
.bk-combobox__parent {
    padding: 0.3rem 0.75rem 0.15rem 1rem;
    font-weight: 600;
    color: var(--bs-emphasis-color, #000);
    font-size: 0.85rem;
    cursor: default;
    user-select: none;
}
.bk-combobox__parent::before {
    content: '▾ ';
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.75rem;
    margin-right: 0.15rem;
}
/* Feuille enfant indentée sous son parent. */
.bk-combobox__item--child {
    padding-left: 2.25rem;
    position: relative;
}
.bk-combobox__item--child::before {
    content: '↳';
    position: absolute;
    left: 1.1rem;
    color: var(--bs-secondary-color, #6c757d);
}
