/* Missouri Driver's License Practice Test - Styles */

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

:root {
  --blue:       #1d4ed8;
  --blue-light: #3b82f6;
  --blue-bg:    #eff6ff;
  --green:      #15803d;
  --green-light:#dcfce7;
  --green-border:#86efac;
  --red:        #b91c1c;
  --red-light:  #fee2e2;
  --red-border: #fca5a5;
  --yellow:     #b45309;
  --yellow-light:#fefce8;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-400:   #94a3b8;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-900:   #0f172a;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,0.08);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 48px;
  color: var(--gray-900);
}

.screen {
  width: 100%;
  max-width: 720px;
}

.hidden {
  display: none !important;
}

/* ─── Card ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
}

/* ─── Start Screen ──────────────────────────────────────── */
.start-card {
  text-align: center;
}

.start-card .logo {
  font-size: 52px;
  margin-bottom: 8px;
}

.start-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.start-card .subtitle {
  font-size: 1.1rem;
  color: var(--gray-600);
  margin-bottom: 24px;
}

.start-card p.description {
  color: var(--gray-600);
  font-size: 0.97rem;
  line-height: 1.6;
  margin-bottom: 28px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.info-item {
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-item .info-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-item h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 2px;
}

.info-item p {
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.test-options {
  display: flex;
  gap: 14px;
  flex-direction: column;
}

.test-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.test-option-btn.primary {
  background: var(--blue);
  color: #fff;
}

.test-option-btn.primary:hover {
  background: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29,78,216,0.35);
}

.test-option-btn.secondary {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-700);
}

.test-option-btn.secondary:hover {
  background: var(--gray-100);
  border-color: var(--blue-light);
  transform: translateY(-1px);
}

.btn-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-title {
  font-size: 1rem;
  font-weight: 700;
}

.btn-desc {
  font-size: 0.82rem;
  opacity: 0.8;
}

.btn-arrow {
  font-size: 1.4rem;
}

/* ─── Quiz Header ───────────────────────────────────────── */
.quiz-header {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px 20px 0;
  margin-bottom: 0;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}

.progress-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.25);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2px;
}

.progress-bar {
  height: 100%;
  background: #4ade80;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── Quiz Card ─────────────────────────────────────────── */
.quiz-card {
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 32px 36px;
}

.question-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 10px;
}

#question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ─── Answer Options ────────────────────────────────────── */
.answers-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
}

.answer-option:hover {
  border-color: var(--blue-light);
  background: var(--blue-bg);
}

.answer-option input[type="radio"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.answer-text {
  font-size: 0.97rem;
  color: var(--gray-700);
  line-height: 1.45;
}

.answer-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-bg);
}

/* Result states */
.answer-option.correct-answer {
  border-color: var(--green);
  background: var(--green-light);
}

.answer-option.correct-answer .answer-text {
  color: var(--green);
  font-weight: 600;
}

.answer-option.wrong-answer {
  border-color: var(--red);
  background: var(--red-light);
}

.answer-option.wrong-answer .answer-text {
  color: var(--red);
}

/* ─── Feedback ──────────────────────────────────────────── */
.feedback {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.93rem;
  line-height: 1.5;
}

.feedback.correct {
  background: var(--green-light);
  border: 1px solid var(--green-border);
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.feedback.incorrect {
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red);
}

.feedback-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 1rem;
}

.feedback-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

.feedback-detail {
  margin-bottom: 6px;
  color: var(--gray-700);
}

.feedback-page {
  font-size: 0.88rem;
  color: var(--gray-600);
  background: rgba(255,255,255,0.6);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 4px;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn-row {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 13px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  flex: 1;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #1e40af;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-next {
  background: #059669;
  color: #fff;
}

.btn-next:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* ─── Result Screen ─────────────────────────────────────── */
.result-card {
  text-align: center;
}

.result-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--gray-900);
}

.score-display {
  margin-bottom: 20px;
}

.score-numbers {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.score-pct {
  font-size: 1.4rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.grade-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 12px;
  margin-bottom: 16px;
}

.grade-badge.pass {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.grade-badge.fail {
  background: var(--yellow-light);
  color: var(--yellow);
  border: 1px solid #fde68a;
}

.result-message {
  font-size: 0.97rem;
  color: var(--gray-600);
  margin-bottom: 28px;
  line-height: 1.5;
}

.result-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 24px 0;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gray-200);
  color: var(--gray-600);
}

.btn-outline:hover {
  border-color: var(--blue-light);
  color: var(--blue);
  background: var(--blue-bg);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: 12px 10px 40px;
  }

  .card {
    padding: 24px 20px;
  }

  .quiz-card {
    padding: 24px 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  #question-text {
    font-size: 1.05rem;
  }

  .score-numbers {
    font-size: 2.8rem;
  }
}
