/*
 * Deelow Remote Desktop — design tokens.
 *
 * The dark theme is the reference look (it follows the Windows application
 * mock-up: deep navy window, slightly lighter raised cards, one confident blue).
 * The light theme keeps the navy navigation rail so both themes read as the
 * same product. The effective theme is set on <html data-theme="dark|light">
 * by assets/js/theme-init.js before first paint.
 */

:root {
  color-scheme: dark;

  /* Typography */
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, "Noto Sans",
    "Liberation Sans", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, "SF Mono", Menlo, "DejaVu Sans Mono",
    "Liberation Mono", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.625rem;
  --text-3xl: 2rem;

  /* Spacing (4 px rhythm) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration: 180ms;

  /* Layout */
  --sidebar-width: 264px;
  --topbar-height: 56px;
  --content-max: 1180px;
  --control-height: 2.5rem;
  --control-height-sm: 2rem;

  /* Surfaces */
  --bg: #0e1420;
  --bg-sunken: #0a0f18;
  --surface: #151d2c;
  --surface-raised: #1a2334;
  --surface-hover: #1e283b;
  --surface-overlay: #1c2638;
  --field: #0f1622;
  --border: #263143;
  --border-strong: #364357;
  --field-border: #586781;
  --divider: #212b3c;

  /* Text */
  --text: #f2f5fa;
  --text-muted: #a3afc2;
  --text-subtle: #8592a8;
  --placeholder: #7786a0;
  --link: #7fb0ff;
  --link-hover: #a9c9ff;

  /* Brand blue */
  --primary: #2563eb;
  --primary-hover: #2f6df0;
  --primary-active: #1d55d4;
  --on-primary: #ffffff;
  --primary-soft: rgba(37, 99, 235, 0.18);
  --primary-soft-text: #a9c6ff;
  --primary-ring: rgba(96, 150, 255, 0.55);
  --focus: #8ab4ff;

  /* Secondary controls */
  --control: #263247;
  --control-hover: #2d3a52;
  --control-active: #222d40;
  --control-text: #e7ecf4;

  /* Status (always paired with an icon and a label, never colour alone) */
  --success: #22c55e;
  --success-text: #4ade80;
  --success-soft: rgba(34, 197, 94, 0.14);
  --success-line: rgba(34, 197, 94, 0.32);
  --warning: #f59e0b;
  --warning-text: #fbbf24;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --warning-line: rgba(245, 158, 11, 0.34);
  --danger: #ef4444;
  --danger-text: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --danger-line: rgba(239, 68, 68, 0.36);
  --danger-solid: #dc2626;
  --danger-solid-hover: #e23d3d;
  --info: #38bdf8;
  --info-text: #7dd3fc;
  --info-soft: rgba(56, 189, 248, 0.14);
  --info-line: rgba(56, 189, 248, 0.32);
  --neutral: #7385a0;
  --neutral-soft: rgba(115, 133, 160, 0.16);
  --neutral-line: rgba(115, 133, 160, 0.34);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(3, 7, 15, 0.4);
  --shadow-md: 0 8px 24px rgba(3, 7, 15, 0.38);
  --shadow-lg: 0 24px 64px rgba(2, 5, 12, 0.6);
  --backdrop: rgba(4, 8, 16, 0.66);

  /* Navigation rail (navy in both themes) */
  --rail-bg: #0a0f18;
  --rail-border: #1b2433;
  --rail-text: #e6ecf5;
  --rail-muted: #9aa7bb;
  --rail-hover: rgba(148, 170, 205, 0.1);
  --rail-active: rgba(37, 99, 235, 0.22);
  --rail-active-text: #dbe7ff;
  --rail-control: #172030;
  --rail-control-border: #2a3649;

  /* Decorative */
  --glow: radial-gradient(60rem 30rem at 85% -10%, rgba(37, 99, 235, 0.16), transparent 60%);
  --skeleton-base: #1b2536;
  --skeleton-shine: #26324a;
  --code-bg: #0b111b;
  --code-text: #c9d4e5;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f2f5fa;
  --bg-sunken: #e8edf5;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-hover: #f6f8fc;
  --surface-overlay: #ffffff;
  --field: #ffffff;
  --border: #dce3ee;
  --border-strong: #c5cfde;
  --field-border: #7f8da3;
  --divider: #e6ebf3;

  --text: #101a2e;
  --text-muted: #4a5870;
  --text-subtle: #5a6880;
  --placeholder: #66748c;
  --link: #1d4ed8;
  --link-hover: #1a3fae;

  --primary: #2563eb;
  --primary-hover: #1d55d4;
  --primary-active: #1a4bbd;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --primary-soft-text: #1d4ed8;
  --primary-ring: rgba(37, 99, 235, 0.4);
  --focus: #1d4ed8;

  --control: #edf1f7;
  --control-hover: #e2e8f1;
  --control-active: #d8dfeb;
  --control-text: #17233a;

  --success: #16a34a;
  --success-text: #126f37;
  --success-soft: rgba(22, 163, 74, 0.12);
  --success-line: rgba(22, 163, 74, 0.36);
  --warning: #d97706;
  --warning-text: #8a5a08;
  --warning-soft: rgba(217, 119, 6, 0.14);
  --warning-line: rgba(217, 119, 6, 0.4);
  --danger: #dc2626;
  --danger-text: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --danger-line: rgba(220, 38, 38, 0.36);
  --danger-solid: #dc2626;
  --danger-solid-hover: #c81f1f;
  --info: #0284c7;
  --info-text: #0369a1;
  --info-soft: rgba(2, 132, 199, 0.1);
  --info-line: rgba(2, 132, 199, 0.34);
  --neutral: #7b8aa1;
  --neutral-soft: rgba(100, 116, 139, 0.12);
  --neutral-line: rgba(100, 116, 139, 0.34);

  --shadow-sm: 0 1px 2px rgba(16, 26, 46, 0.06), 0 1px 1px rgba(16, 26, 46, 0.04);
  --shadow-md: 0 6px 20px rgba(16, 26, 46, 0.08), 0 1px 3px rgba(16, 26, 46, 0.06);
  --shadow-lg: 0 24px 64px rgba(16, 26, 46, 0.22);
  --backdrop: rgba(16, 26, 46, 0.48);

  --rail-bg: #101a2e;
  --rail-border: #101a2e;
  --rail-text: #eef2f8;
  --rail-muted: #a9b6ca;
  --rail-hover: rgba(169, 190, 225, 0.12);
  --rail-active: rgba(59, 130, 246, 0.28);
  --rail-active-text: #ffffff;
  --rail-control: #1a2742;
  --rail-control-border: #2c3b5a;

  --glow: radial-gradient(60rem 30rem at 85% -10%, rgba(37, 99, 235, 0.09), transparent 60%);
  --skeleton-base: #e4e9f2;
  --skeleton-shine: #f3f6fb;
  --code-bg: #f1f4f9;
  --code-text: #1c2a44;
}
