/* CodeTeach palette and shared bits.
 *
 * Dark only. The sign-in and download pages used to keep private copies of
 * these colours in a <style> block, which is how they drifted apart — three
 * different greys all called --muted, several of them unreadable against the
 * panel they sat on. One file now, everything reads from it.
 */

:root {
  color-scheme: dark;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, "Courier New", monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 26px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-full: 999px;

  --bg: #14152a;
  --surface: #1b1d38;
  --surface-2: #232545;
  --border: #2e3154;
  --border-strong: #3d4170;

  --text: #e4e5f1;
  /* Both of these clear 4.5:1 on --surface. The old #555 and #444 did not,
     which is why locked lessons and the footer were effectively invisible. */
  --text-muted: #9ea0bb;
  --text-faint: #7c7e9c;

  --accent: #e94560;
  --accent-hover: #f2586f;
  --accent-fg: #ffffff;
  --accent-soft: rgb(233 69 96 / 0.12);

  --success: #5bd67f;
  --error: #ff6b6b;
  --warning: #f2b880;
  --info: #7ec8e3;
  --info-soft: rgb(126 200 227 / 0.08);

  --code-bg: #0e0f20;
  --editor-bg: #0e0f20;
  --editor-text: #d6d6e7;
  --editor-caret: #ffffff;
  --editor-gutter-bg: rgb(0 0 0 / 0.25);
  --editor-gutter-text: #565a80;
  --editor-selection: rgb(233 69 96 / 0.35);

  --tok-comment: #7377a0;
  --tok-string: #a5d6a7;
  --tok-number: #f2b880;
  --tok-keyword: #e94560;
  --tok-builtin: #7ec8e3;
  --tok-atrule: #c792ea;

  --overlay: rgb(8 8 18 / 0.78);
}

/* --- base ---------------------------------------------------------------- */

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

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

/* The old sheet set `outline: none` on every input and gave nothing back, so
   the keyboard route through the forms was invisible. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a { color: var(--accent); }

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

/* --- shared components --------------------------------------------------- */

.ct-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ct-btn {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 10px var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.ct-btn:disabled { opacity: 0.5; cursor: default; }

.ct-btn--primary { background: var(--accent); color: var(--accent-fg); }
.ct-btn--primary:hover:not(:disabled) { background: var(--accent-hover); }

.ct-btn--secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.ct-btn--secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.ct-input {
  width: 100%;
  font: inherit;
  font-size: var(--text-base);
  padding: 10px var(--space-3);
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color 0.12s;
}
.ct-input:focus { outline: none; border-color: var(--accent); }
.ct-input::placeholder { color: var(--text-faint); }

.ct-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
