/* Display standards shared by the provider portal, the admin portal and the client list page (owner 11/22): light-theme placeholder and field edges, and the reduced-motion rule. Fixed once, at the source. */

/* Placeholder text at 4.5:1 or better (the browser default grey was 4.2:1 on the cream fields). */
/* Example text in a field (owner 11/23): a light grey that is clearly not typed-in text, and still readable (4.5:1 or better on the field colors). Typed text stays the full dark (light in dark mode) color. */
::placeholder { color: #66625a; opacity: 1; }
html[data-theme="dark"] ::placeholder { color: #9a968e; opacity: 1; }
/* Pages that show or might feed provider pay keep their original look (docs/CALM_HANDS_OFF_PAGES.md): their example text stays as it was. */
:is(#view-pay-periods, #view-statements, #view-np-balances, #view-cps-reports, #view-profile, #view-my-availability, #view-billing, #view-billing-review, #view-mid-week-payouts, #view-pay-settings, #view-providers, #view-reports, #view-tn-payments) ::placeholder { color: var(--text2); opacity: 1; }
html[data-theme="dark"] :is(#view-pay-periods, #view-statements, #view-np-balances, #view-cps-reports, #view-profile, #view-my-availability, #view-billing, #view-billing-review, #view-mid-week-payouts, #view-pay-settings, #view-providers, #view-reports, #view-tn-payments) ::placeholder { color: #b6b2aa; opacity: 1; }

/* The edge of a text box, list or date field is at least 3:1 against the page so a field is easy to find (light theme only; dark keeps its own borders). */
html:not([data-theme="dark"]) :is(input, select, textarea):not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"], [type="color"]) { border-color: var(--border2) !important; }

/* Reduced motion: when the device asks for less motion, animations and smooth scrolling stop on every page. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* A menu entry that is switched off stays out of sight (it was drawing an empty 20 px row). */
.nav-item[hidden] { display: none !important; }

/* Click targets of at least 24 x 24 px: check boxes and round buttons are a little larger, and a label around one is as tall as a line of text. */
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; }
td > input[type="checkbox"], th > input[type="checkbox"] { width: 24px; height: 24px; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: 24px; display: inline-flex; align-items: center; gap: 6px; }

/* A chart number link uses the theme's link color in both themes (the browser's own blue was unreadable on the dark page). */
a.chart-link { color: var(--link); }

/* Dark theme rules for light panels, red text, white-on-accent and buttons: shared by the provider portal, the admin portal and the client list page (moved here from a11y-display.css, owner 11/23). */
/* D4/D10: panels that stay light in dark mode keep dark text and dark links; red text on them stays dark red. Light background list = every light tint the portal uses. */
html[data-theme="dark"] :is(.ann-box, #chart-needs-attention, [style*="background:#fffbeb"], [style*="background:#fef3c7"], [style*="background:#fff4e5"], [style*="background:#fffbe6"], [style*="background:#fff7d6"], [style*="background:#fee2e2"], [style*="background:#fef2f2"], [style*="background:#fdecea"], [style*="background:#fff0f0"], [style*="background:#fef3f2"], [style*="background:#fff3bf"], [style*="background:#fff8e1"]) { color: #3b2a05; }
html[data-theme="dark"] :is(.ann-box, #chart-needs-attention, [style*="background:#fffbeb"], [style*="background:#fef3c7"], [style*="background:#fff4e5"], [style*="background:#fffbe6"], [style*="background:#fff7d6"], [style*="background:#fee2e2"], [style*="background:#fef2f2"], [style*="background:#fdecea"], [style*="background:#fff0f0"], [style*="background:#fef3f2"], [style*="background:#fff3bf"]) :is(a, a:visited, .np-hint, strong, span, div) { color: inherit; }
html[data-theme="dark"] :is(.ann-box, #chart-needs-attention, [style*="background:#fffbeb"], [style*="background:#fef3c7"], [style*="background:#fff4e5"], [style*="background:#fffbe6"], [style*="background:#fff7d6"], [style*="background:#fee2e2"], [style*="background:#fef2f2"], [style*="background:#fdecea"], [style*="background:#fff0f0"], [style*="background:#fef3f2"], [style*="background:#fff3bf"]) a { color: #17407f !important; text-decoration: underline; }
/* A red amount or message on the dark background uses a lighter red (4.5:1 or better); on a light panel it stays dark red. */
html[data-theme="dark"] :is([style*="color:#b91c1c"], [style*="color:#dc2626"], [style*="color:#b42318"], [style*="color:#991b1b"], [style*="color:#7f1d1d"], .text-danger, .balance-due, .bal-amt):not(.payer-chip) { color: #f4a3a3 !important; }
html[data-theme="dark"] :is(.ann-box, #chart-needs-attention, [style*="background:#fffbeb"], [style*="background:#fef3c7"], [style*="background:#fee2e2"], [style*="background:#fef2f2"], [style*="background:#fff4e5"]) :is([style*="color:#b91c1c"], [style*="color:#dc2626"], [style*="color:#b42318"], [style*="color:#991b1b"], [style*="color:#7f1d1d"]) { color: #7f1d1d !important; }
/* Dark theme, found by the 11/22 contrast scan: chart-number links use the theme link color (the browser blue was unreadable on dark); buttons and the last-4 note inside a light panel keep dark text; white text on the light green accent (avatars, count pills) becomes dark; a red Delete button keeps white text. */
html[data-theme="dark"] :is(.ann-box, #chart-needs-attention, [style*="background:#fffbeb"], [style*="background:#fef3c7"], [style*="background:#fff4e5"], [style*="background:#fffbe6"], [style*="background:#fff7d6"], [style*="background:#fee2e2"], [style*="background:#fef2f2"], [style*="background:#fdecea"], [style*="background:#fff0f0"], [style*="background:#fef3f2"], [style*="background:#fff3bf"]) :is(button:not([class]), .chart-last4) { color: #3b2a05 !important; }
html[data-theme="dark"] :is([style*="background:var(--accent);color:#fff"], [style*="background:var(--accent); color:#fff"], [style*="background:var(--green);color:#fff"], [style*="background:var(--green); color:#fff"], .cq-count, .cq-gcount) { color: #141413 !important; }
html[data-theme="dark"] .btn-danger { color: #fff !important; }
html[data-theme="dark"] button.btn[style*="background:#dc2626"]:not(.payer-chip) { color: #fff !important; } /* the red Crisis Resources button: its border color was being read as red text */
html[data-theme="dark"] [style*="color:#b45309"] { color: #f2b84b !important; }

/* A count pill inside a selected (dark filled) button takes the button's text color, so it stays readable. */
.btn-primary .pill { color: inherit; }

/* Dark theme: white text on any badge or button filled with a theme color (green, red, accent, charcoal) becomes dark, since those fills are light in the dark theme; a status badge and a filled filter button stay readable. */
html[data-theme="dark"] [style*="background:var(--"][style*="color:#fff"] { color: #141413 !important; }
