﻿.custom-checkbox-container {
    font-weight: var(--fw-bold);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding: 0px;
    column-gap: 0.5vw;
    width: fit-content;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

    .custom-checkbox-container.disabled {
        color: var(--clr-disabled);
        cursor: default;
    }

        .custom-checkbox-container.disabled > .checkmark {
            background-color: var(--clr-disabled-background);
        }

    .custom-checkbox-container input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

    .custom-checkbox-container > span {
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 1.5rem;
        min-height: 1.5rem;
    }

.checkmark {
    top: unset;
    left: unset;
    height: 1.5rem;
    width: 1.5rem;
    background-color: var(--clr-white);
}

    .checkmark.disabled {
        background-color: var(--bs-secondary-bg);
    }

    .checkmark::after {
        content: "";
        position: absolute;
        display: none;
    }

.custom-checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.custom-checkbox-container .checkmark::after {
    top: unset;
    left: unset;
    width: 0.5rem;
    height: 1rem;
    border: solid white;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
    border-color: var(--clr-svea-2);
}

.custom-checkbox-container label {
    cursor: pointer;
    pointer-events: none;
}

    .custom-checkbox-container label.required::after {
        content: initial;
    }

    .custom-checkbox-container label.required *:last-child::after {
        color: var(--clr-red);
        content: " *";
    }

.custom-checkbox-container span.checkmark::before {
    content: initial;
}

@media(max-width: 830px) {
    .checkmark {
        width: 1rem;
        height: 1rem;
    }

    .custom-checkbox-container .checkmark:after {
        width: 0.3rem;
        height: 0.9rem;
        border-width: 0 2px 2px 0;
    }
}
