/* Shared field focus, loaded after component styles in every form layout.
   Focus-only !important rules intentionally supersede legacy page outlines/shadows.
   Each editable control has one inset edge; composite controls own that edge. */
:root{--ff-focus:#0b5a4e;--ff-bad:#b42318;--ff-ease:cubic-bezier(.2,.7,.2,1)}

/* Do not change dimensions on focus or apply text-field styling to checkboxes,
   radios, uploads, sliders or buttons. Their keyboard indicators remain native. */
:is(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=submit],[type=button],[type=reset],[type=image],[type=hidden],[type=color]),select,textarea){
  caret-color:var(--ff-focus);
  -webkit-tap-highlight-color:transparent;
  transition:border-color .16s var(--ff-ease),background-color .16s var(--ff-ease);
}
:is(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=submit],[type=button],[type=reset],[type=image],[type=hidden],[type=color]),select,textarea):focus{
  border-color:var(--ff-focus)!important;
  outline:2px solid var(--ff-focus)!important;
  outline-offset:-2px!important;
  box-shadow:none!important;
}

/* The outer shell owns focus for fields with icons or attached controls.
   Use :focus (not just :focus-visible) to cover mouse, touch and keyboard. */
:is(.sbd-ctl,.intake-phone,.signup-password,.inbox-search,.affiliate-copy,.special-amount,.svc-search,.search-field,.about-float,.blog-search,.wz-field,.wz-price,.price-inputs>label,.nearby-search,.reservation-form label):focus-within{
  border-color:var(--ff-focus)!important;
  outline:2px solid var(--ff-focus)!important;
  outline-offset:-2px!important;
  box-shadow:none!important;
}
:is(.sbd-ctl,.intake-phone,.signup-password,.inbox-search,.affiliate-copy,.special-amount,.svc-search,.search-field,.about-float,.blog-search,.wz-field,.wz-price,.price-inputs>label,.nearby-search,.reservation-form label) :is(input,select,textarea):focus{
  outline:none!important;
  box-shadow:none!important;
  border-color:transparent!important;
}

/* The placeholder softens when you start typing instead of vanishing with a jolt. */
:where(input,textarea)::placeholder{transition:opacity .16s var(--ff-ease)}
:where(input,textarea):focus::placeholder{opacity:.55}

/* Autofill keeps the field's own look instead of the browser's yellow or blue flash. */
:where(input,select,textarea):-webkit-autofill,
:where(input,select,textarea):-webkit-autofill:hover,
:where(input,select,textarea):-webkit-autofill:focus{
  -webkit-text-fill-color:currentColor;
  transition:background-color 600000s 0s,color 600000s 0s;
}

/* Errors appear only after the person has interacted with the field, never on a fresh empty form. */
:where(input,select,textarea)[aria-invalid=true]{border-color:var(--ff-bad)!important}
:is(input,select,textarea)[aria-invalid=true]:focus{outline-color:var(--ff-bad)!important}
@supports selector(:user-invalid){
  :where(input,select,textarea):user-invalid{border-color:var(--ff-bad)!important}
  :is(input,select,textarea):user-invalid:focus{outline-color:var(--ff-bad)!important}
}

/* iPhones zoom the whole page into any field under 16px; keep fields at 16px there so focusing one never jumps. */
@supports (-webkit-touch-callout:none){
  :where(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=submit],[type=button],[type=reset],[type=image],[type=hidden],[type=color]),select,textarea){font-size:max(16px,1em)!important}
}

@media (prefers-reduced-motion:reduce){
  :where(input,select,textarea),:where(input,textarea)::placeholder{transition:none}
}

/* Keep validation feedback on the owning shell as well as bare fields. */
:is(.sbd-ctl,.intake-phone,.signup-password,.inbox-search,.affiliate-copy,.special-amount,.svc-search,.search-field,.about-float,.blog-search,.wz-field,.wz-price,.price-inputs>label,.nearby-search,.reservation-form label):focus-within:has([aria-invalid=true],:user-invalid){
  border-color:var(--ff-bad)!important;
  outline-color:var(--ff-bad)!important;
}
@media(forced-colors:active){
  :root{--ff-focus:Highlight;--ff-bad:Highlight}
}
