/* CENTER CRM 0.11.37 — global form-control geometry and focus alignment. */
:root {
    --center-control-accent: #f6c543;
    --center-control-focus: rgba(246, 197, 67, .82);
    --center-control-focus-soft: rgba(246, 197, 67, .10);
}

/* Keep browser controls inside their declared geometry. This prevents the
   project-wide input padding/min-height rules from stretching native
   checkboxes and radios into tall rectangular focus boxes. */
:where(input, select, textarea, button) {
    box-sizing: border-box;
}

:where(input[type="checkbox"], input[type="radio"]) {
    box-sizing: border-box !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin-block: 0;
    box-shadow: none !important;
    vertical-align: middle;
    accent-color: var(--center-control-accent);
}

:where(input[type="checkbox"], input[type="radio"]):focus {
    box-shadow: none !important;
}

:where(input[type="checkbox"], input[type="radio"]):focus-visible {
    outline: 2px solid var(--center-control-focus) !important;
    outline-offset: 3px !important;
}

:where(input[type="checkbox"], input[type="radio"]):not(:focus-visible) {
    outline: none;
}

/* Bootstrap/legacy aliases used on older CENTER CRM forms get the same reset. */
:where(.form-check-input, .form-radio-input) {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Consistent keyboard focus for editable controls. Page-level border/shadow
   styling is preserved; this only replaces the browser's uneven default ring. */
:where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select,
    textarea
):focus-visible {
    outline: 2px solid var(--center-control-focus) !important;
    outline-offset: 2px !important;
}

/* Buttons and button-like controls receive the same compact focus geometry.
   Plain text links are intentionally not touched. */
:where(button, .button, [role="button"]):focus-visible {
    outline: 2px solid var(--center-control-focus) !important;
    outline-offset: 2px !important;
}

:where(button, .button, [role="button"]):focus:not(:focus-visible) {
    outline: none;
}

/* Hidden proxy inputs must stay physically hidden even when older generic
   input rules assign width, height or padding. */
:where(input[type="hidden"], input[hidden]) {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Switches may use checkbox semantics but are visually custom. Reset only the
   inherited padding/min-height; their component styles continue to own size. */
:where(input[type="checkbox"][role="switch"]) {
    padding: 0 !important;
    min-height: 0 !important;
}
