/**
 * Force explicit light color-scheme so Chrome/Edge mobile (and Google Search
 * in-app browsers) do not auto-invert the page into unreadable dark fields.
 */
:root {
  color-scheme: only light !important;
}

html {
  color-scheme: only light !important;
}

/* Light public / auth surfaces (/start, /privacy, CMS, desk light theme) */
html.theme-public,
html.theme-desk,
body.theme-public,
body.theme-desk,
.theme-public,
.theme-desk {
  background-color: #f8f9fa;
  color: #1a1a1a;
}

.theme-public body,
.theme-desk body,
body.theme-public,
body.theme-desk {
  background-color: #f8f9fa !important;
  color: #1a1a1a !important;
}

/* Force clear inputs and text readability (stops pitch-black inverted fields) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
  color-scheme: light !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #d1d5db !important;
  caret-color: #000000;
}

input::placeholder,
textarea::placeholder {
  color: #6b7280 !important;
  opacity: 1;
}

/* Prevent webkit autofill dark background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #000000 !important;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
  transition: background-color 99999s ease-out 0s;
}

/* Fix cards and containers on light pages */
.theme-public .card,
.theme-public .container,
.theme-public .privacy-card,
.theme-public .form-container,
.theme-public .panel,
.theme-public .cms-page .panel,
.theme-desk .card,
.theme-desk .container,
.theme-desk .panel,
.cms-page .panel,
.privacy-card,
.form-container {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
}

/* Auth / start pages often use .panel without theme class yet */
.page .panel input:not([type="checkbox"]):not([type="radio"]),
.page .panel select,
.page .panel textarea,
.auth-shell input:not([type="checkbox"]):not([type="radio"]),
.auth-shell select,
.auth-shell textarea {
  background-color: #ffffff !important;
  color: #000000 !important;
}
