/* =============================================
   HEALTH DASHBOARD — DESIGN SYSTEM
   CRED-inspired Premium Minimalist
   Base unit: 4px grid
   ============================================= */

:root {
  /* --- Color Palette --- */
  --color-bg-dark: #0f0f0f;
  --color-bg-light: #faf8f5;
  --color-bg-card: #1c1c1e;
  --color-bg-elevated: #252527;

  --color-accent-gold: #c8a882;
  --color-accent-teal: #4ecca3;

  --color-text-primary: #f5f5f0;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #5a5a5a;
  --color-text-on-light: #1a1a1a;

  --color-success: #4ecca3;
  --color-warning: #ffc107;
  --color-danger: #ff6b6b;
  --color-info: #5dade2;
  --color-disabled: #5a5a5a;

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-light: rgba(200, 168, 130, 0.2);

  /* --- Typography --- */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;

  --font-size-h1: 32px;
  --font-size-h2: 24px;
  --font-size-h3: 18px;
  --font-size-body: 16px;
  --font-size-small: 14px;
  --font-size-label: 12px;

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

  --line-height-h1: 1.2;
  --line-height-h2: 1.3;
  --line-height-h3: 1.4;
  --line-height-body: 1.6;
  --line-height-small: 1.5;
  --line-height-label: 1.4;

  --letter-spacing-heading: 0.5px;
  --letter-spacing-label: 0.75px;

  /* --- Spacing (4px grid) --- */
  --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;

  /* --- Border Radius --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow-teal: 0 0 20px rgba(78, 204, 163, 0.2);
  --shadow-glow-gold: 0 0 20px rgba(200, 168, 130, 0.2);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Layout --- */
  --nav-height-mobile: 64px;
  --nav-width-sidebar: 240px;
  --content-max-width: 480px;
  --content-max-width-desktop: 1200px;

  /* --- Z-index layers --- */
  --z-base: 1;
  --z-nav: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* --- Desktop Scale --- */
@media (min-width: 1024px) {
  :root {
    --font-size-h1: 40px;
    --font-size-h2: 28px;
    --font-size-h3: 20px;
  }
}

/* --- Global Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg-dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography Utilities --- */
h1, .h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-h1);
  letter-spacing: var(--letter-spacing-heading);
}

h2, .h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h2);
  letter-spacing: var(--letter-spacing-heading);
}

h3, .h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-h3);
}

p, .body {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

.small {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
}

.label {
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-label);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--color-accent-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Screen layout container --- */
.screen {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height-mobile) + var(--space-4));
  background-color: var(--color-bg-dark);
}

@media (min-width: 768px) {
  .screen {
    padding-bottom: 0;
    padding-left: var(--nav-width-sidebar);
  }
}

.screen__content {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

@media (min-width: 1024px) {
  .screen__content {
    max-width: var(--content-max-width-desktop);
    padding: var(--space-8) var(--space-12);
  }
}
