:root {
    --portal-form-border: #78828e;
    --portal-form-focus: 2px solid #387dbb;
}

[data-bs-theme="dark"] {
    --portal-form-border: var(--bm-text-subtle);
    --portal-form-focus: 2px solid #93c5fd;
}

.form-control:not(:disabled):where(:not(.is-invalid):not(.is-valid)),
.form-select:not(:disabled):where(:not(.is-invalid):not(.is-valid)),
.form-check-input:not(:disabled):not(:checked):where(:not(.is-invalid):not(.is-valid)),
.ts-wrapper:not(.disabled) .ts-control,
.map-panel .ts-wrapper:not(.disabled) .ts-control,
.portal-auth-field input:not([role="combobox"]):not(:disabled),
.portal-auth-field select:not(:disabled),
.portal-auth-field .ts-wrapper:not(.disabled) .ts-control,
:is(.portal-report-page, .portal-map-shell [data-panel-section="report"]) .report-form-shell--portal :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea):not(:disabled) {
    border-color: var(--portal-form-border);
}

.ts-wrapper .ts-control,
.ts-dropdown .option {
    font-size: var(--tblr-body-font-size);
    color: var(--tblr-body-color);
    font-weight: 400;
    line-height: var(--tblr-body-line-height);
}

.form-control::placeholder,
.portal-auth-field input::placeholder,
.report-form-shell input::placeholder,
.report-form-shell textarea::placeholder,
.ts-wrapper .ts-control .ts-placeholder {
    color: var(--bm-text-subtle);
    opacity: 1;
}

.ts-wrapper:not(.disabled) .ts-control:hover,
.map-panel .ts-wrapper:not(.disabled) .ts-control:hover,
.portal-auth-field .ts-wrapper:not(.disabled) .ts-control:hover,
:is(.portal-report-page, .portal-map-shell [data-panel-section="report"]) .report-form-shell--portal :is(select, .report-select-affordance input):not(:disabled):hover {
    border-color: var(--portal-form-border);
}

.form-switch .form-check-input:not(:checked),
.form-switch .form-check-input:not(:checked):focus {
    --tblr-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23475569'/%3e%3c/svg%3e");
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.ts-wrapper:focus-within .ts-control,
.map-panel .ts-wrapper:focus-within .ts-control,
.portal-auth-field input:not([role="combobox"]):focus,
.portal-auth-field select:focus,
.portal-auth-field .ts-wrapper:focus-within .ts-control,
:is(.portal-report-page, .portal-map-shell [data-panel-section="report"]) .report-form-shell--portal :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    outline: var(--portal-form-focus);
    outline-offset: 2px;
    scroll-margin: 6px;
}

.portal-report-page .report-form-shell--portal .report-panel-sections {
    margin-inline: -4px;
    padding-left: 4px;
    padding-right: 4px;
}

@media (min-width: 1200px) {
    .map-panel-sections {
        margin-inline: -4px;
        padding-left: 4px;
        padding-right: calc(0.2rem + 4px);
    }

    .research-panel-sections,
    #portalMapSidebar[data-active-desktop-tab="report"] .map-panel-sections {
        padding-right: 4px;
    }

    #portalMapSidebar[data-active-desktop-tab="report"] [data-panel-section="report"] .report-form-shell--portal .report-panel-sections {
        margin-inline: -16px;
        padding-left: 4px;
        padding-right: 16px;
    }
}

@media (forced-colors: active) {
    :root,
    [data-bs-theme="dark"] {
        --bm-focus-ring: 3px solid Highlight;
        --portal-form-focus: 2px solid Highlight;
    }
}
