/* Shared native controls: keep browser semantics, validation and mobile pickers. */
html body select {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--amga-line, var(--input, #c8d3df));
    border-radius: 10px;
    padding: 10px 14px;
    font: inherit;
    font-size: .9375rem;
    font-weight: 450;
    line-height: 1.4;
    color: var(--amga-ink, var(--auth-ink, var(--foreground, #14254c)));
    background-color: var(--card, #fff);
    box-shadow: 0 1px 2px rgb(20 37 76 / 4%);
    transition: border-color .15s, box-shadow .15s;
}

/* Strong enough to keep the same arrow when individual form sections set a background. */
html body select:not([multiple]):is(:not([size]), [size="1"]) {
    -webkit-appearance: none;
    appearance: none;
    min-height: 44px;
    border: 1px solid var(--amga-line, var(--input, #c8d3df));
    border-radius: 10px;
    padding: 10px 42px 10px 14px;
    background-color: var(--card, #fff);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%2353627a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
    cursor: pointer;
}

html[dir="rtl"] body select:not([multiple]):is(:not([size]), [size="1"]) {
    padding-right: 14px;
    padding-left: 42px;
    background-position: left 12px center;
}

html body select:not([multiple]):is(.kt-select-sm, .kt-select-xs) {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: .8125rem;
}

html body select[multiple], html body select[size]:not([size="1"]) {
    background-image: none;
    padding: 10px 12px;
}

html body select:enabled:hover {
    border-color: var(--amga-primary, var(--auth-brand, #527a9c));
}

html body select:focus-visible,
html body select:not([multiple]):focus-visible {
    border-color: var(--amga-primary, var(--auth-brand, #2563eb));
    outline: 3px solid var(--amga-secondary, var(--auth-brand, #93c5fd));
    outline-offset: 2px;
    box-shadow: 0 0 0 1px var(--amga-primary, var(--auth-brand, #2563eb));
}

html body select[aria-invalid="true"], html body select:not([multiple])[aria-invalid="true"] { border-color: #b42318; }
html body select:disabled, html body select:not([multiple]):disabled { opacity: .6; cursor: not-allowed; }

html.dark body select:not([multiple]):is(:not([size]), [size="1"]),
html body.dark select:not([multiple]):is(:not([size]), [size="1"]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%23b8c8db' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (forced-colors: active) {
    html body select:not([multiple]):is(:not([size]), [size="1"]) {
        -webkit-appearance: auto;
        appearance: auto;
        background-image: none !important;
        padding-inline-end: 14px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body select { transition: none; }
}
