.quiz-container {
  min-height: 100vh;
  background: #0f1117;
  padding: 24px 40px;
  max-width: 900px;
  margin: 0 auto;
}

/* Loading / Error / Success States */
.loading-state, .error-state, .success-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 16px; text-align: center;
}
.loader { width: 48px; height: 48px; border: 3px solid rgba(255,255,255,0.1); border-top-color: #4facfe; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p, .error-state h2 { color: rgba(255,255,255,0.6); }
.error-icon { font-size: 48px; }
.back-btn { color: #4facfe; text-decoration: none; font-weight: 600; margin-top: 8px; }

.success-state h2 { color: #fff; font-size: 24px; margin: 0; }
.success-state p { color: rgba(255,255,255,0.5); }
.success-animation { animation: bounceIn 0.6s ease; }
.success-icon { font-size: 64px; }
@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Quiz Header */
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 16px;
}
.quiz-title h1 { color: #fff; font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.q-counter { color: rgba(255,255,255,0.4); font-size: 13px; }

.timer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  padding: 10px 20px; border-radius: 12px; transition: all 0.3s;
}
.timer.warning { border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.1); }
.timer.danger { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.timer-icon { font-size: 18px; }
.timer-value { color: #fff; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.warning .timer-value { color: #fbbf24; }
.timer.danger .timer-value { color: #f87171; }

/* Progress Bar */
.progress-bar-wrap {
  width: 100%; height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 2px; margin-bottom: 32px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, #4facfe, #00f2fe);
  border-radius: 2px; transition: width 0.3s ease;
}

/* Question Area */
.question-area {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 32px; margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.question-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.q-badge { background: rgba(79,172,254,0.15); color: #4facfe; padding: 6px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.q-type { color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.question-text { color: #fff; font-size: 18px; font-weight: 600; line-height: 1.6; margin: 0 0 24px; }

.options-list { display: flex; flex-direction: column; gap: 12px; }

.option-btn {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 16px 20px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
  color: rgba(255,255,255,0.8); font-size: 15px; cursor: pointer;
  transition: all 0.25s; text-align: left; font-family: inherit;
}
.option-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }

.option-btn.selected {
  background: rgba(79,172,254,0.12); border-color: rgba(79,172,254,0.4);
  color: #fff; box-shadow: 0 0 0 1px rgba(79,172,254,0.2);
}

.option-letter {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.08); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
  transition: all 0.25s;
}
.option-btn.selected .option-letter {
  background: linear-gradient(135deg, #4facfe, #00f2fe); color: #fff;
}

.option-text { flex: 1; }

.check-mark { color: #4facfe; font-size: 20px; font-weight: 700; }

/* Navigation */
.quiz-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}

.nav-btn {
  padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.3s; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7);
  font-family: inherit;
}
.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: #fff; }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.next-btn {
  background: linear-gradient(135deg, #4facfe, #00f2fe); color: #fff;
  border: none; box-shadow: 0 4px 15px rgba(79,172,254,0.25);
}
.next-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(79,172,254,0.35); }

.submit-btn {
  background: linear-gradient(135deg, #4ade80, #22c55e); color: #fff;
  border: none; box-shadow: 0 4px 15px rgba(74,222,128,0.25);
}
.submit-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(74,222,128,0.35); }

.question-dots {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.dot {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1);
  background: transparent; color: rgba(255,255,255,0.4); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.dot:hover { border-color: rgba(255,255,255,0.3); }
.dot.active { background: rgba(79,172,254,0.2); border-color: #4facfe; color: #4facfe; }
.dot.answered { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.3); color: #4ade80; }
.dot.active.answered { background: rgba(79,172,254,0.2); border-color: #4facfe; color: #4facfe; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }

@media (max-width: 640px) {
  .quiz-container { padding: 16px; }
  .question-area { padding: 20px; }
  .quiz-nav { flex-direction: column; }
  .question-dots { order: -1; }
}
