/* Shared checkbox styling for EasyAdmin, custom pages and standalone forms.
   Boolean switches keep their native EasyAdmin switch layout. */
input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input) {
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 13px 13px;
    border: 1px solid #c9d3df;
    border-radius: 5px;
    box-shadow: none;
    box-sizing: border-box;
    color: #508FFE;
    cursor: pointer;
    display: inline-block;
    flex: 0 0 18px;
    height: 18px;
    padding: 0;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
    vertical-align: middle;
    width: 18px;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):hover:not(:disabled) {
    background-color: #EDF5FF;
    border-color: #508FFE;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):checked,
input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):indeterminate {
    background-color: #508FFE;
    border-color: #508FFE;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3 8l3 3 7-7'/%3E%3C/svg%3E");
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):indeterminate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='white' stroke-width='2.5' stroke-linecap='round' d='M4 8h8'/%3E%3C/svg%3E");
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):is(:checked, :indeterminate):hover:not(:disabled) {
    background-color: #3c7ced;
    border-color: #3c7ced;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):focus-visible {
    border-color: #508FFE;
    box-shadow: 0 0 0 3px rgb(80 143 254 / 20%);
    outline: 2px solid #508FFE;
    outline-offset: 2px;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):disabled {
    background-color: #ecf0f5;
    border-color: #d9e1ec;
    cursor: not-allowed;
    opacity: 1;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):disabled:is(:checked, :indeterminate) {
    background-color: #a7bfe7;
    border-color: #a7bfe7;
}

input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input):is(.is-invalid, [aria-invalid="true"]) {
    border-color: #dc3545;
}

@media (prefers-reduced-motion: reduce) {
    input[type="checkbox"] {
        transition: none;
    }
}

@media (forced-colors: active) {
    input[type="checkbox"]:not([role="switch"]):not(.ea-switch-input):not(.form-switch input) {
        appearance: auto;
        background-image: none;
        border-color: ButtonText;
        color: ButtonText;
        forced-color-adjust: auto;
    }
}
