/* member.css — shared base for the member frontend (dashboard, auth, lab pages, pairing).
   One source of truth for the tokens + chrome that every member page was previously
   inlining verbatim: nav, backgrounds, terminal-window cards, lab grid, footer.
   Page-specific styles stay inline in each page's <style>. */

:root {
  --bg: #0A0C0D;
  --bg-panel: #14181A;
  --bg-terminal: #1A1E21;
  --bg-terminal-dark: #12151A;
  --bg-input: #0D0F12;
  --ink: #E6E1D8;
  --muted: #7E8794;            /* was #6B7280 — bumped for AA contrast on --bg */
  --primary: #8AE234;
  --primary-dim: rgba(138,226,52,0.15);
  --primary-glow: rgba(138,226,52,0.06);
  --amber: #E0C28A;
  --red: #E5484D;
  --blue: #5CC8FF;
  --blue-dim: rgba(92,200,255,0.14);
  --border: rgba(255,255,255,0.07);
  --border-focus: rgba(138,226,52,0.5);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--sans);
  background-color: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Dot-grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* ── CRT scanline overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px,
    rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  pointer-events: none;
  z-index: 9999;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background-color: rgba(20,24,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-wordmark {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: var(--mono);
  transition: color 200ms ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  transition: all 200ms ease;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  transition: all 200ms;
}
.nav-hamburger img { width: 24px; height: auto; pointer-events: none; }

/* ── Mobile nav ── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 53px;
  left: 0;
  right: 0;
  background-color: rgba(20,24,26,0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 14px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 6px 0;
}

/* ── Terminal-window chrome ── */
.terminal-card {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 200ms, box-shadow 200ms;
}
.terminal-card:hover {
  border-color: rgba(138,226,52,0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  background: var(--bg-terminal-dark);
  border-bottom: 1px solid var(--border);
}
.window-dot { width: 11px; height: 11px; border-radius: 50%; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.terminal-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}
.terminal-body { padding: 20px; }

/* ── Filter bar ── */
.filters { display: flex; gap: 8px; padding: 0 0 20px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.82rem;
  transition: all 200ms;
  border: 1px solid transparent;
}
.filter-btn.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  font-weight: 600;
}
.filter-btn:not(.active) {
  background: transparent;
  color: var(--muted);
  border-color: rgba(255,255,255,0.1);
}
.filter-btn:not(.active):hover { border-color: rgba(255,255,255,0.2); color: var(--ink); }

/* ── Lab grid + cards ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.lab-card {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 200ms, box-shadow 200ms;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.lab-card:hover {
  border-color: rgba(138,226,52,0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.lab-card.free { border-color: rgba(138,226,52,0.2); }
.lab-card.premium { border-color: rgba(255,255,255,0.08); }
.lab-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-terminal-dark);
  border-bottom: 1px solid var(--border);
}
.lab-meta { display: flex; align-items: center; gap: 10px; }
.lab-chapter { font-family: var(--mono); font-size: 0.85rem; color: var(--primary); }
.lab-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
}
.lab-badge.free { background: var(--primary); color: var(--bg); }
.lab-badge.premium {
  background: rgba(224,194,138,0.15);
  color: var(--amber);
  border: 1px solid rgba(224,194,138,0.25);
}
.lab-verified {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(138,226,52,0.12);
  border: 1px solid rgba(138,226,52,0.4);
}
.lab-card.verified { border-color: rgba(138,226,52,0.45); }
.lab-card.verified:hover { box-shadow: 0 4px 24px rgba(138,226,52,0.14); }
.lab-card.verified .lab-card-header { border-bottom-color: rgba(138,226,52,0.22); }
.lab-next-badge {
  font-family: var(--mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 3px; color: var(--bg); background: var(--primary);
}
.lab-card.next { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(138,226,52,0.25); }
.next-nudge { font-family: var(--mono); font-size: 0.9rem; color: var(--ink); }
.next-nudge > span { color: var(--muted); }
.next-nudge a { color: var(--primary); font-weight: 700; text-decoration: none; }
.next-nudge a:hover { text-decoration: underline; }
.next-nudge.done { color: var(--primary); }
.lab-time { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.lab-card-body { padding: 20px; flex: 1 1 auto; }
.lab-card-body h3 { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.lab-card-body .desc { font-size: 0.88rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.lab-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.lab-progress.complete { color: var(--primary); }
.lab-progress.verified { color: var(--primary); font-weight: 700; }
.lab-progress-bar {
  flex: 0 1 120px;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.lab-progress-bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.lab-card-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 18px;
}
.lab-card-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, color 160ms;
}
.lab-card-btn.start {
  background: var(--primary);
  color: var(--bg);
  border: 1px solid var(--primary);
}
.lab-card-btn.start:hover { filter: brightness(1.08); }
.lab-card-btn.doc {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.lab-card-btn.doc:hover { border-color: rgba(138,226,52,0.4); color: var(--primary); }
.lab-card-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Privacy badges ── */
.privacy-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.privacy-badge svg {
  width: 13px;
  height: 13px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  text-align: center;
}
.footer p { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin: 4px 0; }

/* ── Shared animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Keyboard focus ── */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: inline-flex; }
  .grid { grid-template-columns: 1fr; }
}

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