/*
  Saduo colour tokens, from brand kit v1.0 (studio/marketing/brand/kit-v1.0, palette E):
  navy #2E4256, silver #9FB3C4, fog #F1F3F5, night #131B23, mid #4D6781.

  This is the single source for every Saduo screen. Each app ships an exact copy
  (apps/id/public/saduo-tokens.css and apps/admin/src/saduo-tokens.css) because each
  builds in its own Docker context. Edit THIS file, then run:
    node apps/shared/brand/sync.cjs
  A test in each app fails when its copy differs from this file.

  Theme selection:
  - default (no data-theme): light, or dark when the system prefers it;
  - data-theme="light" or "dark": a choice made in the app (the admin header), which wins.
  Contrast of every text pair is at least 4.5:1 and of control borders at least 3:1 in
  both themes (measured in add-admin-user-management and again in add-i18n).
*/
:root {
  --bg: #f1f3f5;
  --surface: #ffffff;
  --text: #131b23;
  --heading: #2e4256;
  --muted: #4d6781;
  --line: #d3dae1;
  --link: #2e4256;

  --header-bg: #2e4256;
  --header-text: #f1f3f5;
  --header-muted: #9fb3c4;
  --nav-active-bg: #131b23;
  --lang-on-bg: #f1f3f5;
  --lang-on-text: #2e4256;
  --header-border: #9fb3c4;

  --btn-bg: #ffffff;
  --btn-text: #2e4256;
  --btn-border: #2e4256;
  --btn-hover: #f1f3f5;
  --primary-bg: #2e4256;
  --primary-text: #f1f3f5;
  --primary-hover: #131b23;

  --danger: #a1262d;
  --danger-bg: #fbeaea;
  --ok: #1f6b45;
  --ok-bg: #e5f3eb;

  --input-bg: #ffffff;
  --input-border: #4d6781;
  --focus: #4d6781;
  --overlay: rgba(19, 27, 35, 0.55);

  /* Shape, space, type and motion: the scales of studio/design/design-direction.md. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius: var(--radius-md);

  --space-0: 0;
  --space-025: 2px;
  --space-050: 4px;
  --space-075: 8px;
  --space-100: 12px;
  --space-200: 16px;
  --space-300: 24px;
  --space-400: 32px;
  --space-500: 40px;
  --space-600: 48px;
  --space-700: 64px;
  --space-800: 80px;
  --space-900: 96px;

  --font:
    'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  --fs-display: 3.75rem;
  --lh-display: 4rem;
  --fs-h1: 3rem;
  --lh-h1: 3.25rem;
  --fs-h2: 2.25rem;
  --lh-h2: 2.75rem;
  --fs-h3: 1.5rem;
  --lh-h3: 2rem;
  --fs-h4: 1.25rem;
  --lh-h4: 1.75rem;
  --fs-title: 1rem;
  --lh-title: 1.5rem;
  --fs-body: 1rem;
  --lh-body: 1.5rem;
  --fs-small: 0.875rem;
  --lh-small: 1.25rem;
  --fs-caption: 0.75rem;
  --lh-caption: 1rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-color: 300ms;
  --dur-move: 500ms;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #131b23;
  --surface: #1b2631;
  --text: #f1f3f5;
  --heading: #dbe5ee;
  --muted: #9fb3c4;
  --line: #2f3f4f;
  --link: #b9cadb;

  --header-bg: #0d141a;
  --header-text: #f1f3f5;
  --header-muted: #9fb3c4;
  --nav-active-bg: #2e4256;
  --lang-on-bg: #9fb3c4;
  --lang-on-text: #131b23;
  --header-border: #4d6781;

  --btn-bg: #1b2631;
  --btn-text: #f1f3f5;
  --btn-border: #6f8aa3;
  --btn-hover: #243342;
  --primary-bg: #9fb3c4;
  --primary-text: #131b23;
  --primary-hover: #c3d1de;

  --danger: #ff9da3;
  --danger-bg: #3a1f23;
  --ok: #7fd6a4;
  --ok-bg: #16301f;

  --input-bg: #131b23;
  --input-border: #6f8aa3;
  --focus: #9fb3c4;
  --overlay: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

/* The same dark values when the system is dark and the admin did not choose. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131b23;
    --surface: #1b2631;
    --text: #f1f3f5;
    --heading: #dbe5ee;
    --muted: #9fb3c4;
    --line: #2f3f4f;
    --link: #b9cadb;

    --header-bg: #0d141a;
    --header-text: #f1f3f5;
    --header-muted: #9fb3c4;
    --nav-active-bg: #2e4256;
    --lang-on-bg: #9fb3c4;
    --lang-on-text: #131b23;
    --header-border: #4d6781;

    --btn-bg: #1b2631;
    --btn-text: #f1f3f5;
    --btn-border: #6f8aa3;
    --btn-hover: #243342;
    --primary-bg: #9fb3c4;
    --primary-text: #131b23;
    --primary-hover: #c3d1de;

    --danger: #ff9da3;
    --danger-bg: #3a1f23;
    --ok: #7fd6a4;
    --ok-bg: #16301f;

    --input-bg: #131b23;
    --input-border: #6f8aa3;
    --focus: #9fb3c4;
    --overlay: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}

/* Narrow screens: the larger styles take the next smaller step of the same scale. */
@media (max-width: 640px) {
  :root {
    --fs-display: 2.25rem;
    --lh-display: 2.75rem;
    --fs-h1: 2.25rem;
    --lh-h1: 2.75rem;
    --fs-h2: 1.5rem;
    --lh-h2: 2rem;
    --fs-h3: 1.25rem;
    --lh-h3: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-color: 0.01ms;
    --dur-move: 0.01ms;
  }
}
