/* WooCommerce can override the background independently of Customizer text colors.
 * Keep an opaque dark background paired with readable text in both form systems.
 * Do not target checkboxes, radio buttons, hidden inputs or submit buttons.
 */
:is(.woocommerce form, .um .um-form) :is(
  input:not([type]),
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="number"], input[type="url"], input[type="search"],
  input[type="date"], input[type="time"], input[type="datetime-local"],
  textarea, select
) {
  background-color: #2d2d2d !important;
  color: #f5f5f5 !important;
  -webkit-text-fill-color: currentColor !important;
  caret-color: #f5f5f5 !important;
  color-scheme: dark;
}

:is(.woocommerce form, .um .um-form) :is(input, textarea)::placeholder {
  color: #b6b6b6 !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 1;
}

/* A translucent inset shadow lets the browser's light autofill surface show through.
 * :is() keeps the rule valid when a browser only supports one autofill spelling.
 */
:is(.woocommerce form, .um .um-form) :is(input, textarea, select):is(:autofill, :-webkit-autofill) {
  -webkit-text-fill-color: #f5f5f5 !important;
  caret-color: #f5f5f5 !important;
  -webkit-box-shadow: 0 0 0 1000px #2d2d2d inset !important;
  box-shadow: 0 0 0 1000px #2d2d2d inset !important;
}

.woocommerce form .show-password-input {
  color: #f5f5f5 !important;
}

/* The login consent notice also inherits light text on a plugin-supplied white box. */
.woocommerce .itsec-recaptcha-opt-in {
  background-color: #2d2d2d !important;
  color: #e5e5e5 !important;
}
