:root {
  --bg-gradient: radial-gradient(circle at 50% 10%, #1e1b4b 0%, #0d0a21 60%, #05030a 100%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-card: rgba(23, 15, 38, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(245, 158, 11, 0.4);
  --amber-accent: #f59e0b;
  --amber-glow: #d97706;
  --purple-accent: #8b5cf6;
  --gradient-btn: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  --gradient-btn-hover: linear-gradient(135deg, rgba(245, 158, 11, 0.45) 0%, rgba(139, 92, 246, 0.45) 100%);
  --text-main: #f8fafc;
  --text-muted: #a1a1aa;
  --success: #10b981;
  --success-glass: rgba(16, 185, 129, 0.12);
  --error: #f43f5e;
  --error-glass: rgba(244, 63, 94, 0.12);
  --radius-lg: 24px;
  --radius-md: 14px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: var(--amber-glow);
  filter: blur(160px);
  top: 15%;
  left: 20%;
  z-index: -1;
  opacity: 0.25;
}

body::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: var(--purple-accent);
  filter: blur(160px);
  bottom: 15%;
  right: 20%;
  z-index: -1;
  opacity: 0.25;
}

.app-card {
  background: var(--glass-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.header { text-align: center; margin-bottom: 32px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}

.header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--amber-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.header p { color: var(--text-muted); font-size: 0.95rem; margin-top: 6px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.full-width { grid-column: span 2; }
.input-group { display: flex; flex-direction: column; gap: 8px; }

label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

input, select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

input:focus, select:focus {
  border-color: var(--amber-accent);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
  background: rgba(0, 0, 0, 0.55);
}

select option { background: #0d0a21; color: var(--text-main); }

.btn-glass {
  width: 100%;
  padding: 16px;
  background: var(--gradient-btn);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  margin-top: 10px;
}

.btn-glass:hover {
  background: var(--gradient-btn-hover);
  border-color: var(--amber-accent);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
}

.btn-glass:active { transform: translateY(0); }
.hidden { display: none !important; }

.loader-container { text-align: center; padding: 50px 0; }
.loader-spinner {
  width: 56px; height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--amber-accent);
  border-right-color: var(--purple-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.progress-pill {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber-accent);
}

.question-title { font-size: 1.25rem; font-weight: 700; line-height: 1.5; margin-bottom: 24px; }
.options-grid { display: flex; flex-direction: column; gap: 14px; }

.option-card {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.option-card:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--glass-border-hover);
  transform: translateX(6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.score-banner {
  text-align: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.score-number {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, var(--amber-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 4px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 24px;
}

.review-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.review-card.correct { border-left: 4px solid var(--success); background: var(--success-glass); }
.review-card.incorrect { border-left: 4px solid var(--error); background: var(--error-glass); }

.review-q { font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; }
.ans-detail { font-size: 0.85rem; margin-top: 4px; }

.text-success { color: var(--success); font-weight: 600; }
.text-error { color: var(--error); font-weight: 600; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: span 1; }
  .app-card { padding: 20px; }
}