/* cmc_remake/css/design-system.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Modern Minimal Direction (Open Design System) */
  /* Colors - OKLCH for perceptual uniformity */
  --bg: oklch(99% 0.002 240);       /* Cold off-white */
  --surface: oklch(100% 0 0);       /* Pure white */
  --surface-hover: oklch(96% 0.005 240);

  /* Text & Ink */
  --fg: oklch(18% 0.012 250);       /* Main text (near black) */
  --muted: oklch(54% 0.012 250);    /* Secondary text */
  
  /* Structure */
  --border: oklch(92% 0.005 250);   /* Hairline dividers */
  
  /* Brand Accents (Derived from CMC Blue) */
  --accent: oklch(45% 0.14 250);    /* Primary CMC Blue optimized */
  --accent-muted: oklch(90% 0.04 250);
  
  /* Utility / Status Colors */
  --success: oklch(60% 0.15 145);
  --success-bg: oklch(95% 0.04 145);
  --success-border: oklch(85% 0.08 145);
  
  --error: oklch(60% 0.20 25);
  --error-bg: oklch(95% 0.04 25);
  --error-border: oklch(85% 0.08 25);
  
  --warning: oklch(60% 0.15 80);
  --warning-bg: oklch(95% 0.04 80);
  --warning-border: oklch(85% 0.08 80);
  
  /* Aliases (Legacy Compat) */
  --danger: var(--error);
  --primary: var(--accent);
  --bg-body: var(--bg);
  --text-main: var(--fg);
  --text-muted: var(--muted);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --text-h1: 2.5rem;
  --text-h2: 1.75rem;
  --text-h3: 1.25rem;
  --text-body: 1rem;
  --text-sm: 0.875rem;
  
  --line-height-tight: 1.1;
  --line-height-base: 1.6;

  /* Spacing (8pt Grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Borders - Sharp & Mature */
  --radius-sm: 4px; /* Inputs */
  --radius-md: 8px; /* Modals, Cards */
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--fg);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  font-weight: 600;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

p {
  color: var(--muted);
  max-width: 65ch; /* Optimal reading length */
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Forms & Inputs */
input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: var(--space-3);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  min-height: 44px; /* Touch target minimum */
  transition: border-color 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-1);
  color: var(--fg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  min-height: 44px; /* Touch target minimum */
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-outline:hover {
  background-color: var(--surface-hover);
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--fg);
  background-color: var(--surface-hover);
  text-decoration: none;
}

/* Structural Components */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  /* NO SHADOWS - Open Design Anti-Slop */
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Utility Classes */
.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-muted { color: var(--muted); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.grid { display: grid; }

/* Status Colors */
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.bg-success-light { background-color: oklch(95% 0.05 145); }
.bg-error-light { background-color: oklch(95% 0.05 25); }
