/* Public fields reserve one border and reveal it only while focused. */
body:not(.wp-admin) {
  --amethyst-field-focus: var(--smoke, #746d79);
  --amethyst-field-fill: #f8f5ee;
}

body:not(.wp-admin) :is(.team, .doctor-directory-controls, .doctor-expertise-filters, .doctor-direction-mobile),
body:not(.wp-admin)[data-space-mode="dark"] {
  --amethyst-field-focus: #bdb0c4;
  --amethyst-field-fill: #38343c;
}

body:not(.wp-admin) :is(.booking-modal, .amethyst-site-search-form) {
  --amethyst-field-focus: var(--smoke, #746d79);
}

body:not(.wp-admin) :is(.booking-modal, .amethyst-site-search-page) {
  --amethyst-field-fill: #f8f5ee;
}

body:not(.wp-admin) .header :is(#menu, .amethyst-site-search-header__panel) {
  --amethyst-field-fill: #f3f0e9;
}

/* A warm surface one tone lighter than its container, including dark themes. */
body:not(.wp-admin) :is(
  input:not([type]),
  input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]),
  textarea,
  select,
  .amethyst-select__control
):not(.amethyst-select__native):not([hidden]):not(:where(#wpadminbar *)) {
  background-color: var(--amethyst-field-fill) !important;
}

/* Important declarations replace the older component borders and focus rings.
 * Existing validation errors, disabled fields and the hidden select source keep
 * their own presentation. Backgrounds, padding and dimensions stay contextual. */
body:not(.wp-admin) :is(
  input:not([type]),
  input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]),
  textarea,
  select,
  .amethyst-select__control
):not(.amethyst-select__native):not(:disabled):not([hidden]):not(:where(#wpadminbar *)):not(:is([aria-invalid="true"], .is-invalid, .invalid, .error, .wpcf7-not-valid, .has-error *, .error *, :user-invalid)) {
  border: 1px solid transparent !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

body:not(.wp-admin) :is(
  input:not([type]),
  input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]),
  textarea,
  select,
  .amethyst-select__control
):not(.amethyst-select__native):not(:disabled):not([hidden]):not(:where(#wpadminbar *)):not(:is([aria-invalid="true"], .is-invalid, .invalid, .error, .wpcf7-not-valid, .has-error *, .error *, :user-invalid)):is(:focus, :focus-visible) {
  border-color: var(--amethyst-field-focus, #746d79) !important;
}

/* Booking fields previously had only a bottom border and no side padding. */
body:not(.wp-admin) #booking :is(
  input:not([type]),
  input:is([type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]),
  textarea,
  select
):not(.amethyst-select__native):not(:disabled):not([hidden]) {
  padding-inline: 12px;
}

/* The symptom search previously drew an additional line on its wrapper. */
body:not(.wp-admin) .patients-hero__search > div,
body:not(.wp-admin) .patients-hero__search > div:focus-within {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}
