/* BAM light theme for content + user + AI + trading pages (PC + mobile).
   Trade shell vars / panels live in trade-light.css. */

:root {
  --bam-chrome: #00193c;
  --bam-body-bg: #ffffff;
  --bam-body-text: #0f172a;
  --bam-muted: #475569;
  --bam-card: #ffffff;
  --bam-card-muted: #f8fafc;
  --bam-card-2: #eef2f7;
  --bam-hover: #e2e8f0;
  --bam-border: #e2e8f0;
  --bam-user-panel: rgb(230, 240, 255);
  --bam-link: #0054cc;
  --bam-link-hover: #2563eb;
}

/* --- Light page canvas (covers River html dark) --- */
html {
  background-color: var(--bam-body-bg) !important;
  color: var(--bam-body-text) !important;
  scrollbar-gutter: stable;
}

body:not(.theme-dark) {
  background-color: var(--bam-body-bg) !important;
  color: var(--bam-body-text) !important;
}

/* User center: middle content block only; page around it stays white */
body:not(.theme-dark) .bam-user-panel {
  background-color: var(--bam-user-panel) !important;
  border-radius: 1rem;
  padding: 1.25rem 1rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  body:not(.theme-dark) .bam-user-panel {
    padding: 1.5rem 1.5rem 2rem;
  }
}

/* Flatten nested cards/links inside the panel (a/div); keep form fields solid */
body:not(.theme-dark) .bam-user-panel .bg-neutral-900,
body:not(.theme-dark) .bam-user-panel .bg-neutral-850,
body:not(.theme-dark) .bam-user-panel .bg-neutral-800 {
  background-color: transparent !important;
}

body:not(.theme-dark) .bam-user-panel input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body:not(.theme-dark) .bam-user-panel textarea,
body:not(.theme-dark) .bam-user-panel select:not(.home-bam-lang) {
  background-color: #ffffff !important;
  color: var(--bam-body-text) !important;
  border-color: var(--bam-border) !important;
}

body:not(.theme-dark) .bam-user-panel .group:hover .group-hover\:bg-neutral-800,
body:not(.theme-dark) .bam-user-panel .group:focus-visible .group-focus-visible\:bg-neutral-800,
body:not(.theme-dark) .bam-user-panel .focus-visible\:bg-neutral-800:focus-visible {
  background-color: rgb(210, 226, 250) !important;
}

/* Modals inside user panel must stay solid (not inherit transparent cards) */
body:not(.theme-dark) .bam-modal-panel,
body:not(.theme-dark) .bam-user-panel .bam-modal-panel,
body:not(.theme-dark) .bam-user-panel .bam-modal-panel.bg-neutral-900 {
  background-color: #ffffff !important;
  color: var(--bam-body-text) !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

body:not(.theme-dark) .bam-modal-panel .bg-neutral-800,
body:not(.theme-dark) .bam-modal-panel .bg-neutral-700 {
  background-color: #f1f5f9 !important;
}

body:not(.theme-dark) #convert-cancel {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* --- Dark island: trading / AI --- */
html:has(body.theme-dark) {
  background-color: #131313 !important;
  color: #f9f9f9 !important;
  scrollbar-gutter: stable;
}

body.theme-dark {
  background-color: #131313 !important;
  color: #f9f9f9 !important;
}

/* --- Utility remaps (light pages only; include responsive variants) --- */
body:not(.theme-dark) .bg-black,
body:not(.theme-dark) .bg-neutral-950,
body:not(.theme-dark) .sm\:bg-black,
body:not(.theme-dark) .md\:bg-black,
body:not(.theme-dark) .lg\:bg-black {
  background-color: var(--bam-body-bg) !important;
}

/* Cards: white panels; 850 = soft gray; 800 = icon wells */
body:not(.theme-dark) .bg-neutral-900,
body:not(.theme-dark) .sm\:bg-neutral-900,
body:not(.theme-dark) .md\:bg-neutral-900,
body:not(.theme-dark) .lg\:bg-neutral-900,
body:not(.theme-dark) .xl\:bg-neutral-900 {
  background-color: var(--bam-card) !important;
}

body:not(.theme-dark) .bg-neutral-850,
body:not(.theme-dark) .sm\:bg-neutral-850,
body:not(.theme-dark) .md\:bg-neutral-850,
body:not(.theme-dark) .lg\:bg-neutral-850,
body:not(.theme-dark) .xl\:bg-neutral-850 {
  background-color: var(--bam-card-muted) !important;
}

body:not(.theme-dark) .bg-neutral-800,
body:not(.theme-dark) .sm\:bg-neutral-800,
body:not(.theme-dark) .md\:bg-neutral-800,
body:not(.theme-dark) .lg\:bg-neutral-800,
body:not(.theme-dark) .xl\:bg-neutral-800 {
  background-color: var(--bam-card-2) !important;
}

body:not(.theme-dark) .bg-neutral-700,
body:not(.theme-dark) .hover\:bg-neutral-800:hover,
body:not(.theme-dark) .hover\:bg-neutral-700:hover,
body:not(.theme-dark) .hover\:bg-neutral-600:hover,
body:not(.theme-dark) .focus-visible\:bg-neutral-800:focus-visible,
body:not(.theme-dark) .group:hover .group-hover\:bg-neutral-800,
body:not(.theme-dark) .group:focus-visible .group-focus-visible\:bg-neutral-800,
body:not(.theme-dark) .group:focus-within .group-focus-visible\:bg-neutral-800 {
  background-color: var(--bam-hover) !important;
}

body:not(.theme-dark) .text-neutral-50,
body:not(.theme-dark) .hover\:text-neutral-50:hover {
  color: var(--bam-body-text) !important;
}
/* Do not remap .text-white — used on blue/hero sections and chrome */

body:not(.theme-dark) .text-neutral-200 {
  color: #1e293b !important;
}

body:not(.theme-dark) .text-neutral-300 {
  color: #334155 !important;
}

/* Dark gradients (reserves solvency card etc.) become solid light cards */
body:not(.theme-dark) .bg-gradient-to-b,
body:not(.theme-dark) .bg-gradient-to-t,
body:not(.theme-dark) .bg-gradient-to-r,
body:not(.theme-dark) .bg-gradient-to-l,
body:not(.theme-dark) .from-neutral-700,
body:not(.theme-dark) .from-neutral-800,
body:not(.theme-dark) .from-neutral-900,
body:not(.theme-dark) .to-neutral-900,
body:not(.theme-dark) .to-neutral-800 {
  background-image: none !important;
}

body:not(.theme-dark) .from-neutral-700,
body:not(.theme-dark) .from-neutral-800,
body:not(.theme-dark) .from-neutral-900,
body:not(.theme-dark) .to-neutral-900,
body:not(.theme-dark) .to-neutral-800 {
  --tw-gradient-from: var(--bam-card) !important;
  --tw-gradient-to: var(--bam-card) !important;
  --tw-gradient-stops: var(--bam-card), var(--bam-card) !important;
}

body:not(.theme-dark) .text-neutral-400,
body:not(.theme-dark) .text-neutral-500 {
  color: var(--bam-muted) !important;
}

body:not(.theme-dark) .border-neutral-800,
body:not(.theme-dark) .border-neutral-700,
body:not(.theme-dark) .border-neutral-600,
body:not(.theme-dark) .border-neutral-500,
body:not(.theme-dark) .sm\:border-neutral-800,
body:not(.theme-dark) .md\:border-neutral-800,
body:not(.theme-dark) .md\:border-neutral-700,
body:not(.theme-dark) .lg\:border-neutral-800,
body:not(.theme-dark) .xl\:border-neutral-800 {
  border-color: var(--bam-border) !important;
}

body:not(.theme-dark) .divide-neutral-800 > :not([hidden]) ~ :not([hidden]),
body:not(.theme-dark) .divide-neutral-700 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--bam-border) !important;
}

/* Forms / inputs commonly used in user + auth */
body:not(.theme-dark) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body:not(.theme-dark) textarea,
body:not(.theme-dark) select:not(.home-bam-lang) {
  color: var(--bam-body-text);
}

body:not(.theme-dark) a.h-text-blue,
body:not(.theme-dark) .text-primary-500 {
  color: var(--bam-link) !important;
}

body:not(.theme-dark) a.h-text-blue:hover,
body:not(.theme-dark) .text-primary-500:hover,
body:not(.theme-dark) .hover\:text-primary-500:hover {
  color: var(--bam-link-hover) !important;
}

/* Soften gold CTAs on light pages so they stay readable */
body:not(.theme-dark) .gold-gradient-1 {
  color: #0f172a !important;
}

/* Gold clip-text on light pages (not inside dark heroes) */
body:not(.theme-dark) .gold-gradient-text {
  background: linear-gradient(90deg, #00193c 0%, #0054cc 45%, #b45309 100%) !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  filter: none !important;
  text-shadow: none !important;
}

body:not(.theme-dark) .body-medium,
body:not(.theme-dark) .body-large {
  color: #334155 !important;
  text-shadow: none !important;
}

body:not(.theme-dark) main h1.title-regular,
body:not(.theme-dark) main h1.title-large {
  text-shadow: none !important;
}

/* Dark hero bands (financials etc.): sharp white text, no glow */
body:not(.theme-dark) .bam-hero-dark {
  background-color: #00193c !important;
}

body:not(.theme-dark) .bam-hero-dark h1,
body:not(.theme-dark) .bam-hero-dark h1.title-regular,
body:not(.theme-dark) .bam-hero-dark h1.title-large,
body:not(.theme-dark) .bam-hero-dark .title-regular,
body:not(.theme-dark) .bam-hero-dark .title-large {
  color: #ffffff !important;
  text-shadow: none !important;
  filter: none !important;
}

body:not(.theme-dark) .bam-hero-dark .body-medium,
body:not(.theme-dark) .bam-hero-dark .body-large,
body:not(.theme-dark) .bam-hero-dark p {
  color: #e2e8f0 !important;
  text-shadow: none !important;
  filter: none !important;
}

body:not(.theme-dark) .bam-hero-dark .gold-gradient-text {
  background: linear-gradient(90deg, rgba(0,0,0,0) -19.39%, #ffe4b0 6.04%, rgba(255,228,176,0.5) 106.42%, rgba(255,255,255,0) 119.81%) !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  filter: none !important;
  text-shadow: none !important;
}

/* FAQ chevron is hardcoded #E4E4E4 — darken on light pages (svg use + img) */
body:not(.theme-dark) svg[aria-label="chevron-down-gray"],
body:not(.theme-dark) .faq-accordion-title svg,
body:not(.theme-dark) .faq-accordion-title img,
body:not(.theme-dark) .arrow-icon img,
body:not(.theme-dark) img[src*="chevron-down-gray"] {
  filter: brightness(0) saturate(100%);
  opacity: 0.55;
}

body:not(.theme-dark) .faq-accordion {
  border-bottom-color: var(--bam-border) !important;
}

body:not(.theme-dark) .faq-accordion-title h2,
body:not(.theme-dark) .faq-accordion-title label {
  color: var(--bam-body-text) !important;
}

body:not(.theme-dark) .faq-accordion-content,
body:not(.theme-dark) .faq-accordion-content p {
  color: #334155 !important;
}

body:not(.theme-dark) .faq-accordion-title:hover h2 {
  color: var(--bam-link) !important;
}

/* River forces h1–h5 { color:#fff } — override on light pages */
body:not(.theme-dark) h1,
body:not(.theme-dark) h2,
body:not(.theme-dark) h3,
body:not(.theme-dark) h4,
body:not(.theme-dark) h5,
body:not(.theme-dark) .title-large,
body:not(.theme-dark) .title-regular,
body:not(.theme-dark) .title-medium,
body:not(.theme-dark) .title-small {
  color: var(--bam-body-text) !important;
}

/* About page team cards / body copy */
body:not(.theme-dark) .c-about__profile-title,
body:not(.theme-dark) .c-about__card-title {
  color: var(--bam-body-text) !important;
}

body:not(.theme-dark) .c-about__role {
  color: var(--bam-muted) !important;
}

body:not(.theme-dark) .c-about__card-bio p {
  color: #334155 !important;
}

/* Investor logos drawn for dark bg — darken on light pages */
body:not(.theme-dark) .c-about__investor-img {
  filter: brightness(0.15);
  opacity: 0.85;
}

/* WP / article pages: keep readable on white */
body:not(.theme-dark) .river-wp-page,
body:not(.theme-dark) .wp-block-group,
body:not(.theme-dark) main[role="main"] {
  color: var(--bam-body-text);
}

body:not(.theme-dark) main[role="main"] p,
body:not(.theme-dark) article p,
body:not(.theme-dark) article .mt-2,
body:not(.theme-dark) article .mt-4 {
  color: #334155;
}

/* Reserves solvency highlight */
body:not(.theme-dark) #solvency-card,
body:not(.theme-dark) #solvency-card .text-neutral-200,
body:not(.theme-dark) #solvency-card .text-neutral-50 {
  color: var(--bam-body-text) !important;
}

body:not(.theme-dark) #solvency-card .text-3xl,
body:not(.theme-dark) #solvency-card .font-semibold {
  color: var(--bam-chrome) !important;
  font-weight: 700 !important;
}

/* Security / feature cards: strong contrast on remapped light panels */
body:not(.theme-dark) article[role="listitem"] h2,
body:not(.theme-dark) article[role="listitem"] h3,
body:not(.theme-dark) article[role="listitem"] .body-large-plus,
body:not(.theme-dark) article[role="listitem"] .body-regular,
body:not(.theme-dark) article[role="listitem"] .body-regular-plus,
body:not(.theme-dark) article[role="listitem"] .body-small-plus,
body:not(.theme-dark) article[role="listitem"] .title-small,
body:not(.theme-dark) article[role="listitem"] .title-large,
body:not(.theme-dark) article[role="listitem"] span.body-regular {
  color: var(--bam-body-text) !important;
}

body:not(.theme-dark) article[role="listitem"] p,
body:not(.theme-dark) article[role="listitem"] .body-small {
  color: #334155 !important;
}
