/* ============================================================
   ITM-SYSTEM - Form controls
   ============================================================ */

/* FORM_LAYOUT.md: columns, widths, breakpoints and gutters belong to Bootstrap. */
.itm-form-row > [class*="col-"] { min-width: 0; }
.itm-form-row .form-label,
.itm-form-row .form-text,
.itm-form-row .invalid-feedback { overflow-wrap: anywhere; }
.itm-form { min-width: 0; }
.itm-form-field { min-width: 0; }
.itm-form-field > .form-label,
.itm-form-field > label:not(.form-check-label) {
    display: block;
    min-height: 0;
    margin: 0 0 .5rem;
}
.itm-form-field > .itm-form-label-contained { margin-bottom: 0; }
.itm-form-label-text { display: block; margin-bottom: .5rem; }
.itm-form-field .form-text,
.itm-form-field .invalid-feedback,
.itm-form-field .itm-form-status { margin-top: .25rem; margin-bottom: 0; }
.itm-form-field .form-text:empty,
.itm-form-field .invalid-feedback:empty,
.itm-form-field .itm-form-status:empty { display: none; }
.itm-form-row + .itm-form-row,
.itm-form-row + [data-billing-address-fields] { margin-top: 0; }
.itm-form-section + .itm-form-section { margin-top: 2rem; }
.itm-form-row + .itm-form-section { margin-top: 2rem; }
.itm-form ~ .itm-form-section { margin-top: 2rem; }
.itm-form-section-title { margin: 2rem 0 1rem; }
.itm-form-section > .itm-form-section-title:first-child,
.itm-form > .itm-form-section-title:first-child { margin-top: 0; }
.itm-form-section > :last-child { margin-bottom: 0; }
[data-billing-address-fields] > .itm-form-row:first-child { margin-top: 0; }
.itm-form .itm-form-actions { margin-top: 2rem; }
.itm-form-row .input-group { width: 100%; }
.itm-form-row .itm-btn { max-width: 100%; min-height: 42px; height: auto; white-space: normal; }

.form-control,
.form-select,
.itm-form-control,
.itm-form-select {
    box-sizing: border-box;
    height: 42px;
    min-height: 42px;
    padding: 0.625rem 1rem;
    border: 1px solid #b7c6d8;
    border-radius: 8px;
    background-color: #ffffff;
    color: #293548;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
}

.form-select,
.itm-form-select {
    padding-right: 2.5rem;
    background-position: right 1rem center;
}

/* Segmentierte Formularauswahl in derselben Höhe wie Eingabefelder. */
.itm-segmented-control {
    display: flex;
    width: 100%;
    height: 42px;
}

.itm-segmented-control > .btn {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
}

.itm-segmented-control > .btn-check:checked + .btn-outline-secondary,
.itm-segmented-control > .btn-check:checked + .btn-outline-secondary:focus {
    box-shadow: none;
}

textarea.form-control,
textarea.itm-form-control {
    height: auto;
    min-height: 96px;
    resize: vertical;
}

.form-control:focus,
.form-select:focus,
.itm-form-control:focus,
.itm-form-select:focus {
    border-color: #245fae;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(36, 95, 174, 0.18);
}

.itm-form-control-icon {
    padding-right: 3rem;
    padding-left: 3rem;
}

.form-control.itm-form-control-action {
    padding-right: 3rem;
}

.form-control.itm-form-control-icon-start {
    padding-left: 2.5rem;
}

.search-container .bi {
    top: 50%;
    transform: translateY(-50%);
}
.itm-checkbox-select {
    position: relative;
}

.itm-checkbox-select > summary {
    list-style: none;
}

.itm-checkbox-select > summary::-webkit-details-marker {
    display: none;
}

.itm-checkbox-select-trigger {
    align-items: center;
    background: var(--bs-body-bg, #fff);
    border: 1px solid #b7c6d8;
    border-radius: 8px;
    color: var(--bs-body-color, #212529);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: .875rem;
    font-weight: 500;
    height: 42px;
    min-height: 42px;
    padding: .625rem 1rem;
    width: 100%;
}

.itm-checkbox-select-trigger:focus-visible,
.itm-checkbox-select[open] .itm-checkbox-select-trigger {
    border-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
    outline: 0;
}

.itm-checkbox-select[open] .itm-checkbox-select-trigger .bi-chevron-down {
    transform: rotate(180deg);
}

.itm-checkbox-select-menu {
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #ced4da);
    border-radius: var(--bs-border-radius, .375rem);
    box-shadow: 0 .75rem 2rem rgba(30, 48, 76, .14);
    left: 0;
    margin-top: .375rem;
    max-height: 18rem;
    min-width: 100%;
    overflow-y: auto;
    padding: .5rem;
    position: absolute;
    right: 0;
    z-index: 1050;
}

.itm-checkbox-select-option {
    align-items: center;
    border-radius: .375rem;
    display: flex;
    gap: .625rem;
    margin: 0;
    min-height: 2.75rem;
    padding: .5rem .75rem;
}

.itm-checkbox-select-option:hover,
.itm-checkbox-select-option:focus-within {
    background: var(--bs-tertiary-bg, #f4f7fb);
}

.itm-checkbox-select-option .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

.itm-checkbox-select-option .form-check-label {
    cursor: pointer;
    flex: 1;
}

.itm-checkbox-select-empty {
    color: var(--bs-secondary-color, #6c757d);
    margin: 0;
    padding: .75rem;
}

@media (max-width: 575.98px) {
    .itm-checkbox-select-menu {
        max-height: min(18rem, 50vh);
    }
}
