/* ===== CBT 공통 ===== */
.exam-body-bg { background: var(--bg); min-height: 100vh; }

/* ===== 인트로 ===== */
.exam-intro {
  min-height: 100vh;
  padding: 60px 20px;
  display: flex; align-items: flex-start; justify-content: center;
}
.intro-card {
  background: #fff;
  border-radius: 16px;
  width: 100%; max-width: 640px;
  padding: 50px 48px;
  box-shadow: 0 8px 40px rgba(11,74,158,0.1);
  position: relative;
}
.intro-home {
  position: absolute; top: 22px; left: 28px;
  font-size: 14px; color: var(--muted);
}
.intro-home:hover { color: var(--primary); }
.intro-eyebrow {
  font-size: 12px; letter-spacing: 3px; font-weight: 700;
  color: var(--primary); margin-bottom: 12px; margin-top: 10px;
}
.intro-card h1 {
  font-size: 32px; font-weight: 700; line-height: 1.3; margin-bottom: 14px;
}
.intro-desc { color: var(--muted); font-size: 15px; margin-bottom: 30px; line-height: 1.7; }

.intro-info {
  background: var(--bg); border-radius: 10px;
  padding: 18px 22px; margin-bottom: 34px;
}
.intro-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 14.5px;
  border-bottom: 1px dashed #d6dde8;
}
.intro-info-row:last-child { border-bottom: none; }
.intro-info-row span { color: var(--muted); }
.intro-info-row strong { color: var(--text); font-weight: 700; }

.intro-sub {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin-bottom: 14px; padding-left: 10px;
  border-left: 4px solid var(--primary);
}
.intro-form { display: grid; gap: 14px; margin-bottom: 30px; }
.intro-field { display: grid; gap: 6px; }
.intro-field label { font-size: 14px; font-weight: 600; }
.intro-field input {
  padding: 13px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 8px;
}
.intro-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,74,158,0.12);
}
.intro-hint {
  font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.6;
  padding: 10px 12px; background: #f0f5ff; border-radius: 6px;
  border-left: 3px solid var(--primary-light);
}
.intro-hint a { color: var(--primary); font-weight: 600; text-decoration: underline; }
.intro-hint strong { color: var(--primary); }

.intro-rules {
  background: #fff8f0; border: 1px solid #ffd8b5;
  border-radius: 10px; padding: 18px 22px 18px 38px;
  list-style: disc; margin-bottom: 24px;
  display: grid; gap: 8px;
}
.intro-rules li { font-size: 13.5px; color: #8a5b2c; line-height: 1.6; }
.intro-rules li strong { color: #d2691e; }

.intro-agree {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg); padding: 14px 18px; border-radius: 8px;
  cursor: pointer; margin-bottom: 22px;
  font-size: 14px; color: var(--text);
}
.intro-agree input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.intro-start { width: 100%; }

/* ===== 시험 화면 ===== */
.exam-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.exam-top {
  background: #0f1c33; color: #fff;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px; align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky; top: 0; z-index: 50;
}
.exam-title { font-size: 15px; font-weight: 700; }
.exam-user { font-size: 12px; color: #a9b5c8; margin-top: 2px; }
.exam-top-center { text-align: center; }
.timer-label { font-size: 11px; color: #a9b5c8; letter-spacing: 1px; margin-bottom: 2px; }
.timer {
  font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: #fff; font-family: 'Menlo', monospace;
}
.timer.warn { color: #ff7a45; animation: pulse 1s infinite; }
.timer.danger { color: #ff4545; animation: pulse 0.6s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.exam-top-right { display: flex; align-items: center; gap: 16px; justify-content: flex-end; }
.progress-label { font-size: 13px; color: #cfd6e2; }
.progress-label span { color: #fff; font-weight: 700; }
.btn-submit {
  background: var(--accent); color: #fff;
  padding: 10px 22px; border-radius: 6px;
  font-weight: 700; font-size: 14px; transition: all 0.2s;
}
.btn-submit:hover { background: #e8632f; transform: translateY(-1px); }

.exam-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  max-width: 1280px;
  width: 100%; margin: 0 auto;
  padding: 30px 24px;
}

.question-area {
  background: #fff;
  border-radius: 12px;
  padding: 40px 44px;
  box-shadow: 0 4px 20px rgba(11,74,158,0.06);
  display: flex; flex-direction: column;
}
.q-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 2px solid var(--bg);
}
.q-num {
  font-size: 14px; font-weight: 700; color: #fff;
  background: var(--primary); padding: 6px 14px; border-radius: 20px;
}
.q-mark {
  font-size: 13px; color: var(--muted); padding: 6px 14px;
  border: 1.5px solid var(--line); border-radius: 6px;
  transition: all 0.15s;
}
.q-mark:hover { border-color: var(--accent); color: var(--accent); }
.q-mark.active { background: #fff4ec; border-color: var(--accent); color: var(--accent); font-weight: 700; }

.q-text {
  font-size: 19px; line-height: 1.6; font-weight: 500;
  color: var(--text); margin-bottom: 28px;
  min-height: 80px;
}

.q-options { display: grid; gap: 10px; margin-bottom: auto; }
.opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer; transition: all 0.15s;
  font-size: 15.5px; line-height: 1.5;
}
.opt:hover { border-color: var(--primary-light); background: #f8faff; }
.opt input[type="radio"] { display: none; }
.opt.selected {
  border-color: var(--primary);
  background: #eaf1fb;
  box-shadow: 0 0 0 3px rgba(11,74,158,0.1);
}
.opt-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0;
  background: var(--bg); color: var(--muted);
  border-radius: 50%; font-weight: 700; font-size: 13px;
}
.opt.selected .opt-no { background: var(--primary); color: #fff; }

.q-actions {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 30px; padding-top: 24px;
  border-top: 2px solid var(--bg);
}
.q-actions .btn { min-width: 120px; }
.q-actions .btn-ghost { border-color: var(--line); color: var(--text); }
.q-actions .btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: #f0f5ff; }

/* 문제 내비게이션 */
.nav-area {
  background: #fff;
  border-radius: 12px;
  padding: 24px 22px;
  box-shadow: 0 4px 20px rgba(11,74,158,0.06);
  height: fit-content;
  position: sticky; top: 110px;
}
.nav-area h4 {
  font-size: 15px; font-weight: 700; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 2px solid var(--bg);
}
.nav-legend {
  display: grid; gap: 6px; margin-bottom: 16px;
  font-size: 12px; color: var(--muted);
}
.nav-legend span { display: flex; align-items: center; gap: 8px; }
.sw {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  background: var(--bg); border: 1.5px solid var(--line);
}
.sw-ans { background: #eaf1fb; border-color: var(--primary); }
.sw-mark { background: #fff4ec; border-color: var(--accent); }
.sw-cur { background: var(--primary); border-color: var(--primary); }

.nav-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.nav-btn {
  aspect-ratio: 1;
  border: 1.5px solid var(--line);
  background: #fff; color: var(--muted);
  border-radius: 6px;
  font-size: 13px; font-weight: 700;
  transition: all 0.15s;
}
.nav-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.nav-btn.answered { background: #eaf1fb; border-color: var(--primary); color: var(--primary); }
.nav-btn.marked { background: #fff4ec; border-color: var(--accent); color: var(--accent); }
.nav-btn.current {
  background: var(--primary); border-color: var(--primary); color: #fff;
  transform: scale(1.08);
}
.nav-btn.marked.answered { background: linear-gradient(135deg, #eaf1fb 50%, #fff4ec 50%); }

/* ===== 결과 화면 ===== */
.result-screen { min-height: 100vh; padding: 60px 20px; display: flex; justify-content: center; align-items: flex-start; }
.result-card {
  background: #fff; border-radius: 16px;
  max-width: 720px; width: 100%;
  padding: 50px 48px;
  box-shadow: 0 8px 40px rgba(11,74,158,0.1);
  text-align: center;
}
.result-badge {
  display: inline-block; padding: 8px 22px;
  border-radius: 30px; font-weight: 800; font-size: 13px;
  letter-spacing: 2px; margin-bottom: 20px;
}
.result-badge.pass { background: #e6f7ee; color: #1f9d55; }
.result-badge.fail { background: #fdecec; color: #d33030; }
.result-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.result-sub { color: var(--muted); margin-bottom: 40px; }

.result-score {
  display: flex; align-items: center; gap: 40px;
  background: var(--bg); border-radius: 14px;
  padding: 34px 36px; margin-bottom: 30px;
}
.score-circle {
  width: 160px; height: 160px; flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0deg, var(--primary) var(--deg, 0deg), #dfe4ed var(--deg, 0deg) 360deg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.score-circle::before {
  content: ''; position: absolute; inset: 12px;
  background: var(--bg); border-radius: 50%;
}
.score-num {
  position: relative; z-index: 1; text-align: center;
  font-size: 48px; font-weight: 900; color: var(--primary);
  line-height: 1;
}
.score-num small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 4px; }

.score-detail { flex: 1; text-align: left; }
.score-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: 14.5px;
  border-bottom: 1px dashed #d6dde8;
}
.score-row:last-child { border-bottom: none; }
.score-row span { color: var(--muted); }
.score-row strong { color: var(--text); font-weight: 700; }
.score-row #passFail.pass { color: #1f9d55; }
.score-row #passFail.fail { color: #d33030; }

.result-actions { display: flex; gap: 10px; justify-content: center; }
.result-actions .btn { min-width: 160px; }

.review-area {
  margin-top: 40px; padding-top: 30px;
  border-top: 2px solid var(--bg);
  text-align: left;
}
.review-area h3 { font-size: 18px; margin-bottom: 20px; }
.review-item {
  background: var(--bg); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 12px;
  border-left: 4px solid var(--line);
}
.review-item.correct { border-left-color: #1f9d55; }
.review-item.wrong { border-left-color: #d33030; }
.review-q {
  font-size: 14.5px; font-weight: 600; margin-bottom: 10px; line-height: 1.5;
}
.review-q-num { display: inline-block; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; margin-right: 8px; }
.review-opts { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 8px; }
.review-opts .your { color: #d33030; font-weight: 700; }
.review-opts .ans { color: #1f9d55; font-weight: 700; }
.review-explain {
  background: #fff; padding: 10px 14px; border-radius: 6px;
  font-size: 13px; color: var(--muted); line-height: 1.6;
}
.review-explain strong { color: var(--text); }

/* ===== 반응형 ===== */
@media (max-width: 1000px) {
  .exam-main { grid-template-columns: 1fr; }
  .nav-area { position: static; order: -1; }
  .nav-grid { grid-template-columns: repeat(10, 1fr); }
  .question-area { padding: 28px 24px; }
}
@media (max-width: 700px) {
  .exam-top {
    grid-template-columns: 1fr;
    gap: 12px; text-align: center; padding: 14px 16px;
  }
  .exam-top-right { justify-content: center; }
  .intro-card { padding: 34px 24px; }
  .intro-card h1 { font-size: 24px; }
  .result-score { flex-direction: column; padding: 24px; }
  .result-card { padding: 34px 24px; }
  .q-text { font-size: 17px; }
  .nav-grid { grid-template-columns: repeat(8, 1fr); }
}
