/* =============================================
   IVYAMBITION — QUIZ STYLES
   ============================================= */

body.quiz-page {
  background: var(--cream);
  min-height: 100vh;
}

/* =============================================
   SCREENS
   ============================================= */

.quiz-main {
  padding-top: 68px;
  min-height: 100vh;
}

.quiz-screen {
  display: none;
  min-height: calc(100vh - 68px);
}

.quiz-screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.35s ease;
}

/* =============================================
   INTRO
   ============================================= */

#screen-intro {
  align-items: center;
  justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}

#screen-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(201, 168, 76, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.quiz-intro-wrap {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 620px;
  padding: 60px 24px;
}

.quiz-intro-wrap .section-label {
  color: var(--gold);
  margin-bottom: 20px;
}

.quiz-intro-wrap h1 {
  font-size: clamp(32px, 5vw, 54px);
  color: var(--white);
  margin-bottom: 20px;
  line-height: 1.15;
}

.quiz-intro-wrap > p {
  font-size: 17px;
  color: rgba(255,255,255,0.72);
  line-height: 1.7;
  margin-bottom: 32px;
}

.quiz-intro-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.quiz-intro-badges span {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
}

.intro-note {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* =============================================
   QUESTION SCREEN
   ============================================= */

#screen-quiz {
  background: var(--cream);
  align-items: stretch;
}

/* Progress bar */
.quiz-progress-bar-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  flex-shrink: 0;
}

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

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

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Question Card */
.quiz-q-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.quiz-question-card {
  width: 100%;
  max-width: 700px;
  animation: slideUp 0.3s ease;
}

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

.quiz-q-number {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  color: rgba(13,27,42,0.08);
  line-height: 1;
  margin-bottom: 8px;
}

.quiz-q-text {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.5vw, 34px);
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.25;
}

.quiz-q-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Options */
.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-options.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.quiz-option {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-family: var(--font-sans);
}

.quiz-option:hover {
  border-color: var(--navy);
  background: #f0f4f9;
  transform: translateX(2px);
}

.quiz-option.selected {
  border-color: var(--gold);
  background: var(--gold-pale);
}

.quiz-option-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-option.selected .quiz-option-indicator {
  background: var(--gold);
  border-color: var(--gold);
}

.quiz-option.selected .quiz-option-indicator::after {
  content: '✓';
  font-size: 11px;
  color: var(--navy);
  font-weight: 700;
}

.quiz-option-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 2px;
}

.quiz-option-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Navigation row */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px 24px;
  flex-shrink: 0;
  background: var(--cream);
}

.quiz-back-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
}

.quiz-back-btn:hover { color: var(--navy); }
.quiz-back-btn:disabled { opacity: 0.3; cursor: default; }

.quiz-dots {
  display: flex;
  gap: 6px;
}

.quiz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.quiz-dot.done { background: var(--gold); }
.quiz-dot.current { background: var(--navy); }

/* =============================================
   RESULTS SCREEN
   ============================================= */

#screen-results {
  flex-direction: column;
  background: var(--white);
}

.results-header {
  background: var(--navy);
  padding: 72px 24px 64px;
  text-align: center;
}

.results-header .section-label { color: var(--gold-light); margin-bottom: 16px; }
.results-header h1 { font-size: clamp(28px, 4vw, 48px); color: var(--white); margin-bottom: 14px; }
.results-header p { font-size: 16px; color: rgba(255,255,255,0.65); max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* Tiers */
.results-tiers {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 24px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.results-tier {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tier-label-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tier-label-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.tier-label-badge.s-tier { background: linear-gradient(90deg, var(--gold), var(--gold-light)); color: var(--navy); }
.tier-label-badge.a-tier { background: var(--navy); color: var(--white); }
.tier-label-badge.b-tier { background: var(--cream); color: var(--navy); border: 1.5px solid var(--border); }

.tier-label-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.tier-schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* School Card */
.school-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.school-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.school-card.s-tier { border-top: 3px solid var(--gold); }
.school-card.a-tier { border-top: 3px solid var(--navy); }
.school-card.b-tier { border-top: 3px solid #a0b0c0; }

.school-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.school-name {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--navy);
  line-height: 1.25;
}

.admit-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.admit-label.reach   { background: #fff0f0; color: #c0392b; }
.admit-label.target  { background: #fff8e6; color: #b7830a; }
.admit-label.likely  { background: #eaf7f0; color: #1e8449; }
.admit-label.safety  { background: #eef5ff; color: #1a5cb8; }

.school-location {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.school-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.school-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--cream);
  color: var(--text-muted);
  font-weight: 500;
}

.school-strengths {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.school-strengths strong {
  color: var(--navy);
  font-weight: 600;
}

.school-why {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  line-height: 1.5;
}

/* CTA Strip */
.results-cta {
  background: var(--navy);
  padding: 72px 24px;
}

.results-cta-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.results-cta-inner h3 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 36px);
  color: var(--white);
  margin-bottom: 14px;
}

.results-cta-inner p {
  font-size: 16px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  margin-bottom: 32px;
}

.results-cta-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.quiz-retake-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: underline;
}

.quiz-retake-btn:hover { color: rgba(255,255,255,0.7); }

/* =============================================
   EMBEDDED MODE (inside undergraduate.html)
   ============================================= */

/* When the quiz runs inside .quiz-embed, override full-page styles */
.quiz-embed .quiz-screen {
  min-height: 600px;
}

/* Intro screen: keep navy but not full viewport height */
.quiz-embed #screen-intro {
  background: transparent;
  min-height: 560px;
  justify-content: center;
}

/* Question screen: cream background as a section */
.quiz-embed #screen-quiz {
  background: var(--cream);
}

/* Results screen: white as a section */
.quiz-embed #screen-results {
  background: var(--white);
}

/* Results header inside embed */
.quiz-embed .results-header {
  padding: 56px 24px 48px;
}

/* Results CTA inside embed */
.quiz-embed .results-cta {
  padding: 56px 24px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 600px) {
  .quiz-options.cols-2 { grid-template-columns: 1fr; }
  .quiz-q-wrap { padding: 28px 16px; }
  .quiz-nav { padding: 12px 16px 20px; }
  .quiz-progress-bar-wrap { padding: 12px 16px; }
  .quiz-dots { display: none; }
  .results-cta-btns { flex-direction: column; }
  .results-cta-btns .btn { width: 100%; text-align: center; }
  .tier-schools-grid { grid-template-columns: 1fr; }
}
