/*
 * AIOS V24.2 — scoped theme contrast follow-up.
 * Last loaded after aios-theme-v24.css and aios-v24-1-polish.css.
 * No document flow, form data, permission, or JS logic changed.
 * Dark palette unchanged except a clearly visible "back to login" link.
 */

/* Register + representative register: native province/city selection and
   converted searchable-select UI (both paths are used by panel.js). */
html[data-theme="light"] body.auth-body .auth-register-card .field select:not(.search-select-native),
html[data-theme="light"] body.auth-body .auth-register-card .field select.search-select-native,
html[data-theme="light"] body.auth-body .auth-register-card .field .search-select__control {
  color-scheme:light!important;
  background-color:#fff!important;
  color:#173d4c!important;
  border:1px solid #afcdd8!important;
  -webkit-text-fill-color:#173d4c!important;
  box-shadow:none!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .field select:focus-visible,
html[data-theme="light"] body.auth-body .auth-register-card .field .search-select__control:focus-visible,
html[data-theme="light"] body.auth-body .auth-register-card .field .search-select.is-open .search-select__control {
  outline:2px solid #007470!important;
  outline-offset:2px!important;
  border-color:#007470!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .field :is(select option,select optgroup) {
  color-scheme:light!important;
  background:#fff!important;
  color:#173d4c!important;
  -webkit-text-fill-color:#173d4c!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .field select:disabled {
  background-color:#eaf1f4!important;
  color:#58717d!important;
  -webkit-text-fill-color:#58717d!important;
}
/* In Chromium/Edge native select popup follows the element's color-scheme.
   For browsers where panel.js upgrades the control we explicitly theme all parts. */
html[data-theme="light"] body.auth-body .auth-register-card .search-select__value {color:#173d4c!important}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__value.is-placeholder {color:#627d8b!important}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__arrow {
  background:#e6f1f4!important;border-color:#b6d1db!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__arrow::before {border-color:#325e6b!important}
html[data-theme="light"] body.auth-body .auth-register-card :is(.search-select__menu,.search-select__options) {
  color-scheme:light!important;
  background:#fff!important;color:#193f4c!important;border-color:#bed5dd!important;
  box-shadow:0 14px 32px rgba(21,67,83,.13)!important;
  scrollbar-color:#aacbd0 #edf5f7;
}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__search {
  background:#f8fbfc!important;color:#173d4c!important;
  border:1px solid #bcd7df!important;
  -webkit-text-fill-color:#173d4c!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__search::placeholder {color:#68808d!important;opacity:1}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__option {background:transparent!important;color:#214b59!important}
html[data-theme="light"] body.auth-body .auth-register-card .search-select__option:is(:hover,.is-selected,.is-highlighted) {
  background:#e2f4ee!important;color:#00695f!important;
}
html[data-theme="light"] body.auth-body .auth-register-card :is(.search-select__empty,.search-select__group) {color:#526e7d!important}

/* The link is in an auth-footer outside the form, not an .auth-link-button. */
body.auth-body .auth-register-card .auth-footer {
  display:flex;justify-content:center;margin-top:17px;
}
body.auth-body .auth-register-card .auth-footer a {
  display:inline-flex;justify-content:center;align-items:center;
  min-height:40px;padding:7px 17px;max-width:100%;
  border-radius:10px;border:1px solid #46697b;
  background:#173344;color:#e6f5fa!important;
  font-size:12px;line-height:1.6;font-weight:750;
  text-decoration:none;transition:background-color .15s,border-color .15s;
}
body.auth-body .auth-register-card .auth-footer a:hover {background:#244c58;border-color:#83b4ba}
body.auth-body .auth-register-card .auth-footer a:focus-visible {outline:3px solid #ffbf65;outline-offset:2px}
html[data-theme="light"] body.auth-body .auth-register-card .auth-footer a {
  background:#e8f5f1!important;color:#005c56!important;
  border-color:#abd6ca!important;text-decoration:none!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .auth-footer a:hover {
  background:#d1ece3!important;color:#004a43!important;border-color:#67baa8!important;
}
html[data-theme="light"] body.auth-body .auth-register-card .auth-footer a:focus-visible {outline-color:#007470}

/* AI landing hero: restore contrast for all nested text/status chips rather
   than lightening only h1/p while leaving the old dark chips in place. */
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero {
  background:radial-gradient(ellipse at 73% 40%,rgba(22,166,155,.13),transparent 58%),
             linear-gradient(115deg,#e6f5f3 0%,#ecf5fa 53%,#dceff1 100%)!important;
  border-color:#a7d6d3!important;
  color:#173f4e!important;
  box-shadow:0 10px 32px rgba(15,63,72,.09)!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero::before {opacity:.08!important}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero::after {opacity:.08!important}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero :is(h1,p,.ai-hero-caption) {color:#194556!important}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero h1 em {color:#006d62!important;text-shadow:none!important}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero .ai-hero-eyebrow {
  color:#00665d!important;background:#d6f0e6!important;
  border-color:#93cfc0!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero .journey-step {
  background:#f6fbfc!important;border-color:#c6dfe2!important;color:#315666!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero .journey-step i {
  background:#e5f1f3!important;color:#255569!important;border-color:#c1d9e0!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero .journey-step.is-current {
  background:#dff2ea!important;border-color:#8cc8b5!important;color:#005e54!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .ai-hero .journey-step.is-current i {
  background:#006f65!important;border-color:#006f65!important;color:#fff!important;
}
/* The amber CTA stays intentionally legible, unchanged from the brand hero. */

/* Result hero: legacy ai-theme.css fixes a dark background on this specific
   class. Cover all semantic states and inline result action card separately. */
html[data-theme="light"] body.ai-platform .result-hero {
  background:linear-gradient(115deg,#eff9f5,#e7f4f7)!important;
  border:1px solid #b9dfd5!important;
  border-radius:13px;
  padding:17px;
  color:#194352!important;
}
html[data-theme="light"] body.ai-platform .result-hero :is(h2,h3,strong) {color:#143e4e!important}
html[data-theme="light"] body.ai-platform .result-hero p {color:#3e626e!important}
html[data-theme="light"] body.ai-platform .result-hero .result-badge {
  background:#d4eee5!important;color:#006c61!important;border:1px solid #acd6c6!important;
}
html[data-theme="light"] body.ai-platform .result-hero.danger {
  background:linear-gradient(110deg,#fff4f2,#fce9e6)!important;
  border-color:#edc6bf!important;color:#74383b!important;
}
html[data-theme="light"] body.ai-platform .result-hero.danger :is(h2,h3) {color:#923e43!important}
html[data-theme="light"] body.ai-platform .result-hero.danger p {color:#774d53!important}
html[data-theme="light"] body.ai-platform .result-hero.danger .result-badge {
  background:#ffdcda!important;color:#aa3646!important;border-color:#f0b2b3!important;
}
html[data-theme="light"] body.ai-platform :is(.result-hero .action-box,.admin-note,.processing-box) {
  background:#f5fafb!important;color:#244e5d!important;border:1px solid #d1e4e9!important;
}
html[data-theme="light"] body.ai-platform .result-hero.danger .action-box {
  background:#fffaf7!important;color:#684b4c!important;border-color:#eedad1!important;
}
html[data-theme="light"] body.ai-platform :is(.admin-note,.processing-box) :is(strong,h3,p) {color:#234d5b!important}

/* Photo picker: the legacy image caption/icon backgrounds remained dark.
   Only recolor placeholders; uploaded photos and red annotation boxes untouched. */
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile .photo-placeholder {
  color:#294f5d!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile .photo-placeholder > span {
  background:#e1f2ef!important;color:#006e65!important;
  border:1px solid #b2d9d4!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile .photo-placeholder .photo-view-label {
  color:#1b4656!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile .photo-placeholder small {
  color:#516f7c!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile[data-name="right"],
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile[data-name="left"] {
  background-color:#f4fafb!important;
  border-color:#aacfd6!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .photo-tile.has-image {background-color:#fff!important}

/* Service badge was getting only a foreground color override in V24. */
html[data-theme="light"] body.ai-platform .inspection-page .api-state {
  display:inline-flex;align-items:center;gap:6px;
  background:#e2f5eb!important;color:#0a684f!important;
  border:1px solid #a6d7c5!important;
  box-shadow:none!important;
}
html[data-theme="light"] body.ai-platform .inspection-page .api-state :is(span,strong) {color:#0a684f!important}
html[data-theme="light"] body.ai-platform .inspection-page .api-state i {
  background:#00a073!important;box-shadow:0 0 0 3px rgba(0,160,115,.1)!important;
}

/* Chat scrolling: only lighten track + thumb in Light Mode. Preserve sizes,
   private channel rendering, scroll height, and scrollbar in Dark Mode. */
html[data-theme="light"] body.ai-platform :is(.chat-thread,.chat-messages,.chat-history) {
  scrollbar-width:thin;
  scrollbar-color:#93b7be #edf5f7!important;
}
html[data-theme="light"] body.ai-platform :is(.chat-thread,.chat-messages,.chat-history)::-webkit-scrollbar {
  width:7px;height:7px;
}
html[data-theme="light"] body.ai-platform :is(.chat-thread,.chat-messages,.chat-history)::-webkit-scrollbar-track {
  background:#edf5f7!important;border-radius:8px;
}
html[data-theme="light"] body.ai-platform :is(.chat-thread,.chat-messages,.chat-history)::-webkit-scrollbar-thumb {
  background:#93b7be!important;border:1px solid #edf5f7!important;border-radius:8px;
}
html[data-theme="light"] body.ai-platform :is(.chat-thread,.chat-messages,.chat-history)::-webkit-scrollbar-thumb:hover {
  background:#658f9a!important;
}

@media(max-width:650px) {
  body.auth-body .auth-register-card .auth-footer a {width:100%;max-width:360px}
  body.auth-body .auth-register-card .field select {min-width:0;max-width:100%}
  html[data-theme="light"] body.ai-platform .result-hero {padding:13px;gap:10px}
}

/* Existing dark result panel kept its pale summary on near-identical dark
   tones; improve readability without touching the dark background itself. */
html:not([data-theme="light"]) body.ai-platform .result-hero p {color:#c8dbe4!important}
html:not([data-theme="light"]) body.ai-platform .result-hero :is(h2,h3) {color:#f0faff!important}
