/* ═══════════════════════════════════════════════════════════
   Kensho Professional Development — Design System
   /css/site.css
   
   Shared foundation: every page loads this.
   Dark mode default. Light mode via body.light-mode.
   ═══════════════════════════════════════════════════════════ */

/* ─── TOKENS ──────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-base: #0f1117;
  --bg-surface: #1a1d27;
  --bg-hover: #1a1d27;
  --bg-inset: #0f1117;

  /* Borders */
  --border: #2a2d3a;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-tertiary: #aaaaaa;
  --text-muted: #888888;
  --text-faint: #666666;

  /* Accent */
  --accent: #00c896;
  --accent-hover: #00c896;
  --accent-text: #000000;

  /* Semantic */
  --error: #ff6b6b;
  --warning: #ffb300;
  --info: #7c8cf8;

  /* Transparent fills */
  --accent-bg-subtle: rgba(0, 200, 150, 0.05);
  --accent-bg: rgba(0, 200, 150, 0.08);
  --info-bg: rgba(124, 140, 248, 0.08);
  --warning-bg: rgba(255, 179, 0, 0.06);
  --error-bg: rgba(255, 107, 107, 0.1);
  --row-stripe: rgba(255, 255, 255, 0.02);

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

body.light-mode {
  --bg-base: #f5f5f0;
  --bg-surface: #ffffff;
  --bg-hover: #eeeeee;
  --bg-inset: #f0f0ec;

  --border: #dddddd;

  --text-primary: #0a1a14;
  --text-secondary: #333333;
  --text-tertiary: #555555;
  --text-muted: #666666;
  --text-faint: #999999;

  --accent: #006b4a;
  --accent-hover: #00553a;
  --accent-text: #ffffff;

  --accent-bg-subtle: rgba(0, 200, 150, 0.06);
  --accent-bg: rgba(0, 200, 150, 0.07);
  --info-bg: rgba(124, 140, 248, 0.07);
  --warning-bg: rgba(255, 179, 0, 0.08);
  --warning: #a36800;
  --row-stripe: rgba(0, 0, 0, 0.02);
}

/* ─── RESET ───────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── BASE ────────────────────────────────────────────────── */

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── FORM ELEMENTS ───────────────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s;
}

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

/* ─── BUTTONS ─────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }

.btn-primary:disabled {
  background: var(--border);
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 1;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── GATE (reused: course player, dashboard) ─────────────── */

.gate-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.gate-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.gate-box h1 { font-size: 22px; margin-bottom: 8px; }
.gate-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.gate-box input { margin-bottom: 12px; }

.gate-box .btn-primary { width: 100%; }

.gate-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}

/* ─── CARD ────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* ─── THEME TOGGLE ────────────────────────────────────────── */

.theme-toggle {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 13px;
  cursor: pointer;
}

.theme-toggle span {
  padding: 5px 12px;
  transition: background 0.15s, color 0.15s;
}

.theme-toggle span.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.theme-toggle span:not(.active) {
  color: var(--text-muted);
}

/* ─── UTILITY ─────────────────────────────────────────────── */

.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.mt-auto { margin-top: auto; }
