/* =====================================================
   RWAD THEME SYSTEM (WCAG AA SAFE)
   Drop-in replacement
   ===================================================== */

/* -----------------------------------------------------
   BASE VARIABLE CONTRACT (DO NOT CHANGE NAMES)
----------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-page: #0f172a;
  --bg-card: #111827;
  --bg-header: #020617;
  --bg-footer: #020617;
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --bg-menu: #020617;
  --bg-secondary: #1f2937;
  /* Text */
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  /* WCAG-safe muted */
  --text-label: #c7d2fe;
  --text-inverse: #ffffff;

  /* Accent */
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.28);
  /* ===== Semantic Status ===== */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  /* Borders & shadows */
  --border-soft: rgba(255, 255, 255, 0.12);


  /* ===== Shadow System ===== */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-light: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.25);

  /* Forms / buttons */
  --form-bg: var(--bg-card);
  --form-text: var(--text-main);
  --form-border: var(--border-soft);
  --btn-radius: 8px;

  /* Metrics */

  /* ===== Radius System ===== */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ===== Spacing Scale ===== */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* ===== Typography ===== */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.85rem;
  --font-size-base: 0.95rem;
  --font-size-lg: 1.1rem;
  --font-size-xl: 1.4rem;

  /* ===== Input Metrics ===== */
  --input-padding: 10px 12px;
  --input-height: 36px;

  /* ===== Header Metrics ===== */
  --header-height: 48px;

  /* ===== Animation Speed ===== */
  --speed-fast: 120ms;
  --speed-normal: 180ms;
  --speed-slow: 300ms;
}

/* =====================================================
   LIGHT (WCAG SAFE)
   ===================================================== */
[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #e2e8f0;
  --bg-footer: #e2e8f0;
  --bg-menu: #e2e8f0;

  --text-main: #020617;
  --text-muted: #475569;
  --text-label: #1e293b;
  --text-primary: #0f1d5e;
  --text-secondary: #1e293b;

  --accent: #15803d;
  /* darkened for contrast */
  --accent-soft: rgba(21, 128, 61, 0.22);

  --border-soft: rgba(2, 6, 23, 0.14);
}

/* =====================================================
   FOREST GREEN (WCAG SAFE)
   ===================================================== */
[data-theme="forest-green"] {
  --bg-page: #0b3d0b;
  --bg-card: #145214;
  --bg-header: #1e6f1e;
  --bg-footer: #145214;
  --bg-menu: #2a8a2a;

  --text-primary: #ecfdf5;
  --text-secondary: #d1fae5;
  --text-muted: #b7e4c7;
  --text-label: #d1fae5;

  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.3);

  --border-soft: rgba(183, 228, 199, 0.25);
  --border-strong: rgba(2, 6, 23, 0.28);
}

/* =====================================================
   OCEAN TEAL (WCAG SAFE)
   ===================================================== */
[data-theme="ocean-teal"] {
  --bg-page: #014d4d;
  --bg-card: #017373;
  --bg-header: #026c6c;
  --bg-footer: #017373;
  --bg-menu: #02b3b3;

  --text-main: #e6fffa;
  --text-muted: #9de8e8;
  --text-label: #ccfbf1;

  --accent: #0ea5a4;
  --accent-soft: rgba(14, 165, 164, 0.32);

  --border-soft: rgba(204, 251, 241, 0.25);
}

/* =====================================================
   SOLARIZED DARK (WCAG SAFE – RWAD)
   Source: theme-card solarized-dark preview
   ===================================================== */
[data-theme="solarized-dark"] {
  /* Backgrounds */
  --bg-page: #002b36;
  /* base03 */
  --bg-card: #265763;
  /* base02 */
  --bg-header: #21292c;
  /* base01 */
  --bg-footer: #586e75;
  --bg-menu: #657b83;
  /* base00 */

  /* Text */

  --text-primary: #fdf6e3;
  --text-secondary: #eee8d5;
  --text-main: #fdf6e3;
  /* base3 */
  --text-muted: #93a1a1;
  /* base1 */
  --text-label: #eee8d5;
  /* base2 */

  /* Accent */
  --accent: #b58900;
  /* yellow */
  --accent-soft: rgba(181, 137, 0, 0.32);

  /* Borders */
  --border-soft: rgba(147, 161, 161, 0.28);
  --border-strong: rgba(147, 161, 161, 0.4);
}

/* =====================================================
   BLUE SKY (WCAG SAFE – button fixed)
   ===================================================== */
[data-theme="blue-sky"] {
  --bg-page: #03045e;
  --bg-card: #023e8a;
  --bg-header: #0077b6;
  --bg-footer: #023e8a;
  --bg-menu: #0096c7;

  --text-main: #e6f4ff;
  --text-muted: #a5d8ff;
  --text-label: #caf0f8;

  --accent: #0096c7;
  /* darkened */
  --accent-soft: rgba(0, 150, 199, 0.35);

  --border-soft: rgba(165, 216, 255, 0.25);
}

/* =====================================================
   EXPRESSIVE THEMES (SAFE-ADJUSTED)
   ===================================================== */

/* Fiery Red */
[data-theme="fiery-red"] {
  --bg-page: #2b050a;
  --bg-card: #370617;
  --bg-header: #6a040f;
  --bg-footer: #370617;
  --bg-menu: #9d0208;

  --text-main: #fff1e6;
  --text-muted: #ffd6a5;
  --text-label: #ffba08;

  --accent: #ef4444;
  /* lifted contrast */
  --accent-soft: rgba(239, 68, 68, 0.35);

  --border-soft: rgba(255, 186, 8, 0.25);
}

/* Midnight Purple */
[data-theme="midnight-purple"] {
  --bg-page: #2e003e;
  --bg-card: #4b006e;
  --bg-header: #5a189a;
  --bg-footer: #4b006e;
  --bg-menu: #6a0dad;

  --text-main: #f3e8ff;
  --text-muted: #d8b4fe;
  --text-label: #e9d5ff;

  --accent: #a855f7;
  --accent-soft: rgba(168, 85, 247, 0.35);

  --border-soft: rgba(216, 180, 254, 0.25);
}

/* =====================================================
   GLOBAL SAFETY OVERRIDES
   (Prevents future contrast regressions)
   ===================================================== */

/* Ensure buttons always pass AA */
.btn,
.btn-theme-primary,
.btn-theme-secondary,
.btn-theme-success,
.btn-theme-danger,
.btn-theme-info {
  color: var(--text-inverse);
}

/* Accent text on accent-soft backgrounds */
.text-accent {
  color: var(--accent);
}

/* Muted text floor (never below AA) */
.text-muted {
  color: var(--text-muted) !important;
}