/* Keep the legacy DGA snippet's two-pixel underline, anchored from the first frame. */
body.qu-reference :is(
    input:not([type]),
    input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="password"], [type="search"],
             [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]),
    textarea, select, .dga-dropdown__btn
) {
    background-image: linear-gradient(var(--qu-field-line, var(--ink)), var(--qu-field-line, var(--ink))) !important;
    background-repeat: no-repeat !important;
    background-position: center bottom !important;
    background-size: 0% 2px !important;
    transition: background-size .3s ease-in-out;

    &:focus,
    &.dga-dropdown__btn.open {
        border-color: var(--qu-field-border, var(--border-neutral-primary)) !important;
        outline: none !important;
        box-shadow: none !important;
        background-size: 100% 2px !important;
    }
}

body.qu-reference .search-dialog input[type="search"]:autofill {
    -webkit-text-fill-color: var(--ink);
    box-shadow: inset 0 0 0 100px var(--surface) !important;
}

body.qu-reference .search-dialog input[type="search"]:autofill:focus {
    box-shadow: inset 0 -2px 0 var(--ink), inset 0 0 0 100px var(--surface) !important;
}

.qu-reference .frm_forms.frm_style_formidable-style {
    --qu-field-border: var(--border-color, var(--border-neutral-primary));
}

.qu-reference .frm_forms.frm_style_formidable-style :is(
    input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="password"], [type="search"]),
    textarea
) {
    font-size: var(--font-sm) !important;
}

.qu-reference .frm_forms.frm_style_formidable-style input:is(
    [type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="password"], [type="search"]
) {
    min-height: var(--control-height);
    height: auto;
}

.qu-reference .frm_forms.frm_style_formidable-style :is(
    .frm_blank_field :is(input:not([type="hidden"]), textarea, select), input[aria-invalid="true"],
    textarea[aria-invalid="true"], select[aria-invalid="true"]
) {
    --qu-field-line: var(--border-color-error, #f04438);
    --qu-field-border: var(--qu-field-line);
    border-color: var(--qu-field-border) !important;
}

@media (forced-colors: active) {
    body.qu-reference :is(
        input:not([type]),
        input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="number"], [type="password"], [type="search"],
                 [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]),
        textarea, select, .dga-dropdown__btn
    ):focus-visible {
        outline: 2px solid Highlight !important;
        outline-offset: -2px;
    }
}
