/*
 * Centralized browser-autofill override for the CWAT CRM.
 *
 * Chrome/Edge/Safari force a white background + black text on any input
 * the browser autofills (saved email/password, address, etc.), which
 * breaks the dark CWAT theme. There is no way to unset that background
 * directly - the standard fix is to paint over it with a huge inset
 * box-shadow (any solid color works, animation delay keeps it from
 * flashing white first) and force the text color separately.
 *
 * Loaded once by application/views/partial/header.php (all dashboard
 * pages: Users, Email, Template, Schedule, Import, Modules, Settings,
 * Category, etc. - anywhere that extends the shared header/footer) and
 * once each by the three standalone auth pages (home.php/signup.php/
 * forgot_password.php), which don't load the dashboard header at all.
 *
 * Colors intentionally match both contexts without needing their CSS
 * variables: falls back to the CWAT navy (#0F172A) used by
 * --rwm-header-bg (theme-modern.css, dashboard) and --cwat-navy
 * (auth pages), and picks up the real variable when it's in scope.
 */

.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active,
.auth-input-group input:-webkit-autofill,
.auth-input-group input:-webkit-autofill:hover,
.auth-input-group input:-webkit-autofill:focus,
.auth-input-group input:-webkit-autofill:active {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px var(--rwm-header-bg, #0F172A) inset;
    box-shadow: 0 0 0 1000px var(--rwm-header-bg, #0F172A) inset;
    transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
    caret-color: #fff;
}

/* Firefox (52+) - no white-flash issue, but normalizes the tinted
   "remembered value" background to match instead of the browser default. */
.form-control:autofill,
.auth-input-group input:autofill {
    -webkit-text-fill-color: #fff;
    background-color: var(--rwm-header-bg, #0F172A);
    color: #fff;
    caret-color: #fff;
}
