/* Global focus normalization: pointer clicks stay clean; keyboard focus stays accessible. */
:root {
    --forte-focus-color: #fc8507;
    --forte-focus-soft: rgba(252, 133, 7, .18);
}

:where(a, button, summary, [role="button"], [tabindex], .btn, .nav-link, .page-link):focus:not(:focus-visible),
:where(a, button, summary, [role="button"], [tabindex], .btn, .nav-link, .page-link).focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

:where(a, button, summary, [role="button"], [tabindex], .btn, .nav-link, .page-link):focus-visible {
    outline: 2px solid var(--forte-focus-color) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, .form-control, .form-select, .custom-select):focus {
    outline: none !important;
    border-color: var(--forte-focus-color) !important;
    box-shadow: 0 0 0 3px var(--forte-focus-soft) !important;
}

:where(input[type="checkbox"], input[type="radio"], input[type="range"], .form-check-input, .custom-control-input):focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}

:where(input[type="checkbox"], input[type="radio"], input[type="range"], .form-check-input, .custom-control-input):focus-visible {
    outline: 2px solid var(--forte-focus-color) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

.custom-control-input:focus:not(:focus-visible) ~ .custom-control-label::before,
.custom-file-input:focus:not(:focus-visible) ~ .custom-file-label,
.select2-container--focus .select2-selection {
    box-shadow: none !important;
}

.custom-control-input:focus-visible ~ .custom-control-label::before {
    border-color: var(--forte-focus-color) !important;
    box-shadow: 0 0 0 3px var(--forte-focus-soft) !important;
}

@media (forced-colors: active) {
    :where(a, button, input, textarea, select, summary, [role="button"], [tabindex]):focus-visible {
        outline-color: Highlight !important;
    }
}
