.input_groep {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 0 0 .5rem 0;

    label {
        position: relative;
        z-index: 2;
        margin: 0 1rem;
        padding: 0 .5rem;
        font-weight: bold;
        background: var(--background);
        width: max-content;
        transform: translateY(.4rem);
        margin-top: -.4rem;
    }

    input {
        background-color: var(--background);
        padding-inline: .7rem;
        border-radius: 1rem;
        align-content: center;
        max-width: 40rem;
        width: 100%;
        border: solid 2px oklch(0 0 0 / .25);
        height: 2rem;
        transition: border-color 0.2s ease;
    }

    input:focus {
        outline: none;
        border-color: oklch(0 0 0 / 1);
    }

    /* Textarea styling (zelfde als input) */
    textarea {
        background-color: var(--background);
        padding: .5rem .7rem;
        border-radius: 1rem;
        max-width: 40rem;
        width: 100%;
        border: solid 2px oklch(0 0 0 / .25);
        font-family: inherit;
        font-size: inherit;
        resize: vertical;
        min-height: 6rem;
        transition: border-color 0.2s ease;
    }

    textarea:focus {
        outline: none;
        border-color: oklch(0 0 0 / 1);
    }

    /* Error message - altijd zichtbaar maar transparant als er geen error is */
    .message.error {
        color: oklch(0.628 0.2577 29.23);
        font-size: 0.85rem;
        min-height: 1.25rem; /* Vaste hoogte voor error message */
        margin-top: 0.25rem;
        margin-left: 0.7rem;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .zoekbox {
        width: 100%;
        position: relative;
    }

    .zoek_icon {
        position: absolute;
        cursor: pointer;
        padding: .4em;
        margin-right: .3em;
        opacity: 0.25;
        right: 0;
        top: 0;
        height: 100%;
        width: auto;
    }

    input:focus + .zoek_icon {
        opacity: 1;
    }

    input.niet-gevonden + .zoek_icon {
        opacity: 1;
        filter: invert(13%) sepia(58%) saturate(6980%) hue-rotate(356deg) brightness(108%) contrast(119%);
    }
}

/* Error state voor input groep */
.input_groep.has-error {
    input,
    textarea {
        border-color: oklch(0.628 0.2577 29.23);
    }

    input:focus,
    textarea:focus {
        border-color: oklch(0.628 0.2577 29.23);
    }

    .message.error {
        opacity: 1;
    }
}

/* Checkbox groep styling */
.input_groep.checkbox_groep {
    margin-top: 1rem;

    .groep-label {
        transform: none;
        margin: 0 0 .5rem 0;
        padding: 0;
    }

    .checkbox-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        border-radius: 1rem;
        width: 100%;
        max-width: 40rem;
    }

    .checkbox-label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        cursor: pointer;
        font-weight: normal;
        transform: none;
        margin: 0;
        padding: 0.25rem 0;
        background: transparent;
        position: relative;
        z-index: 1;
    }

    /* Verberg originele checkbox */
    .checkbox-label input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }

    /* Custom checkbox */
    .checkbox-custom {
        height: 1.25rem;
        width: 1.25rem;
        min-width: 1.25rem;
        background: var(--background);
        border: solid 2px oklch(0 0 0 / .25);
        border-radius: 0.35rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.15s ease;
    }

    /* Checkmark */
    .checkbox-custom::after {
        content: '';
        display: none;
        width: 0.35rem;
        height: 0.65rem;
        border: solid white;
        border-width: 0 2.5px 2.5px 0;
        transform: rotate(45deg) translateY(-1px);
    }

    /* Hover state */
    .checkbox-label:hover .checkbox-custom {
        border-color: oklch(0 0 0 / .5);
    }

    /* Focus state */
    .checkbox-label input[type="checkbox"]:focus + .checkbox-custom {
        border-color: oklch(0 0 0 / 1);
    }

    /* Checked state */
    .checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
        background: oklch(0.45 0.15 250);
        border-color: oklch(0.45 0.15 250);
    }

    .checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
        display: block;
    }

    /* Checked + hover */
    .checkbox-label:hover input[type="checkbox"]:checked + .checkbox-custom {
        background: oklch(0.35 0.15 250);
        border-color: oklch(0.35 0.15 250);
    }
}