/*
 * DER-113: dark mode for every public page (home, the landing tabs, disclaimer,
 * privacy, terms, signup/reset/verify pages, errors...). Loaded last in both
 * public layouts (includes/home, includes/home2). Every rule is scoped to
 * html[data-theme="dark"], which theme.js sets (Auto = 7pm-7am by the device
 * clock, or the visitor's Light/Dark choice), so light mode is unchanged.
 *
 * Palette (same as DER-111's landing tabs and the doctor dashboard's navy):
 *   page #18202F, raised surface #232B3B, deep #121826, line #343C4C,
 *   text #F2F2F3, secondary text #C9CED8, link/accent #F27A9E, button #BC2445.
 */

/* ---- Page, header and footer (moved from landing-tabs.css) ---- */
html[data-theme="dark"] body { background: #18202f; color: #f2f2f3; }
html[data-theme="dark"] .header .header-top { background: #18202f; border-color: #343c4c !important; }
html[data-theme="dark"] .header .main_menu a { color: #f2f2f3; }
html[data-theme="dark"] .header .main_menu li.active a,
html[data-theme="dark"] .header .main_menu a:is(:hover, :focus-visible) { color: #f27a9e; }
/* The uploaded logo is drawn for a light background: give it a light chip. */
html[data-theme="dark"] .header .brand-logo img { background: #f4f2f3; border-radius: 8px; padding: 4px 6px; }
/* Raised above the page (a darker footer read as a black strip). */
html[data-theme="dark"] .footer-section { background: #232b3b; color: #d9dce3; }
html[data-theme="dark"] .footer-section :is(h3, h4, p, li, span) { color: #d9dce3; }
html[data-theme="dark"] .footer-section a { color: #f27a9e; }
html[data-theme="dark"] .footer-section hr { border-color: #343c4c; }
html[data-theme="dark"] .footer-section .ft-logo img { background: #f4f2f3; border-radius: 8px; padding: 4px 6px; }

/* Mobile menu Login/Signup: white on the darker brand pink (AA; black on #D03766 was 4.42:1). */
html[data-theme="dark"] .login_sign,
html[data-theme="dark"] .dmx_login_sign { background: #bc2445 !important; color: #fff !important; }
html[data-theme="dark"] .sidenavR, html[data-theme="dark"] .sidenav { background-color: #121826; }

/* ---- Home page (homepage.blade.php) ---- */
html[data-theme="dark"] .ticker-section { background: #232b3b; }
html[data-theme="dark"] .ticker-text { color: #f27a9e; }
html[data-theme="dark"] .featured-section h4,
html[data-theme="dark"] .featured-section h3,
html[data-theme="dark"] .featured-text h3 { color: #f2f2f3; }
html[data-theme="dark"] .featured-text p,
html[data-theme="dark"] .featured-section p { color: #d9dce3; }
html[data-theme="dark"] .fea-col-data li { color: #d9dce3; }
/* Check marks: brand pink discs (the navy discs vanished on the navy page). */
html[data-theme="dark"] .fea-col-data li i { background: #bc2445; color: #fff; }
/* Teal pills: a deeper teal so the white text passes AA (#11A198 was 3.2:1). */
html[data-theme="dark"] .fea-col-list li { background: #0b7a73; color: #fff; }
html[data-theme="dark"] .fea-col-list li i { background: transparent; color: #fff; }
/* Images sat on white padding; no white frames on the dark page. */
html[data-theme="dark"] .featured-img { background: transparent; }
/* The two cards on the dark gradient band. */
html[data-theme="dark"] .doc-feat-text { background: #232b3b; border: 1px solid #343c4c; box-shadow: none !important; }
html[data-theme="dark"] .doc-feat-text h2 { color: #f2f2f3; }
html[data-theme="dark"] .doc-feat-text p,
html[data-theme="dark"] .custom .featured-text p { color: #c9ced8; }
html[data-theme="dark"] .bg-red { background: #232b3b; }
html[data-theme="dark"] .system .featured-text p { color: #d9dce3; }
html[data-theme="dark"] .landing-disclaimer-image { background-color: #232b3b !important; }
html[data-theme="dark"] .featured-section hr { border-color: #343c4c; }

/* ---- Home layout popups: the notice (#homepage_notifications) and the newsletter (#popup) ---- */
html[data-theme="dark"] #homepage_notifications .modal-content,
html[data-theme="dark"] #popup .popup-content { background: #232b3b; color: #f2f2f3; border-color: #343c4c; box-shadow: 0 24px 80px #00000080; }
html[data-theme="dark"] #homepage_notifications .modal-header { background: #232b3b !important; border-color: #343c4c; }
html[data-theme="dark"] #homepage_notifications .modal-title,
html[data-theme="dark"] #popup h2 { color: #f2f2f3 !important; }
/* Insets are a step lighter than the panel (a darker inset reads as a hole). */
html[data-theme="dark"] #homepage_notifications .modal-body,
html[data-theme="dark"] #popup .newsletter-txt { background: #2c3547; color: #e3e6ec; border-color: #3d4658; }
html[data-theme="dark"] #homepage_notifications .modal-body * { color: inherit; }
html[data-theme="dark"] #homepage_notifications .modal-body a { color: #f27a9e; }
html[data-theme="dark"] #homepage_notifications .modal-footer { border-color: #343c4c; }
html[data-theme="dark"] #homepage_notifications .btn-close,
html[data-theme="dark"] #popup #closePopup { background: #18202f; color: #f27a9e; border-color: #343c4c; }
html[data-theme="dark"] #popup form input[type=email] { background: #2c3547; color: #f2f2f3; border-color: #4a5366; }
html[data-theme="dark"] #popup form input[type=email]::placeholder { color: #9aa1af; }
html[data-theme="dark"] #popup #responseMessage, html[data-theme="dark"] #popup .error { color: #f2f2f3; }
html[data-theme="dark"] #homepage_notifications :focus-visible,
html[data-theme="dark"] #popup :focus-visible { outline-color: #f27a9e; }
html[data-theme="dark"] #popup { background: #0008; }
html[data-theme="dark"] .modal-backdrop.show { opacity: .7; }

/* ---- Content pages (disclaimer, privacy, terms, who-are-we, doctor-error, beta-testing,
        time, errors, phraseboard): .medical-posts / .post-content ---- */
html[data-theme="dark"] .medical-posts { background: transparent; }
html[data-theme="dark"] .post-content,
html[data-theme="dark"] .post-content :is(p, li, span, div, td, th, blockquote, strong, b, em, i, u, font) { color: #d9dce3 !important; background-color: transparent !important; }
html[data-theme="dark"] .post-content :is(h1, h2, h3, h4, h5, h6) { color: #f2f2f3 !important; background-color: transparent !important; }
html[data-theme="dark"] .post-content a, html[data-theme="dark"] .post-content a * { color: #f27a9e !important; }
html[data-theme="dark"] .post-content :is(table, td, th) { border-color: #343c4c !important; }
html[data-theme="dark"] .free-signup { background: #bc2445 !important; color: #fff !important; }

/* ---- Account pages on the home layout (verify email, reset password) ---- */
html[data-theme="dark"] .email-verify.card { background: #232b3b; border-color: #343c4c; color: #f2f2f3; }
html[data-theme="dark"] .email-verify :is(h1, h2, h3, h4, h5, h6, p, label, .control-label) { color: #f2f2f3; }
html[data-theme="dark"] .email-verify .form-control { background: #2c3547; color: #f2f2f3; border-color: #4a5366; }
html[data-theme="dark"] .email-verify .form-control::placeholder { color: #9aa1af; }
html[data-theme="dark"] .email-verify a { color: #f27a9e; }
html[data-theme="dark"] .email-verify .close { color: #f2f2f3; text-shadow: none; opacity: .8; }
html[data-theme="dark"] .email-verify .btn, html[data-theme="dark"] .email-verify button[type=submit] { background: #bc2445 !important; color: #fff !important; }
