/* Dark mode for the public site (html[data-theme="dark"]).
   The choice is stored in localStorage("auth-theme") and shared with the auth pages. */

/* ── Base ─────────────────────────────────────────────────────────── */
html[data-theme="dark"] body { background: #0a0c12; color: #c9cdd8; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: #eaeaea; }
html[data-theme="dark"] .text-dark { color: #d6d9df !important; }
html[data-theme="dark"] .link-dark { color: #c3c9e5 !important; }
html[data-theme="dark"] .text-muted { color: #8b90a0 !important; }
html[data-theme="dark"] .lead { color: #b9bdc9; }
html[data-theme="dark"] hr { border-color: #242836; }

/* ── Surfaces ─────────────────────────────────────────────────────── */
html[data-theme="dark"] .bg-white { background-color: #0f1117 !important; }
html[data-theme="dark"] .bg-light { background-color: #12141c !important; }
html[data-theme="dark"] .bg-hover-light:hover { background-color: #181b26 !important; }
html[data-theme="dark"] .border-bottom, html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border { border-color: #242836 !important; }
html[data-theme="dark"] .shadow { box-shadow: 0 .5rem 1rem rgba(0,0,0,.6) !important; }

/* ── Nav, risk bar, dropdowns ─────────────────────────────────────── */
html[data-theme="dark"] .navbar.bg-light { background: #0d0d0d !important; border-color: #242424 !important; }
html[data-theme="dark"] .navbar .nav-link, html[data-theme="dark"] .navbar .menu-title { color: #d6d9df; }
html[data-theme="dark"] .dropdown-menu { background: #12141c; border-color: #262a38; }
html[data-theme="dark"] .dropdown-menu h5 { color: #eaeaea !important; }
html[data-theme="dark"] .risk-warning { background: #0d0d0d !important; }
html[data-theme="dark"] .risk-warning .text-dark { color: #cfcfcf !important; }

/* ── Tables, forms, accordions, modals ────────────────────────────── */
html[data-theme="dark"] .table { color: #c9cdd8; }
html[data-theme="dark"] .table.bg-white { background: #14161f !important; }
html[data-theme="dark"] .table td, html[data-theme="dark"] .table th { border-color: #262a38; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .custom-select {
    background-color: #14161f; border-color: #2c3040; color: #e5e7f0;
}
html[data-theme="dark"] .form-control::placeholder { color: #7d818c; }
html[data-theme="dark"] .accordion .text-dark { color: #d6d9df !important; }
html[data-theme="dark"] .modal-content { background: #12141c; color: #c9cdd8; }
html[data-theme="dark"] .close { color: #eaeaea; text-shadow: none; }

/* ── Language picker & theme toggle (nav widgets) ─────────────────── */
html[data-theme="dark"] .lang-toggle-home { background: #12141c; border-color: #2c3040; color: #d6d9df; }
html[data-theme="dark"] .lang-toggle-home .lang-code { color: #d6d9df; }
html[data-theme="dark"] .lang-panel-home { background: #12141c; border-color: #2c3040; box-shadow: 0 12px 32px rgba(0,0,0,.6); }
html[data-theme="dark"] .lang-search-home { background: #0f1117; border-color: #2c3040; color: #e5e7f0; }
html[data-theme="dark"] .lang-item-home { color: #d6d9df; }
html[data-theme="dark"] .lang-item-home:hover { background: rgba(91,108,255,.15); }
html[data-theme="dark"] .theme-toggle-home { background: #12141c !important; border-color: #2c3040 !important; color: #d6d9df !important; }

/* ── Cookie banner ────────────────────────────────────────────────── */
html[data-theme="dark"] .sticky-cookie-policy .bg-light { background: #12141c !important; color: #c9cdd8; }

/* ── Inline-styled custom sections (market widget, steps, bots, …).
      These carry literal colors in style="", so match on the attribute. ── */
html[data-theme="dark"] [style*="#141a2a"], html[data-theme="dark"] [style*="#1d2333"],
html[data-theme="dark"] [style*="#10131c"] { color: #eaeaea !important; }
html[data-theme="dark"] [style*="#33394a"], html[data-theme="dark"] [style*="#3c4257"] { color: #c4c7ce !important; }
html[data-theme="dark"] [style*="#5b6478"], html[data-theme="dark"] [style*="#8a92a6"] { color: #9ba0ab !important; }
html[data-theme="dark"] [style*="background:#ffffff"], html[data-theme="dark"] [style*="background: #ffffff"] {
    background: #10121a !important; border-color: #262a38 !important;
}
html[data-theme="dark"] [style*="#f7f9fc"], html[data-theme="dark"] [style*="#eef1f7"],
html[data-theme="dark"] [style*="#f0f3f8"] { background: #12141c !important; border-color: #262a38 !important; }
html[data-theme="dark"] [style*="background:#f2f4f8"], html[data-theme="dark"] [style*="background: #f2f4f8"] {
    background: #1b1e2a !important; color: #c9cdd8 !important;
}
html[data-theme="dark"] [style*="#eef0f5"] { border-color: #262a38 !important; }
html[data-theme="dark"] [style*="#e8eaf0"] { border-color: #262a38 !important; }
html[data-theme="dark"] #market-widget { background: #10121a !important; border-color: #262a38 !important; box-shadow: 0 12px 34px rgba(0,0,0,.5) !important; }
html[data-theme="dark"] #market-widget table, html[data-theme="dark"] #market-widget td { color: #c9cdd8; }

/* White CTA buttons on dark hero sections keep their look; brand-blue stays brand-blue. */
