/* SeaCurrent — extended design tokens (loaded after colors_and_type.css) */

:root {
  /* Tell the browser our default chrome is dark — fixes native <select>
   * dropdown panels, scrollbars and date pickers rendering as white-on-white. */
  color-scheme: dark;

  /* Focus + elevation (new) */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 65%, transparent);
  --focus-ring-inset: inset 0 0 0 2px var(--accent);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.45);

  /* Breakpoints (use as fallbacks; CSS @media still needs literals) */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* Foreground — pushed near-white in dark mode so any text on the deep-blue
   * surfaces reads as white. Distinctions live in font weight / size, not color. */
  --fg-1: #f5f7fb;   /* primary body text  (was #e0e6ed) */
  --fg-2: #e1e7ef;   /* secondary labels   (was #a9b8cf, before that #8a9bb5) */
  --fg-3: #c9d1dc;   /* hints / captions   (was #7a8fa6) */
  --fg-4: #9ca8b8;   /* dividers / icons   (was #5a7a9a) */

  /* Semantic surface tints for toast / skeleton */
  --surface-success: rgba(52, 211, 153, 0.12);
  --surface-warn: rgba(245, 158, 11, 0.14);
  --surface-error: rgba(248, 113, 113, 0.14);

  /* Animation */
  --dur-slow: 0.4s;

  /* Spacing scale (4 / 8 / 12 / 16 / 24 / 32) — use for new components.
   * Existing pages use ad-hoc rem/px values; new components should adopt
   * these so cards/buttons stay rhythmically aligned across pages. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Radius scale — aliases for existing --r-* tokens, kept for clarity. */
  --radius-1: 6px;
  --radius-2: 10px;
  --radius-3: 16px;

  /* Button heights — lg meets WCAG AA touch target (44px) on mobile. */
  --btn-h-sm: 32px;
  --btn-h-md: 40px;
  --btn-h-lg: 48px;

  /* Card defaults */
  --card-bg: var(--bg-elevated);
  --card-border: 1px solid var(--border);
  --card-pad: var(--space-4);
}

/* Make sure native form-control options render with our palette. Some
 * browsers don't propagate the styled select bg/fg to the popup. */
option {
  background: #101d33;
  color: #ffffff;
}

/* Light mode override (Phase 8) */
[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f5f7fb;
  --bg-1: #ffffff;
  --bg-2: #eef2f7;
  --bg-3: #ffffff;
  --bg-elevated: #ffffff;

  --border: #d4dce5;
  --border-strong: #94a3b8;
  --border-hover: #64748b;
  --border-focus: #2563eb;

  --fg-0: #0a1628;
  --fg-1: #1e293b;
  --fg-2: #475569;
  --fg-3: #64748b;
  --fg-4: #94a3b8;

  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-strong-hover: #1e40af;

  --overlay-bg: rgba(255, 255, 255, 0.92);

  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-2: 0 4px 14px rgba(15, 23, 42, 0.12);
  --shadow-3: 0 12px 32px rgba(15, 23, 42, 0.18);

  --surface-success: rgba(5, 150, 105, 0.10);
  --surface-warn: rgba(217, 119, 6, 0.12);
  --surface-error: rgba(220, 38, 38, 0.10);
}

[data-theme="light"] option {
  background: #ffffff;
  color: #0a1628;
}
