.checkbox {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox__legend {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--aok-grey-2);
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

.checkbox__group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    width: -moz-fit-content;
    width: fit-content;
}

.checkbox__input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--aok-grey-5);
    border-radius: 0.25rem;
    background-color: var(--aok-white);
    cursor: pointer;
    transition: all 0.2s ease-out;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.checkbox__input:focus {
    outline: none;
    border-color: var(--aok-green);
    box-shadow: 0 0 0 2px rgba(0, 94, 63, 0.1);
}

.checkbox__input:checked {
    background-color: var(--aok-white);
}

.checkbox__input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.375rem;
    height: 0.625rem;
    border: solid var(--aok-black);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.checkbox__input:disabled {
    border-color: var(--aok-white);
    background-color: var(--aok-grey-1);
    cursor: not-allowed;
}

.checkbox__input:disabled:checked {
    background-color: var(--aok-grey-1);
}

.checkbox__input:disabled:checked::after {
    border-color: var(--aok-grey-5);
}

.checkbox__input:disabled + .checkbox__label {
    color: var(--aok-grey);
    cursor: not-allowed;
}

.checkbox__label {
    font-size: 1rem;
    color: var(--aok-black);
    line-height: 1.4;
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

/* Error state for checkbox */
.checkbox--error .checkbox__input {
    border-color: var(--aok-green);
}

.checkbox--error .checkbox__input:focus {
    border-color: var(--aok-green);
    box-shadow: 0 0 0 2px rgba(0, 94, 63, 0.2);
}

.checkbox--error .checkbox__input:checked {
    border-color: var(--aok-green);
    background-color: var(--aok-green);
}

/* Error message component */
.checkbox__error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem 0;
    border-radius: 0.25rem;
}

.checkbox__error-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--aok-green);
}

.checkbox__error-message {
    font-size: 0.875rem;
    color: var(--aok-green);
    line-height: 1.4;
}
