/* One checkbox appearance across forms, tables, filters, and account screens.
   The native input remains responsible for selection, focus, and form submission. */
:root {
    --checkbox-size: 22px;
    --checkbox-radius: 7px;
    --checkbox-color: #2f8f8a;
    --checkbox-border: #cbd5e1;
    --checkbox-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='m6 11 3.2 3.2L16 7.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --checkbox-mixed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Cpath d='M6 11h10' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Visible native checkboxes; switch inputs and existing visual wrappers are excluded. */
html input[type="checkbox"]:not(:where(.table-checkbox input, .access-role-option input, .project-team-option input, .filter-option input, .login-remember input, .access-switch-field input)) {
    appearance: none;
    -webkit-appearance: none;
    width: var(--checkbox-size) !important;
    height: var(--checkbox-size) !important;
    flex: 0 0 var(--checkbox-size);
    padding: 0;
    border: 1.5px solid var(--checkbox-border);
    border-radius: var(--checkbox-radius);
    background-color: #fff;
    background-image: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: var(--checkbox-size);
    vertical-align: middle;
    cursor: pointer;
}

/* Keep existing component markup and event handlers, sharing the same visual box. */
html :is(.table-checkbox, .access-role-option, .project-team-option, .filter-option, .login-remember):has(input[type="checkbox"])
    :is(.table-checkbox > span, .access-role-option__check, .project-team-option__check, .filter-option__check, .login-checkbox) {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    flex: 0 0 var(--checkbox-size);
    border: 1.5px solid var(--checkbox-border);
    border-radius: var(--checkbox-radius);
    background-color: #fff;
    background-image: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: var(--checkbox-size);
    color: transparent;
    cursor: pointer;
}

html .table-checkbox:not(.ui-checkbox--labelled) {
    width: var(--checkbox-size);
    height: var(--checkbox-size);
}

html :is(.table-checkbox > span, .access-role-option__check, .project-team-option__check, .filter-option__check, .login-checkbox) > i {
    display: none;
}

html .filter-option__check::after,
html .filter-option input:checked + .filter-option__check::after {
    content: none;
}

html input[type="checkbox"]:checked:not(:where(.table-checkbox input, .access-role-option input, .project-team-option input, .filter-option input, .login-remember input, .access-switch-field input)),
html :is(.table-checkbox, .access-role-option, .project-team-option, .filter-option, .login-remember):has(input[type="checkbox"]:checked)
    :is(.table-checkbox > span, .access-role-option__check, .project-team-option__check, .filter-option__check, .login-checkbox) {
    border-color: var(--checkbox-color);
    background-color: var(--checkbox-color);
    background-image: var(--checkbox-tick);
}

html input[type="checkbox"]:indeterminate:not(:where(.table-checkbox input, .access-role-option input, .project-team-option input, .filter-option input, .login-remember input, .access-switch-field input)),
html :is(.table-checkbox, .access-role-option, .project-team-option, .filter-option, .login-remember):has(input[type="checkbox"]:indeterminate)
    :is(.table-checkbox > span, .access-role-option__check, .project-team-option__check, .filter-option__check, .login-checkbox) {
    border-color: var(--checkbox-color);
    background-color: var(--checkbox-color);
    background-image: var(--checkbox-mixed);
}

html input[type="checkbox"]:focus-visible:not(:where(.table-checkbox input, .access-role-option input, .project-team-option input, .filter-option input, .login-remember input, .access-switch-field input)),
html :is(.table-checkbox, .access-role-option, .project-team-option, .filter-option, .login-remember):has(input[type="checkbox"]:focus-visible)
    :is(.table-checkbox > span, .access-role-option__check, .project-team-option__check, .filter-option__check, .login-checkbox) {
    outline: 3px solid color-mix(in srgb, var(--checkbox-color) 25%, transparent);
    outline-offset: 3px;
}

html input[type="checkbox"]:disabled:not(:where(.table-checkbox input, .access-role-option input, .project-team-option input, .filter-option input, .login-remember input, .access-switch-field input)),
html :is(.table-checkbox, .access-role-option, .project-team-option, .filter-option, .login-remember):has(input[type="checkbox"]:disabled)
    :is(.table-checkbox > span, .access-role-option__check, .project-team-option__check, .filter-option__check, .login-checkbox) {
    opacity: .5;
    cursor: not-allowed;
}
