/* Shared frontend form presentation. Page-specific and validation styles remain authoritative. */
:root {
    --zep-form-height: 44px;
    --zep-form-radius: 8px;
    --zep-form-border: #cfd8e3;
    --zep-form-text: #344054;
    --zep-form-placeholder: #8a94a6;
    --zep-form-focus: #3082c5;
    --zep-form-focus-ring: rgba(48, 130, 197, .14);
}

:where(body.form-ui-theme) form .form-group label:not(.custom-control-label):not(.form-check-label):not(.radio-inline):not(.checkbox-inline),
:where(body.form-ui-theme) form label.control-label {
    display: inline-block;
    margin-bottom: 6px;
    color: #243044;
    font-family: "Open Sans", sans-serif;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4;
}

:where(body.form-ui-theme) form input.form-control:not([type="hidden"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]),
:where(body.form-ui-theme) form select.form-control:not([multiple]) {
    height: var(--zep-form-height);
    min-height: var(--zep-form-height);
}

:where(body.form-ui-theme) form input.form-control:not([type="hidden"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]),
:where(body.form-ui-theme) form select.form-control,
:where(body.form-ui-theme) form textarea.form-control {
    border: 1px solid var(--zep-form-border);
    border-radius: var(--zep-form-radius);
    background-color: #fff;
    color: var(--zep-form-text);
    font-family: "Open Sans", sans-serif;
    font-size: 14px !important;
    line-height: 1.45;
    padding: 10px 12px;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

:where(body.form-ui-theme) form textarea.form-control {
    min-height: 110px;
    height: auto;
    resize: vertical;
}

:where(body.form-ui-theme) form select.form-control[multiple] {
    min-height: 110px;
    height: auto;
}

:where(body.form-ui-theme) form input.form-control[type="date"],
:where(body.form-ui-theme) form input.form-control[type="datetime-local"],
:where(body.form-ui-theme) form input.form-control[type="month"] {
    padding-right: 10px;
}

:where(body.form-ui-theme) form .form-control::placeholder {
    color: var(--zep-form-placeholder);
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    opacity: 1;
}

:where(body.form-ui-theme) form .form-control:focus {
    border-color: var(--zep-form-focus);
    outline: 0;
    box-shadow: 0 0 0 3px var(--zep-form-focus-ring);
}

:where(body.form-ui-theme) form .form-control:disabled,
:where(body.form-ui-theme) form .form-control[readonly] {
    background-color: #f5f7fa;
}

/* Select2: style generated controls only; initialization and data behavior stay untouched. */
:where(body.form-ui-theme) .select2-container {
    max-width: 100%;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
}

:where(body.form-ui-theme) .select2-container--default .select2-selection--single {
    min-height: var(--zep-form-height);
    border: 1px solid var(--zep-form-border);
    border-radius: var(--zep-form-radius);
    background-color: #fff;
}

:where(body.form-ui-theme) .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--zep-form-text);
    line-height: 42px;
    padding-left: 12px;
    padding-right: 36px;
}

:where(body.form-ui-theme) .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 6px;
    height: 42px;
}

:where(body.form-ui-theme) .select2-container--default .select2-selection--multiple {
    min-height: var(--zep-form-height);
    border: 1px solid var(--zep-form-border);
    border-radius: var(--zep-form-radius);
    background-color: #fff;
    padding: 3px 6px;
}

:where(body.form-ui-theme) .select2-container--default.select2-container--focus .select2-selection--single,
:where(body.form-ui-theme) .select2-container--default.select2-container--focus .select2-selection--multiple,
:where(body.form-ui-theme) .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--zep-form-focus);
    box-shadow: 0 0 0 3px var(--zep-form-focus-ring);
}

:where(body.form-ui-theme) .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-top: 3px;
    border-color: #d9e3ec;
    border-radius: 5px;
    background: #eef4f9;
    color: var(--zep-form-text);
}

:where(body.form-ui-theme) .select2-container--default .select2-search--inline .select2-search__field {
    min-height: 28px;
    margin-top: 3px;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
}

/* Chosen: match normal controls while retaining its native search and selection behavior. */
:where(body.form-ui-theme) .chosen-container {
    max-width: 100%;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
}

:where(body.form-ui-theme) .chosen-container-single .chosen-single {
    height: var(--zep-form-height);
    border: 1px solid var(--zep-form-border);
    border-radius: var(--zep-form-radius);
    background: #fff;
    box-shadow: none;
    color: var(--zep-form-text);
    line-height: 42px;
    padding-left: 12px;
}

:where(body.form-ui-theme) .chosen-container-single .chosen-single div {
    width: 28px;
}

:where(body.form-ui-theme) .chosen-container-single .chosen-single div b {
    background-position-y: 12px;
}

:where(body.form-ui-theme) .chosen-container-multi .chosen-choices {
    min-height: var(--zep-form-height);
    border: 1px solid var(--zep-form-border);
    border-radius: var(--zep-form-radius);
    background: #fff;
    box-shadow: none;
    padding: 3px 6px;
}

:where(body.form-ui-theme) .chosen-container-active .chosen-single,
:where(body.form-ui-theme) .chosen-container-active .chosen-choices {
    border-color: var(--zep-form-focus);
    box-shadow: 0 0 0 3px var(--zep-form-focus-ring);
}

:where(body.form-ui-theme) .chosen-container-multi .chosen-choices li.search-choice {
    margin-top: 4px;
    border-color: #d9e3ec;
    border-radius: 5px;
    background: #eef4f9;
    box-shadow: none;
    color: var(--zep-form-text);
}

:where(body.form-ui-theme) .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
    min-height: 30px;
    font-family: "Open Sans", sans-serif;
    font-size: 14px;
}

@media (max-width: 575.98px) {
    :root {
        --zep-form-height: 42px;
    }

    :where(body.form-ui-theme) .select2-container--default .select2-selection--single .select2-selection__rendered,
    :where(body.form-ui-theme) .chosen-container-single .chosen-single {
        line-height: 40px;
    }

    :where(body.form-ui-theme) .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 40px;
    }
}
