/* ============================================================
   CNC Quiz — Portal
   Aesthetic: Minimal gold-on-black. Restrained, no animated halos
   or glow blobs. Just clean dark cards with a single gold accent.
   ============================================================ */

:root {
  --bg:        #0a0907;
  --surface:   #14110c;
  --surface-2: #1c1810;

  --border:       rgba(201, 168, 76, 0.14);
  --border-hi:    rgba(201, 168, 76, 0.32);
  --border-soft:  rgba(255, 255, 255, 0.06);

  --text:      #f5efde;
  --text-2:    #cdc2a4;
  --text-mute: #8e836a;
  --text-faint:#5a5141;

  --gold-1: #f5d27a;
  --gold-2: #d4af3f;
  --gold-3: #8c6914;

  --bronze-1: #c69a4a;
  --bronze-2: #8e6630;

  --live:      #f0d273;

  --font: "Cabinet Grotesk", "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--gold-2); color: #14110c; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: #000;
  border: 1px solid var(--border-hi);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: -0.015em; }

.user-area { display: flex; align-items: center; gap: 0.6rem; }
.user-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
}
.user-chip .avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: #14110c; font-size: 9.5px; font-weight: 800;
}
.user-area form { display: inline; }
.user-area .signout {
  font-size: 12.5px; font-weight: 500; color: var(--text-mute);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.user-area .signout:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface-2); }

/* ============================================================
   STAGE
   ============================================================ */
.stage {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.25rem 1.75rem 1rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  margin-bottom: 2rem;
  max-width: 720px;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.75rem 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-mute);
  margin-bottom: 1rem;
}
.hero-tag .live-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
}
.hero h1 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.hero h1 .name { color: var(--gold-1); }
.hero p {
  font-size: 14px;
  color: var(--text-mute);
  max-width: 56ch;
}

/* ============================================================
   QUIZ SECTIONS
   ============================================================ */
.quiz-sections {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 1.75rem;
  align-items: stretch;
}
.quiz-section { display: flex; flex-direction: column; min-width: 0; }
.section-head {
  display: flex; align-items: center; gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.dot-warm, .dot-cool {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dot-warm { background: var(--gold-2); }
.dot-cool { background: var(--bronze-2); }
.section-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
}
.section-divider {
  background: var(--border);
  width: 1px;
  align-self: stretch;
  margin-top: 1.8rem;
}

/* ============================================================
   QUIZ CARDS
   ============================================================ */
.glow-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.glow-card:hover {
  border-color: var(--border-hi);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.card-status-row {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.22rem 0.65rem 0.22rem 0.42rem;
  border-radius: 999px;
  background: rgba(240, 210, 115, 0.08);
  border: 1px solid rgba(240, 210, 115, 0.25);
  color: var(--live);
  font-size: 11px;
  font-weight: 600;
}
.live-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live);
}
.live-pill.muted {
  color: var(--text-mute);
  background: var(--surface-2);
  border-color: var(--border);
}
.live-pill.muted .dot { background: var(--text-mute); }
.live-pill.done {
  color: var(--gold-1);
  background: rgba(245, 210, 122, 0.1);
  border-color: rgba(245, 210, 122, 0.28);
}

.card-title {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.card-tagline {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 0.35rem;
}
.card-cadence {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 0;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.card-cadence::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-2);
}

.card-foot {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.75rem; flex-wrap: wrap;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cta-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 1rem 0.5rem 0.95rem;
  background: var(--gold-2);
  color: #14110c;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  transition: background 0.18s;
}
.cta-pill .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.glow-card:hover .cta-pill { background: var(--gold-1); }
.glow-card:hover .cta-pill .arrow { transform: translateX(2px); }

/* Archive variant ------------------------------------- */
.glow-card.archive .card-cadence::before { background: var(--bronze-1); }
.glow-card.archive .cta-pill {
  background: transparent;
  color: var(--bronze-1);
  border: 1px solid var(--border-hi);
}
.glow-card.archive:hover .cta-pill {
  background: var(--bronze-1);
  color: #14110c;
  border-color: var(--bronze-1);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-card {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-mute);
  font-size: 13px;
}
.empty-card .icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--gold-2);
  font-size: 15px;
}
.empty-card strong { color: var(--text); font-weight: 600; }
.empty-card code { font-family: var(--mono); font-size: 12px; color: var(--gold-1); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  max-width: 1180px; margin: 0 auto;
  padding: 1.5rem 1.75rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .stage { padding: 1.5rem 1.1rem 1rem; }
  .topbar-inner { padding: 0.6rem 1.1rem; }
  .quiz-sections { grid-template-columns: 1fr; gap: 1.5rem; }
  .section-divider {
    width: 100%; height: 1px; align-self: auto;
    margin: 0.25rem 0;
  }
  .hero { margin-bottom: 1.5rem; }
  .hero h1 { font-size: clamp(24px, 6vw, 30px); }
  .hero p { font-size: 13px; }
  .glow-card { padding: 1rem 1.1rem 1rem; }
  .card-title { font-size: 18px; }
  .card-tagline { font-size: 12.5px; }
  .card-foot { margin-top: 0.85rem; padding-top: 0.85rem; }
  .foot { padding: 1rem 1.1rem 1.25rem; font-size: 10px; }
}

@media (max-width: 420px) {
  .stage { padding: 1.25rem 0.9rem 0.85rem; }
  .user-chip { padding: 0.25rem 0.6rem 0.25rem 0.3rem; font-size: 11.5px; }
  .user-area .signout { padding: 0.3rem 0.7rem; font-size: 11.5px; }
}

/* ============================================================
   AUTH PAGES (login/register)
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 2.25rem 2.25rem;
}
.auth-mark {
  width: 48px; height: 48px;
  background: #000;
  border: 1px solid var(--border-hi);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
  margin: 0 0 1.25rem;
}
.auth-mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 0.35rem;
  color: var(--text);
}
.auth-title em { font-style: normal; }
.auth-title .punct { display: none; }
.auth-subtitle {
  font-size: 14px;
  color: var(--text-mute);
  margin: 0 0 1.75rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.85rem; }
.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.field input[type="text"],
.field input[type="password"] {
  font: inherit;
  font-size: 14.5px;
  padding: 0.7rem 0.85rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  transition: border-color 0.18s, background 0.18s;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  outline: none;
  border-color: var(--gold-2);
  background: var(--surface-2);
}
.field-error { font-size: 12px; color: #e08070; }

.field-checkbox {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 13px;
  color: var(--text-2);
  margin: 0.35rem 0 1.25rem;
}
.field-checkbox input { accent-color: var(--gold-2); width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  background: var(--gold-2);
  color: #14110c;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  border: none;
  cursor: pointer;
  transition: background 0.18s;
}
.btn:hover { background: var(--gold-1); }
.btn.block { width: 100%; }

.alert {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 0.85rem;
}
.alert.error { background: rgba(224, 128, 112, 0.08); color: #e08070; border-color: rgba(224, 128, 112, 0.32); }
.alert.success { background: rgba(240, 210, 115, 0.08); color: var(--gold-1); border-color: rgba(240, 210, 115, 0.3); }
.alert.info { background: var(--surface-2); }

.auth-foot {
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
  margin-top: 1.25rem;
}
.auth-foot a { color: var(--gold-1); font-weight: 600; }
.auth-foot a:hover { color: var(--gold-2); }

.portal-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
}
