/* ==========================================================
   assets/css/pages/test.css
   독해력 테스트 페이지 전용 스타일
   공통(common.css) 이후에 로드 → 오버라이드 안전
========================================================== */

/* --------------------------------------------------------
   래퍼 & 레이아웃
-------------------------------------------------------- */
.test-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 60px;
  gap: 24px;
  background: var(--bg);
}

/* --------------------------------------------------------
   상단 바 (← 메인으로 | 브랜드명)
-------------------------------------------------------- */
.test-top {
  width: min(100%, 680px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.test-back {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-3);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31,26,20,.14);
  background: var(--sheet);
  transition: background .15s ease;
}

.test-back:hover {
  background: #fff7e6;
}

/* --------------------------------------------------------
   카드 (인트로 / 질문 / 결과 공통)
-------------------------------------------------------- */
.test-card {
  width: min(100%, 680px);
  background: var(--sheet);
  border: 1px solid rgba(31,26,20,.14);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-2);
}

@media (max-width: 560px) {
  .test-card {
    padding: 24px 18px;
  }
}

/* --------------------------------------------------------
   타이포 헬퍼
-------------------------------------------------------- */
.test-h1 {
  font-family: var(--font-title);
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 900;
  margin: 0 0 16px;
  color: var(--ink);
}

.test-h2 {
  font-family: var(--font-title);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 900;
  margin: 0 0 12px;
  color: var(--ink);
}

.test-muted {
  color: var(--ink-3);
  font-size: 14px;
}

.test-lead {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 20px;
}

.test-note {
  font-size: 13px;
  margin-top: 12px;
}

/* --------------------------------------------------------
   구분선
-------------------------------------------------------- */
.test-divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}

/* --------------------------------------------------------
   버튼 행
-------------------------------------------------------- */
.test-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.test-between {
  justify-content: space-between;
}

/* --------------------------------------------------------
   레벨 선택 카드
-------------------------------------------------------- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.level-card {
  background: var(--bg-alt);
  border: 2px solid rgba(31,26,20,.12);
  border-radius: var(--r);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
  user-select: none;
}

.level-card:hover {
  background: rgba(47,93,80,.06);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.level-card.selected {
  border-color: var(--brand);
  background: rgba(47,93,80,.10);
}

.level-card-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(195,90,42,.10);
  border: 1px dashed rgba(195,90,42,.40);
  color: var(--stamp-2);
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 8px;
}

.level-card-title {
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}

.level-card-sub {
  font-size: 12px;
  color: var(--ink-3);
}

@media (max-width: 420px) {
  .level-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------
   진행 바
-------------------------------------------------------- */
.test-bar {
  height: 5px;
  background: rgba(31,26,20,.08);
  border-radius: 999px;
  margin: 10px 0 20px;
  overflow: hidden;
}

.test-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--stamp));
  border-radius: 999px;
  transition: width .35s ease;
  width: 0;
}

/* --------------------------------------------------------
   질문 영역
-------------------------------------------------------- */
.q-title {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.55;
  margin: 0 0 16px;
}

.q-passage {
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(31,26,20,.12);
  border-left: 4px solid rgba(47,93,80,.35);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 18px;
  white-space: pre-line;
}

/* --------------------------------------------------------
   선택지
-------------------------------------------------------- */
.q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.q-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid rgba(31,26,20,.14);
  border-radius: 12px;
  background: var(--bg-alt);
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
  transition: border-color .15s ease, background .15s ease;
  text-align: left;
  width: 100%;
}

.q-option:hover {
  border-color: var(--brand);
  background: rgba(47,93,80,.05);
}

.q-option.selected {
  border-color: var(--brand);
  background: rgba(47,93,80,.10);
  color: var(--ink);
  font-weight: 700;
}

.q-option-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(31,26,20,.08);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 1px;
}

.q-option.selected .q-option-num {
  background: var(--brand);
  color: #fff;
}

/* --------------------------------------------------------
   결과 카드
-------------------------------------------------------- */
.result-score-wrap {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
}

.result-score-item {
  flex: 1;
  min-width: 100px;
  background: var(--bg-alt);
  border: 1px solid rgba(31,26,20,.12);
  border-radius: var(--r);
  padding: 14px 12px;
  text-align: center;
}

.result-score-label {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.result-score-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--brand);
  font-family: var(--font-title);
}

.result-score-max {
  font-size: 13px;
  color: var(--ink-3);
}

.result-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(47,93,80,.10);
  border: 1px dashed rgba(47,93,80,.40);
  color: var(--brand-2);
  font-weight: 900;
  font-size: 15px;
  margin: 10px 0;
}

.result-desc {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: 16px 0 20px;
  white-space: pre-line;
}

.result-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

/* --------------------------------------------------------
   숨김 유틸
-------------------------------------------------------- */
.hide {
  display: none !important;
}

/* --------------------------------------------------------
   타이머
-------------------------------------------------------- */
#timer-text {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------
   푸터
-------------------------------------------------------- */
.test-footer {
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin-top: auto;
  padding-top: 16px;
}

/* --------------------------------------------------------
   모바일 버튼 풀폭
-------------------------------------------------------- */
@media (max-width: 420px) {
  .test-row .btn,
  .test-row .btn-outline {
    width: 100%;
    justify-content: center;
  }
  .test-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .result-cta-row .btn,
  .result-cta-row .btn-outline {
    width: 100%;
  }
}
