/* =========================================================
   EXAM PAGE STYLES
   ========================================================= */
.exam-body {
  background:
    linear-gradient(135deg, #FAF8F3 0%, #f1ede4 100%),
    radial-gradient(ellipse at 75% 0%, rgba(30,79,163,0.08) 0%, transparent 55%);
  min-height: 100vh;
}

.exam-main {
  position: relative;
  min-height: 100vh;
  padding: 120px 1.5rem 80px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.exam-bg-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.orb-exam-1 {
  position: absolute; width: 600px; height: 600px;
  top: -250px; right: -150px;
  background: radial-gradient(circle, rgba(30,79,163,0.15) 0%, transparent 70%);
  border-radius: 50%; filter: blur(60px);
  animation: orbPulse 10s ease-in-out infinite;
}
.orb-exam-2 {
  position: absolute; width: 450px; height: 450px;
  bottom: -200px; left: -120px;
  background: radial-gradient(circle, rgba(201,168,76,0.1) 0%, transparent 70%);
  border-radius: 50%; filter: blur(55px);
  animation: orbPulse 13s ease-in-out infinite 3s;
}

.exam-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
}

/* ── Card base ── */
.exam-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(250,248,243,0.95) 100%);
  border: 1px solid rgba(232,230,225,0.8);
  border-radius: 12px;
  padding: 3rem 2.75rem;
  box-shadow: 0 12px 48px rgba(31,41,55,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
  animation: examFadeIn 0.5s ease-out;
}
@keyframes examFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.exam-label {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 1rem;
}
.exam-h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  color: var(--slate); line-height: 1.2;
  margin-bottom: 1rem; font-weight: 700;
}
.exam-text {
  font-size: 1rem; color: #5b6470;
  line-height: 1.75; margin-bottom: 1.5rem;
}

/* ── Intro points ── */
.exam-points {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.exam-points li {
  position: relative; padding-left: 1.8rem;
  font-size: 0.92rem; color: var(--slate); font-weight: 500;
}
.exam-points li::before {
  content: '';
  position: absolute; left: 0; top: 2px;
  width: 18px; height: 18px;
  background: var(--teal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Form ── */
.exam-form { display: flex; flex-direction: column; gap: 1.25rem; }
.exam-field { display: flex; flex-direction: column; gap: 0.5rem; }
.exam-field label {
  font-size: 0.82rem; font-weight: 600;
  color: var(--slate); letter-spacing: 0.02em;
}
.exam-field input {
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--gray-light);
  border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.95rem;
  color: var(--charcoal); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.exam-field input:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(30,79,163,0.15);
}
.exam-select {
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--gray-light);
  border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.95rem;
  color: var(--charcoal); background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  cursor: pointer;
}
.exam-select:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(30,79,163,0.15);
}
.exam-error {
  color: #c0392b; font-size: 0.85rem; min-height: 1rem; margin: 0;
}
.exam-start {
  width: 100%; justify-content: center;
  padding: 1rem; font-size: 0.95rem; margin-top: 0.5rem;
}
.exam-note {
  font-size: 0.78rem; color: var(--gray-mid);
  text-align: center; line-height: 1.5; margin: 0.5rem 0 0;
}

/* ── Locked ── */
.exam-locked { text-align: center; }
.exam-lock-icon {
  width: 80px; height: 80px; margin: 0 auto 1.5rem;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(201,168,76,0.12); color: var(--gold);
}
.exam-back {
  display: inline-block; margin-top: 1.25rem;
  font-size: 0.85rem; color: var(--gray-mid);
  text-decoration: none; transition: color var(--transition);
}
.exam-back:hover { color: var(--teal); }

/* ── Runner topbar ── */
.exam-runner { display: flex; flex-direction: column; gap: 1.25rem; }
.exam-topbar { display: flex; flex-direction: column; gap: 0.6rem; }
.exam-progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.82rem; font-weight: 600; color: var(--slate);
}
.exam-timer-wrap { color: var(--gray-mid); font-weight: 500; }
#examTimer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--teal); }
#examTimer.urgent { color: #c0392b; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.exam-progress-track {
  height: 6px; background: var(--gray-light);
  border-radius: 10px; overflow: hidden;
}
.exam-progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.4s ease;
}

/* ── Question card ── */
.exam-question-card { padding: 2.25rem 2rem; }
.exam-passage {
  background: rgba(30,79,163,0.06);
  border-left: 3px solid var(--teal);
  border-radius: 0 6px 6px 0;
  padding: 1.25rem 1.5rem; margin-bottom: 1.75rem;
}
.exam-passage-note {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--teal); margin-bottom: 0.6rem;
}
.exam-passage h4 {
  font-family: var(--font-serif); font-size: 1rem;
  color: var(--slate); margin-bottom: 0.6rem;
}
.exam-passage p { font-size: 0.9rem; line-height: 1.7; color: #5b6470; }
.exam-qtype {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gold); margin-bottom: 0.75rem;
}
.exam-prompt {
  font-family: var(--font-serif); font-size: 1.3rem;
  color: var(--slate); line-height: 1.4; margin-bottom: 1.5rem; font-weight: 600;
}
.exam-options { display: flex; flex-direction: column; gap: 0.75rem; }
.exam-option {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; text-align: left;
  padding: 1rem 1.1rem;
  background: var(--white);
  border: 1.5px solid var(--gray-light);
  border-radius: 8px; cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.exam-option:hover {
  border-color: var(--teal);
  background: rgba(30,79,163,0.04);
  transform: translateX(3px);
}
.exam-option-letter {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream); border: 1.5px solid var(--gray-light);
  font-size: 0.8rem; font-weight: 700; color: var(--slate);
  transition: all var(--transition);
}
.exam-option-text { font-size: 0.95rem; color: var(--charcoal); }
.exam-option.selected {
  border-color: var(--teal);
  background: rgba(30,79,163,0.1);
  box-shadow: 0 4px 14px rgba(30,79,163,0.18);
}
.exam-option.selected .exam-option-letter {
  background: var(--teal); border-color: var(--teal); color: var(--white);
}

/* ── Nav buttons ── */
.exam-nav { display: flex; justify-content: space-between; gap: 1rem; }
.exam-nav .btn-primary { min-width: 140px; justify-content: center; }
.exam-btn-ghost {
  padding: 0.9rem 1.6rem;
  background: transparent;
  border: 1.5px solid var(--gray-light);
  border-radius: 4px; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500;
  color: var(--slate); transition: all var(--transition);
}
.exam-btn-ghost:hover:not(:disabled) { border-color: var(--slate); background: var(--white); }
.exam-btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Loading ── */
.exam-loading { text-align: center; }
.exam-spinner {
  width: 48px; height: 48px; margin: 0 auto 1.25rem;
  border: 4px solid var(--gray-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ── */
.exam-result { text-align: center; }
.exam-score-ring {
  width: 160px; height: 160px; margin: 1rem auto 1.75rem;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--teal) 0%, var(--gold) 100%);
  position: relative;
}
.exam-score-ring::before {
  content: ''; position: absolute; inset: 8px;
  background: var(--white); border-radius: 50%;
}
.exam-score-pct {
  position: relative; z-index: 1;
  font-family: var(--font-serif); font-size: 2.6rem; font-weight: 700;
  color: var(--slate); line-height: 1;
}
.exam-score-sub {
  position: relative; z-index: 1;
  font-size: 0.72rem; color: var(--gray-mid);
  margin-top: 0.4rem; max-width: 110px; line-height: 1.3;
}
.exam-level-name {
  font-family: var(--font-serif); font-size: 1.8rem;
  color: var(--slate); margin-bottom: 0.75rem; font-weight: 700;
}
.exam-recommend {
  display: flex; flex-direction: column; gap: 0.3rem;
  background: rgba(30,79,163,0.08);
  border: 1px solid rgba(30,79,163,0.2);
  border-radius: 8px; padding: 1.1rem; margin: 1.5rem 0;
}
.exam-recommend-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--teal);
}
.exam-recommend-program {
  font-family: var(--font-serif); font-size: 1.2rem;
  font-weight: 600; color: var(--slate);
}
.exam-result--advanced .exam-score-ring { background: conic-gradient(var(--gold) 0%, var(--teal) 100%); }

/* ── Post-result followup (secondary CTA) ── */
.exam-followup {
  margin-top: 1.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--cream);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  text-align: left;
}
.exam-followup-title {
  font-size: 0.85rem; font-weight: 600; color: var(--slate);
  margin: 0 0 0.3rem;
}
.exam-followup-text {
  font-size: 0.82rem; color: var(--gray-mid); line-height: 1.55;
  margin: 0 0 0.9rem;
}
.exam-followup-form {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
}
.exam-followup-input {
  flex: 1; min-width: 160px;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-light);
  border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.88rem;
  color: var(--charcoal); background: var(--white);
}
.exam-followup-input:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(30,79,163,0.12);
}
.exam-followup-btn {
  padding: 0.65rem 1.1rem;
  background: var(--slate); color: var(--white);
  border: none; border-radius: 6px;
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition);
}
.exam-followup-btn:hover:not(:disabled) { background: var(--charcoal); }
.exam-followup-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.exam-followup-status {
  font-size: 0.8rem; margin: 0.6rem 0 0; min-height: 1rem;
}
.exam-followup-status--success { color: #1a7a4a; font-weight: 600; }
.exam-followup-status--error { color: #c0392b; }

/* ── XXI Skills breakdown ── */
.exam-skills {
  text-align: left;
  margin: 1.75rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-light);
}
.exam-skills-title {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--gray-mid);
  margin-bottom: 1rem; text-align: center;
}
.skill-row { margin-bottom: 0.9rem; }
.skill-row:last-child { margin-bottom: 0; }
.skill-row-top {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.35rem;
}
.skill-name { font-size: 0.88rem; font-weight: 600; color: var(--slate); }
.skill-pct { font-size: 0.85rem; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.skill-track {
  height: 7px; background: var(--gray-light);
  border-radius: 10px; overflow: hidden;
}
.skill-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--teal), var(--azure));
  transition: width 0.6s ease;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .exam-card { padding: 2rem 1.5rem; }
  .exam-question-card { padding: 1.75rem 1.25rem; }
  .exam-main { padding: 100px 1rem 60px; }
  .exam-prompt { font-size: 1.15rem; }
  .exam-nav .btn-primary { min-width: 120px; }
}
