/*
 * onadva link design tokens.
 * Shared by the admin console, public site and partner workspace. The mail
 * system keeps a copy in mail/style.css because it is served by another host.
 *
 * Surfaces read from semantic tokens only; themes swap the semantic layer.
 */
:root {
  /* Brand: emerald light trails on deep forest. */
  --brand-950: #041613;
  --brand-900: #072320;
  --brand-800: #0b302b;
  --brand-700: #10443c;
  --brand-600: #12634e;
  --brand-500: #178a63;
  --brand-400: #35b583;
  --brand-300: #79dcab;
  --brand-200: #b2f0cf;
  --brand-100: #dcf9e9;
  --brand-50: #f0fcf5;

  --amber-500: #c98a12;
  --amber-100: #fdf1d4;
  --red-500: #d0473d;
  --red-100: #fde5e2;
  --blue-500: #3c7fd0;
  --blue-100: #e1edfb;

  --font-sans:
    'Inter', 'SF Pro Text', 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans', 'Yu Gothic UI',
    sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 19px;
  --text-2xl: 24px;
  --text-3xl: 32px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 140ms;
  --duration: 240ms;
  --duration-slow: 520ms;

  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 34%, transparent);
}

/* Light surfaces: admin console and partner workspace. */
:root,
[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f6f4;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f6f8f6;
  --surface-sunken: #eef2ef;
  --surface-glass: rgb(255 255 255 / 0.78);
  --border: #e2e8e3;
  --border-strong: #cbd6ce;
  --text: #13281f;
  --text-muted: #5f7068;
  --text-subtle: #8a9891;
  --text-inverse: #ffffff;
  --accent: var(--brand-500);
  --accent-hover: var(--brand-600);
  --accent-soft: var(--brand-50);
  --accent-soft-strong: var(--brand-100);
  --accent-text: var(--brand-600);
  --on-accent: #ffffff;
  --success: #198a5b;
  --success-soft: #e3f6ec;
  --warning: #a8720b;
  --warning-soft: var(--amber-100);
  --danger: #c23d34;
  --danger-soft: var(--red-100);
  --info: var(--blue-500);
  --info-soft: var(--blue-100);
  --shadow-sm: 0 1px 2px rgb(15 40 30 / 0.06);
  --shadow-md: 0 1px 2px rgb(15 40 30 / 0.05), 0 8px 24px -10px rgb(15 40 30 / 0.16);
  --shadow-lg: 0 24px 64px -24px rgb(10 35 26 / 0.32), 0 2px 6px rgb(10 35 26 / 0.06);
  --chart-1: var(--brand-400);
  --chart-2: #6f9fd8;
  --chart-grid: #e6ece8;
}

/* Dark surfaces: the public site always, the consoles on request or by system setting. */
[data-theme='dark'],
.theme-dark {
  color-scheme: dark;
  --bg: #061a17;
  --bg-elevated: #0b2621;
  --surface: rgb(14 44 38 / 0.72);
  --surface-muted: rgb(20 56 48 / 0.55);
  --surface-sunken: rgb(3 18 15 / 0.55);
  --surface-glass: rgb(9 33 29 / 0.66);
  --border: rgb(178 240 207 / 0.12);
  --border-strong: rgb(178 240 207 / 0.24);
  --text: #edf8f1;
  --text-muted: #a7bdb3;
  --text-subtle: #7d958a;
  --text-inverse: #062420;
  --accent: var(--brand-300);
  --accent-hover: var(--brand-200);
  --accent-soft: rgb(121 220 171 / 0.1);
  --accent-soft-strong: rgb(121 220 171 / 0.18);
  --accent-text: var(--brand-200);
  --on-accent: #052119;
  --success: #7fe3ad;
  --success-soft: rgb(127 227 173 / 0.12);
  --warning: #f2c35f;
  --warning-soft: rgb(242 195 95 / 0.13);
  --danger: #ff8d82;
  --danger-soft: rgb(255 141 130 / 0.13);
  --info: #8fbcf2;
  --info-soft: rgb(143 188 242 / 0.13);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 1px 2px rgb(0 0 0 / 0.25), 0 12px 30px -12px rgb(0 0 0 / 0.55);
  --shadow-lg: 0 30px 80px -30px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(178 240 207 / 0.06);
  --chart-1: var(--brand-300);
  --chart-2: #8fbcf2;
  --chart-grid: rgb(178 240 207 / 0.1);
}

@media (prefers-color-scheme: dark) {
  [data-theme='auto'] {
    color-scheme: dark;
    --bg: #071512;
    --bg-elevated: #0d211d;
    --surface: #0f2621;
    --surface-muted: #132d27;
    --surface-sunken: #0a1c18;
    --surface-glass: rgb(13 33 29 / 0.82);
    --border: #1e3a33;
    --border-strong: #2d5048;
    --text: #e9f5ee;
    --text-muted: #9fb5aa;
    --text-subtle: #75887f;
    --text-inverse: #062420;
    --accent: var(--brand-300);
    --accent-hover: var(--brand-200);
    --accent-soft: rgb(121 220 171 / 0.1);
    --accent-soft-strong: rgb(121 220 171 / 0.17);
    --accent-text: var(--brand-200);
    --on-accent: #052119;
    --success: #7fe3ad;
    --success-soft: rgb(127 227 173 / 0.12);
    --warning: #f2c35f;
    --warning-soft: rgb(242 195 95 / 0.12);
    --danger: #ff8d82;
    --danger-soft: rgb(255 141 130 / 0.12);
    --info: #8fbcf2;
    --info-soft: rgb(143 188 242 / 0.12);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 26px -12px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 30px 80px -30px rgb(0 0 0 / 0.8);
    --chart-1: var(--brand-300);
    --chart-2: #8fbcf2;
    --chart-grid: #1c3530;
  }
}
