/*
 * ECEC design tokens — single source of truth for the theme.
 *
 * Components consume SEMANTIC roles only (e.g. var(--color-bg-default)),
 * never raw values. Light theme lives in :root; dark theme overrides in
 * [data-theme="dark"]. Set data-theme on <html> from the active preference.
 *
 * Light **product UI** uses the ECEC product surface (Recruit-validated): white
 * panels, sky-blue accent, soft blue borders. Esto mascot colours stay on
 * --mascot-* (unchanged in light/dark). HR assistant products may add mascot.css.
 */

:root {
  /* ---- Palette (from Esto: cream #EDE6D3, navy #1E2A5E, face #243B8F, glow #D8EEFF) ---- */
  --palette-neutral-0: #ffffff;
  --palette-neutral-50: #f7f5f0;   /* cream-tinted paper */
  --palette-neutral-100: #ede6d3;  /* Esto parka cream */
  --palette-neutral-200: #ddd3ba;
  --palette-neutral-300: #c4b89a;
  --palette-neutral-500: #6b6f7e;  /* navy-tinted muted text */
  --palette-neutral-700: #3a4060;
  --palette-neutral-900: #1e2a5e;  /* Esto navy — primary text in light */
  --palette-neutral-950: #121833;  /* deep navy for dark bg */

  --palette-accent-500: #0284c7;   /* product surface primary (sky) */
  --palette-accent-600: #0369a1;   /* hover */
  --palette-accent-700: #0b5a80;   /* strong headings / links */
  --palette-accent-050: #eff8fe;  /* subtle wash */
  --palette-accent-100: #c7e6f9;  /* borders */
  --palette-accent-200: #8ed2f4;  /* strong borders */

  --palette-surface-ink: #0f1b2a;
  --palette-surface-muted: #5a6b7b;
  --palette-surface-page: #f8fbfd;
  --palette-surface-hairline: #eef2f6;

  --palette-success-500: #1f7a4c;
  --palette-warning-500: #c47a12;
  --palette-danger-500: #c0392b;
  --palette-info-500: #243b8f;     /* face blue for info */

  /* ---- Semantic colour roles (what components actually use) ---- */
  --color-bg-default: var(--palette-neutral-0);
  --color-bg-subtle: var(--palette-surface-page);
  --color-bg-raised: var(--palette-neutral-0);
  --color-fg-default: var(--palette-surface-ink);
  --color-fg-muted: var(--palette-surface-muted);
  --color-fg-on-accent: var(--palette-neutral-0);
  --color-accent: var(--palette-accent-500);
  --color-accent-hover: var(--palette-accent-600);
  --color-accent-subtle: var(--palette-accent-050);
  --color-accent-strong: var(--palette-accent-700);
  --color-border: var(--palette-accent-100);
  --color-border-strong: var(--palette-accent-200);
  --surface-hairline: var(--palette-surface-hairline);
  --color-success: var(--palette-success-500);
  --color-warning: var(--palette-warning-500);
  --color-danger: var(--palette-danger-500);
  --color-info: var(--palette-info-500);

  /* ---- Brand mascot (Esto) — FIXED identity colours ----
   * Esto keeps the same colours in light and dark; he is not theme-accent
   * driven. Same hexes as the palette above, locked for the character.
   */
  --mascot-parka: #ede6d3;        /* warm ivory / cream */
  --mascot-parka-shade: #ddd3ba;  /* parka depth/seams */
  --mascot-face-screen: #243b8f;  /* deep glowing blue */
  --mascot-face-glow: #3352b8;    /* screen halo */
  --mascot-face-feature: #d8eeff; /* eyes + smile (cyan-white) */
  --mascot-navy: #1e2a5e;         /* hands, legs, logo */
  --mascot-sole: #ffffff;         /* sneaker soles */

  /* ---- Typography ---- */
  --font-family-latin: "IBM Plex Sans", system-ui, sans-serif;
  --font-family-arabic: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  /* Active family; layout flips this based on locale (see fonts.css). */
  --font-family-base: var(--font-family-latin);

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */
  --font-size-3xl: 2.5rem;   /* 40px */
  --font-size-4xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* ---- Spacing (base unit = 4px) ---- */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* ---- Radius ---- */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  /* ---- Elevation / shadow ---- */
  --shadow-1: 0 1px 2px rgba(15, 27, 42, 0.05);
  --shadow-2: 0 6px 16px rgba(15, 27, 42, 0.07);
  --shadow-3: 0 14px 34px rgba(15, 27, 42, 0.09);

  /* ---- Motion ---- */
  --motion-duration-fast: 150ms;
  --motion-duration-base: 220ms;
  --motion-duration-slow: 320ms;
  --motion-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --motion-ease-emphasized: cubic-bezier(0.3, 0, 0, 1);

  /* ---- Z-index layers ---- */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-overlay: 1200;
  --z-modal: 1300;
  --z-toast: 1400;
}

/* Dark theme — deep navy surfaces, cream text, brighter face-blue accent */
[data-theme="dark"] {
  --color-bg-default: var(--palette-neutral-950);
  --color-bg-subtle: #1a2140;
  --color-bg-raised: #1e2a5e;
  --color-fg-default: #f7f5f0;
  --color-fg-muted: #c4b89a;
  --color-fg-on-accent: var(--palette-neutral-0);
  --color-accent: #4a6fd4;           /* brighter face-blue for dark UI */
  --color-accent-hover: #6b8ef0;
  --color-accent-subtle: #1a2140;
  --color-accent-strong: #6b8ef0;
  --color-border: #3a4060;
  --color-border-strong: #6b6f7e;
  --surface-hairline: #2a3350;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* Arabic locale swaps the base family; use dir="rtl" on the same element. */
[lang="ar"],
[dir="rtl"] {
  --font-family-base: var(--font-family-arabic);
}

/* Respect reduced-motion: collapse durations so token-driven motion stops. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration-fast: 0ms;
    --motion-duration-base: 0ms;
    --motion-duration-slow: 0ms;
  }
}
