/* TTLINK v1.9.8.16 — FORM CONTRAST GUARD
 * Limited to TTLINK-owned frontend forms; does not recolor theme navigation,
 * real membership cards, image exports, admin, or third-party checkout.
 * Works in normal/dark OS modes, focus/selection, autofill and native selects.
 */

/* Explicitly opt these TTLink form surfaces into a light control color scheme.
 * This prevents dark native input paint on browsers using a dark device theme. */
:where(body.ttl-club-standalone, body.ttl-family-join-standalone),
:where(.ttl-app, .ttl-experience, .ttl-portal, .ttl-service, #ttl-support-root .ttl-sb-panel) {
  color-scheme: light;
}

/* The invitation/claim form in the screenshot is a STANDALONE page.  These
 * selectors deliberately apply to EVERY editable text field in that page,
 * not only to the household select patched in v1.9.8.14. */
body.ttl-club-standalone .ttl-club-paper :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea),
body.ttl-family-join-standalone .ttl-family-join-page :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea),
body.ttl-app-page .ttl-app :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]), select, textarea),
.ttl-experience :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea),
.ttl-portal :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea),
.ttl-service .ttl-request-box :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea),
#ttl-support-root .ttl-sb-panel :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea) {
  background-color:#FFFFFF !important;
  color:#1D3038 !important;
  -webkit-text-fill-color:#1D3038 !important;
  caret-color:#1D3038 !important;
  border-color:#87979C !important;
  color-scheme:light !important;
  opacity:1 !important;
  text-shadow:none !important;
  filter:none !important;
}

/* A focused field must NEVER switch to a dark fill inherited from Astra or
 * an accessibility theme. */
body.ttl-club-standalone .ttl-club-paper :is(input,select,textarea):focus,
body.ttl-family-join-standalone .ttl-family-join-page :is(input,select,textarea):focus,
body.ttl-app-page .ttl-app :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus,
.ttl-experience :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus,
.ttl-portal :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus,
.ttl-service .ttl-request-box :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus,
#ttl-support-root .ttl-sb-panel :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus {
  background-color:#FFFFFF !important;
  color:#1D3038 !important;
  -webkit-text-fill-color:#1D3038 !important;
  caret-color:#1D3038 !important;
  border-color:#397186 !important;
  outline:2px solid #397186 !important;
  outline-offset:2px !important;
  box-shadow:0 0 0 3px rgba(57,113,134,.12) !important;
}

/* Placeholder stays legible even in dark Chrome/Windows themes. */
body.ttl-club-standalone .ttl-club-paper :is(input,textarea)::placeholder,
body.ttl-family-join-standalone .ttl-family-join-page :is(input,textarea)::placeholder,
body.ttl-app-page .ttl-app :is(input,textarea)::placeholder,
.ttl-experience :is(input,textarea)::placeholder,
.ttl-portal :is(input,textarea)::placeholder,
.ttl-service .ttl-request-box :is(input,textarea)::placeholder,
#ttl-support-root .ttl-sb-panel :is(input,textarea)::placeholder {
  color:#59666D !important;
  -webkit-text-fill-color:#59666D !important;
  opacity:1 !important;
}

/* Selected text: pale highlight + DARK glyphs also works with WebKit text-fill.
 * Avoid dark-blue selection backgrounds while WebKit still paints dark text. */
body.ttl-club-standalone .ttl-club-paper :is(input,select,textarea)::selection,
body.ttl-family-join-standalone .ttl-family-join-page :is(input,select,textarea)::selection,
body.ttl-app-page .ttl-app :is(input,select,textarea)::selection,
.ttl-experience :is(input,select,textarea)::selection,
.ttl-portal :is(input,select,textarea)::selection,
.ttl-service .ttl-request-box :is(input,select,textarea)::selection,
#ttl-support-root .ttl-sb-panel :is(input,select,textarea)::selection {
  color:#15313E !important;
  background:#C4E2ED !important;
}

/* Chrome autofill replaces background itself; override it on all states. */
body.ttl-club-standalone .ttl-club-paper :is(input,textarea):-webkit-autofill,
body.ttl-club-standalone .ttl-club-paper :is(input,textarea):-webkit-autofill:hover,
body.ttl-club-standalone .ttl-club-paper :is(input,textarea):-webkit-autofill:focus,
body.ttl-family-join-standalone .ttl-family-join-page :is(input,textarea):-webkit-autofill,
body.ttl-family-join-standalone .ttl-family-join-page :is(input,textarea):-webkit-autofill:focus,
body.ttl-app-page .ttl-app :is(input,textarea):-webkit-autofill,
body.ttl-app-page .ttl-app :is(input,textarea):-webkit-autofill:focus,
.ttl-experience :is(input,textarea):-webkit-autofill,
.ttl-portal :is(input,textarea):-webkit-autofill,
.ttl-service .ttl-request-box :is(input,textarea):-webkit-autofill,
#ttl-support-root .ttl-sb-panel :is(input,textarea):-webkit-autofill {
  -webkit-box-shadow:0 0 0 1000px #FFFFFF inset !important;
  -webkit-text-fill-color:#1D3038 !important;
  caret-color:#1D3038 !important;
  color-scheme:light !important;
}

/* Browser-native dropdown options should not render white text on white. */
body.ttl-club-standalone .ttl-club-paper select option,
body.ttl-family-join-standalone .ttl-family-join-page select option,
body.ttl-app-page .ttl-app select option,
.ttl-experience select option,
.ttl-portal select option,
.ttl-service .ttl-request-box select option {
  color:#1D3038 !important;
  background-color:#FFFFFF !important;
}

/* Clear error/status/helper text on light backgrounds; leave themed dark
 * support headers, action buttons, checkboxes and success badges untouched. */
body.ttl-club-standalone .ttl-club-profile-fields :is(label,legend),
body.ttl-family-join-standalone .ttl-family-join-page :is(label,legend),
body.ttl-app-page .ttl-app form :is(label,legend),
.ttl-experience form :is(label,legend),
.ttl-portal form :is(label,legend),
.ttl-service .ttl-request-box :is(label,legend),
#ttl-support-root .ttl-sb-field {
  color:#24373D !important;
  -webkit-text-fill-color:#24373D !important;
}
body.ttl-club-standalone .ttl-club-paper .ttl-club-hint,
body.ttl-club-standalone .ttl-club-profile-fields>p,
body.ttl-family-join-standalone .ttl-family-join-page .ttl-family-join-note,
body.ttl-app-page .ttl-app .ttl-form-note {
  color:#44585F !important;
}

/* Disabled inputs use an extra attribute selector so this deliberately wins
 * over the regular enabled-control rules even when a theme uses !important. */
body.ttl-club-standalone .ttl-club-paper :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):disabled,select:disabled,textarea:disabled),
body.ttl-family-join-standalone .ttl-family-join-page :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):disabled,select:disabled,textarea:disabled),
body.ttl-app-page .ttl-app :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):disabled,select:disabled,textarea:disabled),
.ttl-experience :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):disabled,select:disabled,textarea:disabled),
.ttl-portal :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):disabled,select:disabled,textarea:disabled) {
  background-color:#F0F2F2 !important;
  color:#526167 !important;
  -webkit-text-fill-color:#526167 !important;
  opacity:1 !important;
}
