/*
  Beacon brand tokens (light / dark).

  Revert palette: restore the BrightFix orange map below into the :root /
  html[data-theme] blocks, or abandon the brand/beacon-theme branch.

  Old BrightFix map (reference):
    --brand-accent: #E87D34;
    --brand-accent-hover: #d66f2a;
    --brand-accent-soft: rgb(255 247 237);
    --brand-accent-muted: #c56a24;
    --brand-accent-rgb: 232 125 52;
    --brand-ink: #120B08;
    --brand-brown: #5D2B17;
    --bf-bg: #f9fafb;          (gray-50)
    --bf-surface: #ffffff;
    --bf-border: #e5e7eb;
    --theme-color-light: #ffffff;
    --theme-color-dark: #E87D34;
*/

:root,
html[data-theme='light'] {
  color-scheme: light;

  --brand-accent: #c9a24a;
  --brand-accent-hover: #b8923f;
  --brand-accent-soft: rgb(250 243 224);
  --brand-accent-muted: #a67c2e;
  --brand-accent-rgb: 201 162 74;
  --brand-gold-hi: #f0d090;
  --brand-gold-mid: #d4a84b;
  --brand-gold-lo: #a67c2e;
  --brand-ink: #1a1714;
  --brand-brown: #5c4a32;
  --brand-stone: #8a7a66;

  --bf-bg: #f5f1ea;
  --bf-bg-elevated: #faf7f2;
  --bf-surface: #ffffff;
  --bf-surface-muted: #f0ebe3;
  --bf-border: #e4ddd2;
  --bf-border-strong: #d0c7b8;
  --bf-text: #1a1714;
  --bf-text-secondary: #6b6358;
  --bf-text-muted: #9a9184;
  --bf-overlay: rgb(26 23 20 / 0.45);
  --bf-header-bg: rgb(255 255 255 / 0.92);
  --bf-nav-bg: #1a1714;
  --bf-nav-inactive: #9ca3af;
  --bf-shadow-accent: rgb(201 162 74 / 0.35);
  --bf-focus-ring: 0 0 0 3px rgb(201 162 74 / 0.22);
  --bf-focus-border: var(--brand-accent);
  --bf-status-warn-bg: rgb(250 243 224);
  --bf-status-warn-border: rgb(232 210 150);
  --bf-status-warn-text: #5c4a32;
  --bf-status-due-bg: rgb(254 242 242);
  --bf-status-due-border: rgb(254 202 202);
  --bf-status-due-text: rgb(127 29 29);
  --bf-status-ok-bg: rgb(240 253 244);
  --bf-status-ok-border: rgb(187 247 208);
  --bf-status-ok-text: rgb(20 83 45);
  --bf-on-accent: #1a1714;
  --bf-btn-solid-bg: #1a1714;
  --bf-btn-solid-text: #ffffff;
  --theme-color: #f5f1ea;
}

html[data-theme='dark'] {
  color-scheme: dark;

  --brand-accent: #d4a84b;
  --brand-accent-hover: #e0b85c;
  --brand-accent-soft: rgb(42 36 24);
  --brand-accent-muted: #f0d090;
  --brand-accent-rgb: 212 168 75;
  --brand-gold-hi: #f0d090;
  --brand-gold-mid: #d4a84b;
  --brand-gold-lo: #a67c2e;
  --brand-ink: #f5f1ea;
  --brand-brown: #c4a882;
  --brand-stone: #a89880;

  --bf-bg: #0e0e0e;
  --bf-bg-elevated: #141414;
  --bf-surface: #1a1a1a;
  --bf-surface-muted: #222222;
  --bf-border: #2e2e2e;
  --bf-border-strong: #3d3d3d;
  --bf-text: #f5f1ea;
  --bf-text-secondary: #b8aea0;
  --bf-text-muted: #8a8074;
  --bf-overlay: rgb(0 0 0 / 0.55);
  --bf-header-bg: rgb(14 14 14 / 0.92);
  --bf-nav-bg: #0e0e0e;
  --bf-nav-inactive: #8a8074;
  --bf-shadow-accent: rgb(212 168 75 / 0.35);
  --bf-focus-ring: 0 0 0 3px rgb(212 168 75 / 0.28);
  --bf-focus-border: var(--brand-accent);
  --bf-status-warn-bg: rgb(42 36 24);
  --bf-status-warn-border: rgb(90 72 40);
  --bf-status-warn-text: #f0d090;
  --bf-status-due-bg: rgb(42 24 24);
  --bf-status-due-border: rgb(90 40 40);
  --bf-status-due-text: rgb(252 165 165);
  --bf-status-ok-bg: rgb(20 36 28);
  --bf-status-ok-border: rgb(40 80 55);
  --bf-status-ok-text: rgb(134 239 172);
  --bf-on-accent: #0e0e0e;
  --bf-btn-solid-bg: #d4a84b;
  --bf-btn-solid-text: #0e0e0e;
  --theme-color: #0e0e0e;
}

/* Page shell helpers */
.bf-page {
  background: var(--bf-bg);
  color: var(--bf-text);
  min-height: 100dvh;
}

.bf-card {
  background: var(--bf-surface);
  border: 1px solid var(--bf-border);
  color: var(--bf-text);
}

.bf-surface {
  background: var(--bf-surface);
}

/* Remap common Tailwind utility shells so dark mode works without mass renames */
html[data-theme='dark'] body.bg-gray-50,
html[data-theme='dark'] .bg-gray-50 {
  background-color: var(--bf-bg) !important;
}

html[data-theme='dark'] .bg-white {
  background-color: var(--bf-surface) !important;
}

html[data-theme='dark'] .bg-gray-100 {
  background-color: var(--bf-surface-muted) !important;
}

html[data-theme='dark'] .border-gray-100,
html[data-theme='dark'] .border-gray-200 {
  border-color: var(--bf-border) !important;
}

html[data-theme='dark'] .border-gray-300 {
  border-color: var(--bf-border-strong) !important;
}

html[data-theme='dark'] .text-gray-900,
html[data-theme='dark'] .text-gray-800,
html[data-theme='dark'] .text-gray-700 {
  color: var(--bf-text) !important;
}

html[data-theme='dark'] .text-gray-600,
html[data-theme='dark'] .text-gray-500 {
  color: var(--bf-text-secondary) !important;
}

html[data-theme='dark'] .text-gray-400 {
  color: var(--bf-text-muted) !important;
}

html[data-theme='dark'] .shadow-sm,
html[data-theme='dark'] .shadow-lg {
  --tw-shadow-color: rgb(0 0 0 / 0.45);
}

html[data-theme='dark'] input:not([type='checkbox']):not([type='radio']),
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
  background-color: var(--bf-surface-muted);
  color: var(--bf-text);
  border-color: var(--bf-border-strong);
}

html[data-theme='dark'] .bg-orange-50\/40,
html[data-theme='dark'] .bg-amber-50,
html[data-theme='dark'] .bg-green-50,
html[data-theme='dark'] .bg-red-50 {
  background-color: var(--bf-surface-muted) !important;
}

html[data-theme='light'] body.bg-gray-50 {
  background-color: var(--bf-bg);
}

html[data-theme='dark'] .bg-orange-50,
html[data-theme='dark'] .bg-orange-100,
html[data-theme='dark'] .hover\:bg-orange-50:hover,
html[data-theme='dark'] .hover\:bg-amber-50:hover {
  background-color: var(--brand-accent-soft) !important;
}

html[data-theme='dark'] .text-orange-700,
html[data-theme='dark'] .text-orange-800,
html[data-theme='dark'] .text-orange-900,
html[data-theme='dark'] .text-orange-950,
html[data-theme='dark'] .text-amber-700,
html[data-theme='dark'] .text-amber-800,
html[data-theme='dark'] .text-amber-900 {
  color: var(--brand-accent-muted) !important;
}

html[data-theme='dark'] .border-orange-100,
html[data-theme='dark'] .border-orange-200,
html[data-theme='dark'] .border-amber-200 {
  border-color: var(--bf-border-strong) !important;
}

html[data-theme='dark'] .ring-orange-100 {
  --tw-ring-color: rgb(var(--brand-accent-rgb) / 0.25) !important;
}

html[data-theme='dark'] .bg-green-100,
html[data-theme='dark'] .bg-red-100,
html[data-theme='dark'] .bg-amber-100 {
  background-color: var(--bf-surface-muted) !important;
}

html[data-theme='dark'] .text-green-700,
html[data-theme='dark'] .text-green-800,
html[data-theme='dark'] .text-green-900 {
  color: var(--bf-status-ok-text) !important;
}

html[data-theme='dark'] .text-red-600,
html[data-theme='dark'] .text-red-700,
html[data-theme='dark'] .text-red-800,
html[data-theme='dark'] .text-red-900 {
  color: var(--bf-status-due-text) !important;
}

/* Primary CTAs: brightfix-black fill must not flip with --brand-ink in dark mode */
.bg-brightfix-black.text-white,
button.bg-brightfix-black,
a.bg-brightfix-black {
  background-color: var(--bf-btn-solid-bg) !important;
  color: var(--bf-btn-solid-text) !important;
}

.bg-brightfix-orange.text-white,
button.bg-brightfix-orange,
a.bg-brightfix-orange {
  background-color: var(--brand-accent) !important;
  color: var(--bf-on-accent) !important;
}

.hover\:bg-brightfix-orange:hover {
  background-color: var(--brand-accent-hover) !important;
}

.hover\:bg-brightfix-black:hover {
  filter: brightness(1.08);
}

/* Auth submit buttons (login / signup / reset) */
#signin-submit,
#signup-submit,
#reset-submit,
#onboard-submit,
#invite-accept-btn,
#update-password-submit {
  background-color: var(--brand-accent) !important;
  color: var(--bf-on-accent) !important;
}

