/* ============================================================
   Lytix Staff Audition Platform
   Theme: Pure Black + Mathematical Functions
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────── */
:root {
  --black:         #000000;
  --black-soft:    #0a0a0a;
  --card-bg:       #0d0d0d;
  --input-bg:      #111111;
  --line:          rgba(255,255,255,0.10);
  --line-strong:   rgba(255,255,255,0.18);
  --line-focus:    rgba(255,255,255,0.40);

  --text:          #f5f5f5;
  --text-sub:      #999;
  --text-muted:    #555;

  --accent:        #ffffff;
  --accent-dim:    rgba(255,255,255,0.50);

  --radius:        4px;

  --font-display:  'Times New Roman', 'Noto Serif SC', 'STSong', 'SimSun', serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-ui:       'Inter', 'HarmonyOS Sans SC', 'PingFang SC', system-ui, sans-serif;

  --t: 0.15s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-ui);
  background: var(--black);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═════════════════════════════════════════════════════
   BACKGROUND · Cartesian grid + function curves
   ═════════════════════════════════════════════════════ */
#math-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.075;
}

/* ── Layout ──────────────────────────────────────────── */
#app { position: relative; z-index: 1; }

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ═════════════════════════════════════════════════════
   HERO
   ═════════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 100px 24px 64px;
}

.hero-math {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 6rem;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--accent);
  user-select: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 40px;
}

.hero-rule {
  width: 1px;
  height: 48px;
  background: var(--line-strong);
  margin: 0 auto 24px;
}

.hero-desc {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-sub);
  max-width: 560px;
  margin: 0 auto 56px;
}

.hero-desc .fn {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-dim);
}


/* ═════════════════════════════════════════════════════
   POSITION GRID
   ═════════════════════════════════════════════════════ */
#position-select { padding-bottom: 80px; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.section-label::before { content: "// "; }
.section-label::after  { content: " //"; }

.position-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  margin-bottom: 48px;
  background: var(--line);
}

.pos-card {
  background: var(--black-soft);
  padding: 32px 12px 28px;
  text-align: center;
  cursor: pointer;
  transition: background var(--t);
  position: relative;
}

.pos-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--t);
}

.pos-card:hover           { background: #141414; }
.pos-card:hover::after,
.pos-card.active::after   { transform: scaleX(1); }

.pos-symbol {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.4rem;
  display: block;
  line-height: 1;
  margin-bottom: 14px;
  transition: color var(--t);
}

.pos-card:hover .pos-symbol,
.pos-card.active .pos-symbol { color: var(--accent); }

.pos-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  transition: color var(--t);
}

.pos-card:hover .pos-label,
.pos-card.active .pos-label { color: var(--accent); }

.start-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 14px 0;
  background: var(--accent);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background var(--t);
}

.start-btn:hover  { background: #ddd; }
.start-btn:disabled { background: #222; color: #555; cursor: not-allowed; }

@media (max-width: 700px) {
  .position-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .position-grid { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════
   QUIZ FORM
   ═════════════════════════════════════════════════════ */
#quiz-form { display: none; padding-bottom: 80px; }

/* ── Header ─── */
.form-header {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 48px 0 20px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.form-pos-badge {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1;
}

.form-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Intro ─── */
.form-intro {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.9;
  color: var(--text-sub);
  padding: 24px 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

/* ── Sections ─── */
.q-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.q-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 36px;
}

.question-item {
  margin-bottom: 40px;
  padding-left: 0;
}

.question-item:last-child { margin-bottom: 0; }

.q-label {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.q-required {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #ff4444;
  margin-left: 4px;
  vertical-align: super;
}

.q-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.03em;
}

/* ── Inputs ─── */
.form-input,
.form-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 8px 0;
  outline: none;
  border-radius: 0;
  transition: border-color var(--t);
}

.form-input:focus,
.form-textarea:focus {
  border-bottom-color: var(--accent);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Applicant Info ─── */
.info-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.info-section .q-section-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 36px;
  text-transform: uppercase;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
}

@media (max-width: 600px) { .info-grid { grid-template-columns: 1fr; } }

/* ── Radio / Checkbox ─── */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-sub);
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t), border-color var(--t);
}

.radio-item:hover,
.checkbox-item:hover {
  color: var(--text);
}

.radio-item.selected,
.checkbox-item.selected {
  color: var(--accent);
  border-bottom-color: var(--line);
}

.radio-item input,
.checkbox-item input { display: none; }

.radio-dot {
  width: 12px; height: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  transition: border-color var(--t), background var(--t);
}

.radio-item.selected .radio-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.check-box {
  width: 12px; height: 12px;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  margin-top: 3px;
  transition: border-color var(--t), background var(--t);
}

.checkbox-item.selected .check-box {
  border-color: var(--accent);
  background: var(--accent);
}

.checkbox-item.selected .check-box::after {
  content: '';
  display: block;
  width: 4px; height: 7px;
  border: solid var(--black);
  border-width: 0 1px 1px 0;
  transform: rotate(45deg) translate(1px, -1px);
}

/* ── Upload ─── */
.upload-zone {
  border: 1px dashed var(--line);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--t), background var(--t);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent-dim);
  background: rgba(255,255,255,0.02);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.upload-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-sub);
}

.upload-hint {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-sub);
  border-bottom: 1px solid var(--line);
}

.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--text-muted); flex-shrink: 0; }

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0 2px;
  transition: color var(--t);
}

.file-remove:hover { color: #ff4444; }

/* ═════════════════════════════════════════════════════
   SUBMIT SECTION
   ═════════════════════════════════════════════════════ */
.submit-section {
  padding: 48px 0;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.submit-section p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 2;
}

.submit-btn {
  display: inline-block;
  padding: 14px 56px;
  background: var(--accent);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background var(--t);
}

.submit-btn:hover  { background: #ddd; }
.submit-btn:disabled { background: #222; color: #555; cursor: not-allowed; }

.submit-btn .spinner {
  display: none;
  width: 10px; height: 10px;
  border: 1px solid var(--black);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.submit-btn.loading .spinner { display: inline-block; }

/* ═════════════════════════════════════════════════════
   PROGRESS BAR
   ═════════════════════════════════════════════════════ */
.progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(6px);
  padding: 10px 28px;
  display: none;
  border-bottom: 1px solid var(--line);
}

.progress-bar-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.progress-track {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ═════════════════════════════════════════════════════
   TOAST
   ═════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #111;
  border: 1px solid var(--line);
  padding: 12px 16px;
  min-width: 260px;
  max-width: 360px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  pointer-events: auto;
  animation: slideIn 0.25s ease forwards;
}

.toast-success { border-left: 2px solid #0f0; }
.toast-error   { border-left: 2px solid #f44; }
.toast-warning { border-left: 2px solid #fa0; }

.toast-icon { font-size: 0.9rem; flex-shrink: 0; margin-top: 1px; }
.toast-msg  { color: var(--text-sub); }

/* ═════════════════════════════════════════════════════
   SUCCESS PAGE
   ═════════════════════════════════════════════════════ */
#success-page {
  display: none;
  text-align: center;
  padding: 120px 24px;
}

.success-icon {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 6rem;
  color: var(--accent);
  margin-bottom: 32px;
  user-select: none;
}

.success-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.success-sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 2;
  color: var(--text-sub);
  max-width: 480px;
  margin: 0 auto 48px;
}

.success-sub strong {
  font-weight: 600;
  color: var(--accent);
}

.success-back {
  display: inline-block;
  padding: 12px 36px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-sub);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
  text-decoration: none;
}

.success-back:hover { border-color: var(--accent); color: var(--accent); }

/* ═════════════════════════════════════════════════════
   FOOTER
   ═════════════════════════════════════════════════════ */
.site-footer {
  padding: 40px 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
}

/* ═════════════════════════════════════════════════════
   ANIMATIONS
   ═════════════════════════════════════════════════════ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.35s ease forwards; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-math { font-size: 3.5rem; }
  .hero-title { font-size: 2rem; }
  .q-section { padding: 28px 0; }
  .submit-section { padding: 32px 0; }
  .submit-btn { padding: 12px 36px; }
}
