/*
 * DealWorthIt default brand theme (Phase 1A — theme foundation).
 *
 * Overrides the --dwi-* token contract defined in themes/tokens.css for
 * <html data-brand="dealworthit">. Loaded after tokens.css, before
 * common_styles.css.
 *
 * Phase 1E: the approved DealWorthIt flip. Primary family now carries the
 * canonical emerald palette (references: docs/design/dealworthit-app.html
 * primary, underwrite-flow-v3.html secondary); typography is IBM Plex via
 * the tokens.css bridge. Bundle component rules with compiled-in cyan
 * literals are overridden by the generated theme-dealworthit-components.css
 * (scripts/generate_theme_flip_overrides.php).
 */

[data-brand=dealworthit] {
  /* Brand primary — canonical emerald (flipped in Phase 1E). */
  --dwi-color-primary: #0E6E59;
  --dwi-color-primary-rgb: 14, 110, 89;
  --dwi-color-primary-strong: #0B5C4A;
  --dwi-color-primary-soft: rgba(14, 110, 89, 0.10);
  --dwi-color-accent: #0E6E59;
  --dwi-color-accent-rgb: 14, 110, 89;

  /* Inert (unbridged) — v3 design values. */
  --dwi-color-page: #F6F8F7;
  --dwi-color-surface: #FFFFFF;
  --dwi-color-border: #E8ECEA;
  --dwi-color-text: #14211D;
  --dwi-color-muted: #6B7570;

  --dwi-radius-sm: 6px;
  --dwi-radius-md: 9px;
  --dwi-radius-lg: 14px;
  --dwi-shadow-card: none; /* v3 resting cards are border-delineated */

  /* Bridging this later requires loading IBM Plex in the layouts first. */
  --dwi-font-sans: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;

  /* Phase 1D additions — inert, from docs/design/dealworthit-app.html.
     New semantics (no pre-v3 equivalent), so values match the tokens.css
     defaults. No dark deltas yet (dark palette proposed, not applied). */
  --dwi-color-text-secondary: #2B3A35;
  --dwi-color-muted-soft: #9AA39E;
  --dwi-color-line: var(--dwi-color-border); /* alias; mode-aware via border */
  --dwi-color-avatar: #E74C3C;               /* one-off user-avatar coral */
  --dwi-color-hover: #F5F7F6;
  --dwi-color-rail: #FBFCFC;
  --dwi-color-line-soft: #F0F3F1;
  --dwi-color-positive: #0E6E59;
  --dwi-color-negative: #BC4A3D;
  --dwi-color-negative-soft: rgba(188, 74, 61, 0.10);
  --dwi-color-warning: #B7791F;
  --dwi-color-warning-soft: rgba(183, 121, 31, 0.13);
  --dwi-color-clay: #C0705E; /* secondary data series (expense bars etc.) */
  --dwi-shadow-hover: 0 4px 12px -4px rgba(20, 40, 30, 0.14);
  --dwi-shadow-raised: 0 8px 22px -10px rgba(20, 40, 30, 0.18);
  --dwi-font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --dwi-status-new: #6366A8;
  --dwi-status-new-soft: rgba(99, 102, 168, 0.12);
  --dwi-status-market: #3E78A8;
  --dwi-status-market-soft: rgba(62, 120, 168, 0.12);
  --dwi-status-working: #B7791F;
  --dwi-status-working-soft: rgba(183, 121, 31, 0.13);
  --dwi-status-portfolio: #0E6E59;
  --dwi-status-portfolio-soft: rgba(14, 110, 89, 0.10);
  --dwi-status-lost: #BC4A3D;
  --dwi-status-lost-soft: rgba(188, 74, 61, 0.10);
}

/* Dark mode — accent-only emerald flip per the approved proposal in
   docs/design/theme-flip-readiness-1d.md: the primary family lightens for
   contrast on Metronic's dark surfaces (~4.6:1 on #1e1e2d); neutrals stay at
   the current Metronic dark values (a green-tinted dark neutral set is a
   possible later phase, not this one). */
[data-brand=dealworthit][data-theme=dark] {
  --dwi-color-primary: #2FB695;
  --dwi-color-primary-rgb: 47, 182, 149;
  --dwi-color-primary-strong: #279C80;
  --dwi-color-primary-soft: rgba(47, 182, 149, 0.16);
  --dwi-color-accent: #2FB695;
  --dwi-color-accent-rgb: 47, 182, 149;
  --dwi-color-positive: #2FB695;
  --dwi-color-negative: #D96A5C;
  --dwi-color-warning: #D49A3F;

  --dwi-color-page: #1e1e2d;
  --dwi-color-surface: #1e1e2d;
  --dwi-color-border: #2B2B40;
  --dwi-color-text: #FFFFFF;
  --dwi-color-muted: #565674;
  --dwi-shadow-card: none;
}
