/* Shared field borders for the website, authentication, customer console and admin. */
:root {
  --form-control-border: #65545f;
  --form-control-border-hover: #8b7181;
  --form-control-focus: #ff737e;
  --form-control-radius: 6px;
}

/* Keep each view's field sizes and native checkbox, radio and picker controls. */
html:root body :is(input, select, textarea):not(
  [type="checkbox"], [type="radio"], [type="range"], [type="color"],
  [type="hidden"], [type="submit"], [type="reset"], [type="button"], [type="image"]
) {
  border: 1px solid var(--form-control-border);
  border-radius: var(--form-control-radius);
  outline: none;
  outline-offset: 0;
  box-shadow: none;
  transition: border-color 180ms ease;
}

html:root body :is(input, select, textarea):not(
  [type="checkbox"], [type="radio"], [type="range"], [type="color"],
  [type="hidden"], [type="submit"], [type="reset"], [type="button"], [type="image"]
):hover:not(:disabled):not(:focus) {
  border-color: var(--form-control-border-hover);
}

/* Recolor the existing border on focus so there is only one visible edge. */
html:root body :is(input, select, textarea):not(
  [type="checkbox"], [type="radio"], [type="range"], [type="color"],
  [type="hidden"], [type="submit"], [type="reset"], [type="button"], [type="image"]
):focus {
  border-color: var(--form-control-focus);
}

html:root body :is(input, select, textarea):not(
  [type="checkbox"], [type="radio"], [type="range"], [type="color"],
  [type="hidden"], [type="submit"], [type="reset"], [type="button"], [type="image"]
):disabled {
  border-color: #463b43;
}

/* The landing form previously used an underline and needs room inside its new border. */
.contact-form .form-input {
  padding-inline: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  html:root body :is(input, select, textarea):not(
    [type="checkbox"], [type="radio"], [type="range"], [type="color"],
    [type="hidden"], [type="submit"], [type="reset"], [type="button"], [type="image"]
  ) {
    transition: none;
  }
}
