/*
 * Universal Autofill Cleaner
 * These rules only match controls currently painted by browser autofill.
 */

@keyframes uac-autofill-start {
    from { opacity: 0.99999; }
    to   { opacity: 1; }
}

/* Base cleanup: only active while the browser reports an autofill state. */
html body input.uac-autofill-control:-webkit-autofill,
html body input.uac-autofill-control:-webkit-autofill:hover,
html body input.uac-autofill-control:-webkit-autofill:focus,
html body input.uac-autofill-control:-webkit-autofill:active,
html body textarea.uac-autofill-control:-webkit-autofill,
html body textarea.uac-autofill-control:-webkit-autofill:hover,
html body textarea.uac-autofill-control:-webkit-autofill:focus,
html body textarea.uac-autofill-control:-webkit-autofill:active,
html body select.uac-autofill-control:-webkit-autofill,
html body select.uac-autofill-control:-webkit-autofill:hover,
html body select.uac-autofill-control:-webkit-autofill:focus,
html body select.uac-autofill-control:-webkit-autofill:active {
    animation-name: uac-autofill-start !important;
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;

    -webkit-text-fill-color: var(--uac-original-text, currentColor) !important;
    caret-color: var(--uac-original-caret, var(--uac-original-text, currentColor)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    filter: none !important;

    transition:
        background-color 999999s ease-in-out 0s,
        color 999999s ease-in-out 0s !important;
}

/* Hard cover: paints the detected original field/container color over UA autofill paint. */
html body input.uac-autofill-control.uac-aggressive:-webkit-autofill,
html body input.uac-autofill-control.uac-aggressive:-webkit-autofill:hover,
html body input.uac-autofill-control.uac-aggressive:-webkit-autofill:focus,
html body input.uac-autofill-control.uac-aggressive:-webkit-autofill:active,
html body textarea.uac-autofill-control.uac-aggressive:-webkit-autofill,
html body textarea.uac-autofill-control.uac-aggressive:-webkit-autofill:hover,
html body textarea.uac-autofill-control.uac-aggressive:-webkit-autofill:focus,
html body textarea.uac-autofill-control.uac-aggressive:-webkit-autofill:active,
html body select.uac-autofill-control.uac-aggressive:-webkit-autofill,
html body select.uac-autofill-control.uac-aggressive:-webkit-autofill:hover,
html body select.uac-autofill-control.uac-aggressive:-webkit-autofill:focus,
html body select.uac-autofill-control.uac-aggressive:-webkit-autofill:active {
    background-color: var(--uac-original-bg, transparent) !important;
    background-image: var(--uac-original-bg-image, none) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--uac-original-bg, transparent) inset !important;
    box-shadow: 0 0 0 1000px var(--uac-original-bg, transparent) inset !important;
    border-color: var(--uac-original-border, currentColor) !important;
}

/* Standard selector used by Firefox and newer engines. */
html body input.uac-autofill-control:autofill,
html body input.uac-autofill-control:autofill:hover,
html body input.uac-autofill-control:autofill:focus,
html body textarea.uac-autofill-control:autofill,
html body textarea.uac-autofill-control:autofill:hover,
html body textarea.uac-autofill-control:autofill:focus,
html body select.uac-autofill-control:autofill,
html body select.uac-autofill-control:autofill:hover,
html body select.uac-autofill-control:autofill:focus {
    color: var(--uac-original-text, currentColor) !important;
    caret-color: var(--uac-original-caret, var(--uac-original-text, currentColor)) !important;
    background-clip: text !important;
    filter: none !important;
}

html body input.uac-autofill-control.uac-aggressive:autofill,
html body input.uac-autofill-control.uac-aggressive:autofill:hover,
html body input.uac-autofill-control.uac-aggressive:autofill:focus,
html body textarea.uac-autofill-control.uac-aggressive:autofill,
html body textarea.uac-autofill-control.uac-aggressive:autofill:hover,
html body textarea.uac-autofill-control.uac-aggressive:autofill:focus,
html body select.uac-autofill-control.uac-aggressive:autofill,
html body select.uac-autofill-control.uac-aggressive:autofill:hover,
html body select.uac-autofill-control.uac-aggressive:autofill:focus {
    background-color: var(--uac-original-bg, transparent) !important;
    background-image: var(--uac-original-bg-image, none) !important;
    box-shadow: 0 0 0 1000px var(--uac-original-bg, transparent) inset !important;
    border-color: var(--uac-original-border, currentColor) !important;
}

/* Hidden style probe created briefly by the script. */
.uac-style-probe {
    position: fixed !important;
    inset: auto auto auto -100000px !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -2147483647 !important;
    transition: none !important;
    animation: none !important;
}
