/* raf-autofill.css — autofilled fields keep the page's own colours.
 *
 * ** AUTOFILL INVERTED EVERY DARK FIELD. ** David, 2026-09-16, on the
 * participating-range application: "when autofill is used, it whitens the
 * background and is backwards from when it is typed in manually." A form that
 * is black-on-white in some rows and white-on-black in others reads as broken,
 * and it happens on the form a range owner fills in before agreeing to terms.
 *
 * ** THE BACKGROUND CANNOT BE SET DIRECTLY. ** Chrome paints autofilled inputs
 * with an internal `background-color` in the UA shadow layer that ordinary
 * `background` rules do not beat, whatever the specificity.
 *
 * Two things are needed, and only together:
 *
 *   1. `transition: background-color 9999s` — the background change is animated
 *      rather than applied, and the animation never arrives. The element keeps
 *      whatever background the page gave it.
 *
 *      ** A `box-shadow ... inset` WOULD ALSO HIDE IT, AND IS WRONG HERE. **
 *      That paints over the field with ONE HARD-CODED COLOUR, and these pages
 *      do not share one: page-45 uses #000, page-23 #0a0705, page-4 #0c0907.
 *      One shared file with one colour would fix the page it was written for
 *      and mis-paint the rest.
 *
 *   2. `-webkit-text-fill-color` — the TEXT colour is set the same way and
 *      needs the same treatment. Without it the background stays dark and the
 *      text goes dark with it, which is worse than the fault being fixed.
 *
 * Applied to :focus and :active as well: Chrome re-applies the styling when a
 * field is focused after being autofilled, so a rule that covers only the
 * resting state flips the colours back the moment the host clicks in.
 */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
  /* ** THE FIELD'S OWN COLOUR, NOT ITS PARENT'S. ** This said `inherit`, which takes
     the PARENT's colour. On pages 4, 17, 22 and 23 the fields are white-on-black inside
     a container whose text colour is black, so an autofilled field came out black on
     black -- David, 2026-09-17: "when I clicked on Murfreesboro, it enters it in black
     text in a black field". `currentColor` is the input's own colour, always. */
  -webkit-text-fill-color: currentColor !important;
  caret-color: currentColor;
  /* Never let the autofill background arrive. */
  transition: background-color 9999s ease-in-out 0s !important;
  /* Firefox names it outright and is straightforward. */
  filter: none;
}

/* Firefox sets its own and respects a plain declaration. */
/* ** THE STANDARD SELECTOR, AND WHY IT HAD TO CHANGE. ** This block was written for
   Firefox and said `color: inherit; background-color: inherit`. Chromium and Edge now
   support `:autofill` too, so on those browsers an autofilled field took its PARENT's
   text colour -- black, inside these dark panels -- and black-on-black is what David
   reported on 2026-09-17. The field keeps its own colour; only the autofill background
   is held off (the transition above). */
input:autofill,
select:autofill,
textarea:autofill {
  -webkit-text-fill-color: currentColor;
  filter: none;
}
