/* ==========================================================================
   FitCoach — design tokens
   Single source of truth for colour, type, spacing, radius and elevation.
   Everything else in the stylesheet references these variables.
   ========================================================================== */

/* --- Typeface ------------------------------------------------------------ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- Colour: light theme (default) ------------------------------------ */
  --bg: #F6F7F9;
  --bg-subtle: #EFF0F4;
  --surface: #FFFFFF;
  --surface-2: #FAFAFC;
  --surface-hover: #F4F4F7;

  --primary: #6C5CE7;
  --primary-hover: #5B4BD6;
  --primary-soft: rgba(108, 92, 231, 0.09);
  --primary-border: rgba(108, 92, 231, 0.24);
  --accent: #8B7CF6;
  --accent-soft: rgba(139, 124, 246, 0.12);

  --text: #17171B;
  --text-2: #4A4A55;
  --muted: #777781;
  --muted-2: #9C9CA6;

  --success: #16A36A;
  --success-soft: rgba(22, 163, 106, 0.10);
  --warning: #D98212;
  --warning-soft: rgba(217, 130, 18, 0.11);
  --danger: #E34D59;
  --danger-soft: rgba(227, 77, 89, 0.10);
  --info: #2D80D2;
  --info-soft: rgba(45, 128, 210, 0.10);

  --border: #ECECF1;
  --border-strong: #DEDEE6;
  --ring: rgba(108, 92, 231, 0.18);

  /* Chart series — distinguishable in both themes and for common CVD types */
  --chart-1: #6C5CE7;
  --chart-2: #16A36A;
  --chart-3: #D98212;
  --chart-4: #2D80D2;
  --chart-5: #E34D59;
  --chart-6: #8B7CF6;

  /* --- Typography ------------------------------------------------------- */
  --font: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;

  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.8125rem;  /* 13 */
  --text-base: 0.875rem; /* 14 */
  --text-md: 0.9375rem;  /* 15 */
  --text-lg: 1.0625rem;  /* 17 */
  --text-xl: 1.25rem;    /* 20 */
  --text-2xl: 1.5rem;    /* 24 */
  --text-3xl: 1.875rem;  /* 30 */
  --text-4xl: 2.25rem;   /* 36 */

  --leading-tight: 1.45;
  --leading: 1.75;
  --leading-loose: 2;

  /* --- Spacing scale (4px base) ----------------------------------------- */
  --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;
  --space-16: 4rem;

  /* --- Radius ----------------------------------------------------------- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* --- Elevation -------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(23, 23, 27, 0.04);
  --shadow-sm: 0 2px 8px rgba(23, 23, 27, 0.05);
  --shadow: 0 6px 20px rgba(23, 23, 27, 0.06);
  --shadow-lg: 0 16px 40px rgba(23, 23, 27, 0.10);
  --shadow-primary: 0 8px 24px rgba(108, 92, 231, 0.22);

  /* --- Layout ----------------------------------------------------------- */
  --sidebar-width: 264px;
  --sidebar-collapsed: 76px;
  --topbar-height: 64px;
  --bottom-nav-height: 64px;
  --container: 1440px;

  /* --- Motion ----------------------------------------------------------- */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-fast: 120ms;
  --duration: 200ms;
  --duration-slow: 320ms;

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* --- Dark theme ---------------------------------------------------------
   Optional per the spec — light stays the default. Applied only when the
   user explicitly chooses it, so a dark OS setting does not override the
   coach's branding decision.
   ------------------------------------------------------------------------ */

[data-theme='dark'] {
  --bg: #0F0F14;
  --bg-subtle: #15151C;
  --surface: #1A1A22;
  --surface-2: #20202A;
  --surface-hover: #24242F;

  --primary: #8B7CF6;
  --primary-hover: #9D90F8;
  --primary-soft: rgba(139, 124, 246, 0.14);
  --primary-border: rgba(139, 124, 246, 0.32);
  --accent: #A99BFA;
  --accent-soft: rgba(169, 155, 250, 0.16);

  --text: #F2F2F5;
  --text-2: #C9C9D2;
  --muted: #90909C;
  --muted-2: #6E6E7A;

  --success: #35C48B;
  --success-soft: rgba(53, 196, 139, 0.14);
  --warning: #E9A13B;
  --warning-soft: rgba(233, 161, 59, 0.14);
  --danger: #F0707A;
  --danger-soft: rgba(240, 112, 122, 0.14);
  --info: #5AA2E8;
  --info-soft: rgba(90, 162, 232, 0.14);

  --border: #2A2A35;
  --border-strong: #363644;
  --ring: rgba(139, 124, 246, 0.26);

  --chart-1: #8B7CF6;
  --chart-2: #35C48B;
  --chart-3: #E9A13B;
  --chart-4: #5AA2E8;
  --chart-5: #F0707A;
  --chart-6: #C0B4FC;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.32);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.48);
  --shadow-primary: 0 8px 24px rgba(139, 124, 246, 0.24);
}
