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

:root {
  --bg: #0D0D0D;
  --surface: #141414;
  --surface2: #1C1C1C;
  --border: #2A2A2A;
  --border-bright: #3A3A3A;
  --text: #F0EDE8;
  --text-muted: #888;
  --text-dim: #555;
  --accent: #CCFF00;
  --accent-dim: rgba(204,255,0,0.12);
  --accent-glow: rgba(204,255,0,0.25);
  --pink: #FF3CAC;
  --pink-dim: rgba(255,60,172,0.12);
  --blue: #3CAAFF;
  --blue-dim: rgba(60,170,255,0.12);
  --green: #00E676;
  --green-dim: rgba(0,230,118,0.12);
  --red: #FF4D4D;
  --red-dim: rgba(255,77,77,0.12);
  --orange: #FF9500;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Clash Display', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Header ── */
.site-header {
  position: relative;
  overflow: hidden;
  padding: 64px 24px 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.header-bg-blob {
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse at center, rgba(204,255,0,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.header-inner { position: relative; z-index: 1; }

.header-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(204,255,0,0.3);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.header-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}

.header-title .accent { color: var(--accent); }

.header-sub {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 28px;
}

.score-pill {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(204,255,0,0.3);
  padding: 10px 28px;
  border-radius: 100px;
  transition: var(--transition);
}

/* ── Container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

/* ── Progress ── */
.progress-wrap {
  margin-bottom: 48px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ── Section ── */
.ws-section {
  margin-bottom: 56px;
  animation: fadeUp 0.5s ease both;
}

.ws-section:nth-child(2) { animation-delay: 0.05s; }
.ws-section:nth-child(3) { animation-delay: 0.1s; }
.ws-section:nth-child(4) { animation-delay: 0.15s; }
.ws-section:nth-child(5) { animation-delay: 0.2s; }
.ws-section:nth-child(6) { animation-delay: 0.25s; }

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

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-badge {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  border-radius: 12px;
  flex-shrink: 0;
}

.bonus-badge {
  background: var(--pink);
  font-size: 22px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Questions Grid ── */
.questions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.questions-grid.single-col {
  grid-template-columns: 1fr;
}

/* ── Question Card ── */
.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.q-card:hover {
  border-color: var(--border-bright);
}

.q-card.correct {
  border-color: var(--green);
  background: linear-gradient(135deg, var(--surface), rgba(0,230,118,0.04));
  box-shadow: 0 0 0 1px rgba(0,230,118,0.2);
}

.q-card.wrong {
  border-color: var(--red);
  background: linear-gradient(135deg, var(--surface), rgba(255,77,77,0.04));
  box-shadow: 0 0 0 1px rgba(255,77,77,0.2);
}

.q-card.partial {
  border-color: var(--orange);
  background: linear-gradient(135deg, var(--surface), rgba(255,149,0,0.04));
  box-shadow: 0 0 0 1px rgba(255,149,0,0.2);
}

.q-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.marks-badge {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: none;
}

.q-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 12px;
}

/* ── Inline Input ── */
.inline-input {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 4px 10px;
  width: 120px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  vertical-align: middle;
}

.inline-input.wide { width: 160px; }
.inline-input.small { width: 70px; }

.inline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── True/False Buttons ── */
.tf-buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.tf-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.tf-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-dim);
}

.tf-btn.selected-true {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

.tf-btn.selected-false {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

/* ── Match Layout ── */
.match-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.match-col-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.match-item {
  font-size: 14px;
  color: var(--text);
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  line-height: 1.4;
}

.match-item.option {
  color: var(--text-muted);
  font-size: 13px;
}

.answers-col { display: flex; flex-direction: column; }
.answers-col .match-col-label { text-align: center; }

.match-answer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  height: 42px;
}

.match-input {
  width: 52px;
  height: 42px;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.match-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.inline-fb {
  font-size: 18px;
  min-width: 24px;
}

/* ── Textarea ── */
.answer-box {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.answer-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.answer-box.tall { min-height: 140px; }

/* ── Feedback ── */
.feedback {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: all var(--transition);
}

.feedback.show {
  padding: 10px 14px;
}

.feedback.correct-fb {
  background: var(--green-dim);
  border: 1px solid rgba(0,230,118,0.3);
  color: var(--green);
}

.feedback.wrong-fb {
  background: var(--red-dim);
  border: 1px solid rgba(255,77,77,0.3);
  color: #FF8080;
}

.feedback.partial-fb {
  background: rgba(255,149,0,0.1);
  border: 1px solid rgba(255,149,0,0.3);
  color: var(--orange);
}

/* ── Bonus Section ── */
.bonus-section .section-title { color: var(--pink); }
.bonus-card {
  border-color: rgba(255,60,172,0.3);
  background: linear-gradient(135deg, var(--surface), rgba(255,60,172,0.04));
}

/* ── Submit / Reset ── */
.submit-wrap {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}

.submit-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  padding: 16px 40px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.submit-btn:active { transform: translateY(0); }

.btn-icon { font-size: 20px; }

.reset-btn {
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 16px 28px;
  border: 1px solid var(--border-bright);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.reset-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Results Panel ── */
.results-panel {
  margin-top: 56px;
  animation: fadeUp 0.5s ease both;
}

.results-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
}

.results-score-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.results-score {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.results-outof {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  color: var(--text-muted);
}

.results-grade {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.results-msg {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.improve-section, .strong-section {
  text-align: left;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.improve-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 14px;
}

.strong-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 14px;
}

.improve-list, .strong-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.improve-list li {
  font-size: 14px;
  color: var(--text);
  padding: 10px 14px;
  background: rgba(255,149,0,0.06);
  border: 1px solid rgba(255,149,0,0.2);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.strong-list li {
  font-size: 14px;
  color: var(--text);
  padding: 10px 14px;
  background: var(--green-dim);
  border: 1px solid rgba(0,230,118,0.2);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.retry-btn {
  margin-top: 32px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 36px;
  border: 1px solid rgba(204,255,0,0.4);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.retry-btn:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .questions-grid {
    grid-template-columns: 1fr;
  }

  .match-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .answers-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .match-answer-row {
    flex-direction: column;
    height: auto;
    align-items: flex-start;
  }

  .results-score { font-size: 72px; }
  .results-inner { padding: 32px 20px; }
  .header-title { font-size: 36px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }