/**
 * DECTO theme unify v6 — light forest text + app-dark harmony
 * Lightweight overrides. Marker: BN_THEME_UNIFY_V6
 * Loaded last (bundle tail + force link).
 */

/* ── Light: black-ish → brand green ── */
:root,
html[data-theme="light"],
[data-theme="light"] {
  --bn-text: #1A3D36;
  --bn-text-2: #4d635c;
  --bn-text-3: #6a7a73;
  --bn-text-muted: #6a7a73;
  --text-primary: #1A3D36;
  --text-secondary: #4d635c;
  --text-muted: #6a7a73;
  --text-primary-color: #1A3D36;
  --bn-ink-teal: #1A3D36;
  --bn-graphite: #1A3D36;
}

html[data-theme="light"] body,
body:not([data-theme="dark"]),
[data-theme="light"] body {
  color: #1A3D36 !important;
}

/* Broad text → forest (exclude CTAs / on-media / invert) */
html[data-theme="light"] body:not(.auth-page) :where(
  h1, h2, h3, h4, h5, h6, p, li, label, td, th, small, span, a, strong, em, div, button
):not(.btn-primary):not(.btn):not([class*="btn-"]):not(.bl-btn-champagne):not(.bl-btn-hero-cta):not(.bn-nav-login-cta):not(.on-media):not(.story-seg) {
  color: inherit;
}

html[data-theme="light"] :where(
  h1, h2, h3, h4, h5, h6,
  .page-title, .section-title, .card-title, .bn-heading, .bn-body,
  .bn-profile-name, .bn-feed-card__caption, .feed-post-author-name,
  .bn-chat-list-item__name, .notif-item__title, .settings-row__label,
  .app-header, .bottom-nav-item span, .navbar .nav-brand,
  .lux-menu a, .lux-menu span, .bn-menu-link, .empty-state__title
) {
  color: #1A3D36 !important;
  -webkit-text-fill-color: #1A3D36 !important;
}

html[data-theme="light"] :where(
  p, li, label, td, th, small,
  .bn-text-muted, .text-muted, .bn-text-2, .bn-feed-card__desc,
  .bn-profile-handle, .bn-profile-bio, .feed-post-username,
  .bn-chat-list-item__preview, .notif-item__body, .settings-row__hint,
  .empty-state__desc, .form-hint, .help-text
) {
  color: #4d635c !important;
  -webkit-text-fill-color: #4d635c !important;
}

html[data-theme="light"] body.app-shell .bottom-nav-item,
html[data-theme="light"] body.app-shell .bottom-nav-item i,
html[data-theme="light"] body.app-shell .bottom-nav-item svg,
html[data-theme="light"] body.app-shell .app-header-icon,
html[data-theme="light"] body.app-shell .app-header-icon i,
html[data-theme="light"] body.app-shell .app-header-icon svg {
  color: #1A3D36 !important;
  fill: currentColor;
  stroke: currentColor;
}

/* Keep cream/white on green CTAs */
html[data-theme="light"] :where(
  .btn-primary, .btn.btn-primary, a.btn-primary,
  .bl-btn-champagne, .bl-btn-hero-cta, a.bn-nav-login-cta,
  .bn-cta-band h2, .bn-cta-band p, .cta-band h2, .cta-band p,
  body.index-page .bl-cta-band h2, body.index-page .bl-cta-band p
) {
  color: #fffcf8 !important;
  -webkit-text-fill-color: #fffcf8 !important;
}

/* Cards light */
html[data-theme="light"] :where(
  .card, .bn-card, .lux-card, .panel-card, .glass-card, .bn-panel,
  .bn-feed-card, .notif-item, .settings-card, .bn-search-bar
) {
  background: #FFFCF8;
  border-color: rgba(26, 61, 54, 0.1);
  color: #1A3D36;
}

/* Landing trust icons: simple glyph, no filled green circle */
body.index-page .bl-hero__trust-icon {
  width: 26px !important;
  height: 26px !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--bn-green, #1A3D36) !important;
}
body.index-page .bl-hero__trust-icon i {
  color: var(--bn-green, #1A3D36) !important;
  background: transparent !important;
}

/* ── Dark: Flutter app_dark palette ── */
html[data-theme="dark"],
[data-theme="dark"] {
  --bn-cream: #161F1C;
  --bn-cream-2: #1D2825;
  --bn-ivory: #212C28;
  --bn-surface: #212C28;
  --bn-surface-2: #1D2825;
  --bn-white: #26312E;
  --bn-mist: #35433E;
  --bn-bg-canvas: #161F1C;

  --bn-text: #F8FCFA;
  --bn-text-2: #E2EBE7;
  --bn-text-3: #B8C5BF;
  --bn-text-muted: #B8C5BF;
  --text-primary: #F8FCFA;
  --text-secondary: #E2EBE7;
  --text-muted: #B8C5BF;

  --bn-green: #C9A66B;
  --bn-green-deep: #E8D4A8;
  --bn-green-mid: #C9A66B;
  --bn-green-soft: rgba(201, 166, 107, 0.14);
  --bn-gold: #C9A66B;
  --bn-gold-light: #E8D4A8;

  --bn-border: rgba(232, 212, 168, 0.14);
  --bn-border-soft: rgba(232, 212, 168, 0.08);
  --bn-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --bn-shadow-md: 0 10px 28px rgba(0, 0, 0, 0.32);
  --bn-gradient-surface: linear-gradient(180deg, #1D2825 0%, #161F1C 100%);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.app-shell,
[data-theme="dark"] body {
  background: #161F1C !important;
  color: #F8FCFA !important;
}

html[data-theme="dark"] body.app-shell .main-content,
html[data-theme="dark"] .container,
html[data-theme="dark"] .page-shell {
  background: transparent !important;
}

html[data-theme="dark"] :where(
  .card, .bn-card, .lux-card, .panel-card, .glass-card, .bn-panel,
  .bn-profile-card, .bn-feed-card, .bn-feed-card__author, .bn-feed-card__body,
  .auth-card, .form-control, .bn-search-bar, .notif-item, .bn-chat-list-item,
  .settings-card, .settings-row, .lux-menu-panel, .modal-content, .sheet,
  .bn-explore-card, .doctor-card, .clinic-card
) {
  background: #212C28 !important;
  border-color: rgba(232, 212, 168, 0.12) !important;
  color: #F8FCFA !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] :where(
  h1, h2, h3, h4, h5, h6, p, label, li,
  .bn-body, .section-title, .page-title, .bn-profile-name,
  .bn-feed-card__caption, .bn-feed-card__author strong,
  .bn-chat-list-item__name, .notif-item__title, .settings-row__label,
  .bottom-nav-item span
) {
  color: #F8FCFA !important;
  -webkit-text-fill-color: #F8FCFA !important;
}

html[data-theme="dark"] :where(
  .bn-text-2, .text-muted, .bn-text-muted, .bn-profile-bio,
  .bn-profile-handle, .feed-post-username, .bn-feed-card__desc,
  .bn-chat-list-item__preview, .notif-item__body, .settings-row__hint
) {
  color: #B8C5BF !important;
  -webkit-text-fill-color: #B8C5BF !important;
}

html[data-theme="dark"] body.app-shell .app-header,
html[data-theme="dark"] body.app-shell .navbar,
html[data-theme="dark"] body.app-shell .navbar--premium,
html[data-theme="dark"] body.app-shell .bottom-nav {
  background: #1D2825 !important;
  border-color: rgba(232, 212, 168, 0.1) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body.app-shell .app-header-icon,
html[data-theme="dark"] body.app-shell .app-header-icon i,
html[data-theme="dark"] body.app-shell .app-header-icon svg,
html[data-theme="dark"] body.app-shell .bottom-nav-item,
html[data-theme="dark"] body.app-shell .bottom-nav-item i,
html[data-theme="dark"] body.app-shell .bottom-nav-item svg {
  color: #E8D4A8 !important;
  fill: currentColor;
}

html[data-theme="dark"] body.app-shell .bottom-nav-item.active,
html[data-theme="dark"] body.app-shell .bottom-nav-item.is-active {
  color: #E8D4A8 !important;
  background: rgba(201, 166, 107, 0.14) !important;
}

html[data-theme="dark"] :where(.btn-primary, .btn.btn-primary, a.btn-primary) {
  background: linear-gradient(135deg, #C9A66B, #E8D4A8) !important;
  color: #142824 !important;
  -webkit-text-fill-color: #142824 !important;
  border: none !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #26312E !important;
  color: #F8FCFA !important;
  border-color: rgba(232, 212, 168, 0.16) !important;
}

html[data-theme="dark"] .lux-menu,
html[data-theme="dark"] .lux-menu-panel {
  background: #1D2825 !important;
  color: #F8FCFA !important;
  border-color: rgba(232, 212, 168, 0.12) !important;
}

html[data-theme="dark"] .lux-menu a {
  color: #F8FCFA !important;
}

/* Soft center search halo (not heavy AI pulse) */
body.app-shell .bottom-nav-item--primary[data-nav="search"]::before,
body.app-shell .bottom-nav-item--search::before {
  background: radial-gradient(circle, rgba(201, 166, 107, 0.2), transparent 72%) !important;
  animation: none !important;
  opacity: 0.85;
}

/* Auth journey panel: keep white text on green */
body.auth-page .auth-illustration--lux,
body.auth-page .auth-illustration--lux * {
  color: #fffcf8 !important;
  -webkit-text-fill-color: #fffcf8 !important;
}

/* Header create icons */
body.app-shell .app-header-cluster--start {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
