/* assets/css/exam.css - 모의고사(CBT) 시스템 전용 스타일 (SV140) */

.fw-exam-notice { background: var(--fw-teal-bg); border: 1px solid var(--fw-teal-light); border-radius: var(--fw-radius); padding: 14px 16px; margin-bottom: 20px; }
.fw-exam-notice p { margin: 0 0 6px; }
.fw-exam-notice p:last-child { margin-bottom: 0; }

.fw-exam-cert-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.fw-exam-cert-card { background: #fff; border: 1px solid var(--fw-border); border-radius: var(--fw-radius); padding: 18px; }
.fw-exam-cert-card h3 { margin: 0 0 10px; }
.fw-exam-cert-meta { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; color: var(--fw-text-sub); }
.fw-exam-cert-meta li { margin: 3px 0; }

/* ---------- 문제풀이 화면 ---------- */
.fw-exam-take { max-width: 1100px; margin: 0 auto; }
.fw-exam-topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    background: var(--fw-navy); color: #fff;
    padding: 12px 18px; border-radius: var(--fw-radius);
    margin-bottom: 16px;
}
.fw-exam-cert-name { font-weight: 700; flex: 1; }
.fw-exam-timer { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.fw-exam-timer.is-warning { color: #fbbf24; }
.fw-exam-timer.is-critical { color: #f87171; animation: fwExamBlink 1s infinite; }
@keyframes fwExamBlink { 50% { opacity: .4; } }

.fw-exam-body { display: flex; gap: 20px; align-items: flex-start; }
.fw-exam-main { flex: 1; background: #fff; border: 1px solid var(--fw-border); border-radius: var(--fw-radius); padding: 20px; min-width: 0; }
.fw-exam-sidebar { width: 240px; flex: none; background: #fff; border: 1px solid var(--fw-border); border-radius: var(--fw-radius); padding: 16px; position: sticky; top: calc(var(--fw-header-h, 60px) + 14px); } /* SV209: 헤더 높이 변수 사용 */

.fw-exam-question-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.fw-exam-question-no { font-weight: 800; font-size: 16px; color: var(--fw-blue); }
.fw-exam-question-subject { font-size: 12.5px; background: #eef2ff; color: var(--fw-blue); padding: 3px 10px; border-radius: 20px; }
.fw-exam-flag { margin-left: auto; font-size: 13px; color: var(--fw-text-sub); display: flex; align-items: center; gap: 5px; cursor: pointer; }

.fw-exam-question-text { font-size: 16px; line-height: 1.7; margin-bottom: 18px; white-space: pre-line; }

.fw-exam-choices { display: flex; flex-direction: column; gap: 8px; }
.fw-exam-choice {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border: 1px solid var(--fw-border-light); border-radius: var(--fw-radius);
    cursor: pointer; font-size: 14.5px;
}
.fw-exam-choice:hover { background: #f8fafc; }
.fw-exam-choice input:checked ~ span { font-weight: 700; color: var(--fw-blue); }
.fw-exam-choice:has(input:checked) { border-color: var(--fw-blue); background: #eef2ff; }

/* SV148: 서술형 답안 입력창 */
.fw-exam-essay-input {
    width: 100%; min-height: 140px; padding: 12px 14px; font-size: 14.5px; line-height: 1.6;
    border: 1px solid var(--fw-border-light); border-radius: var(--fw-radius); resize: vertical;
    font-family: inherit;
}
.fw-exam-essay-input:focus { border-color: var(--fw-blue); outline: none; }

.fw-exam-nav-buttons { display: flex; justify-content: space-between; margin-top: 20px; }

/* SV148: 자가채점(서술형) 화면 */
.fw-exam-selfgrade-item { border: 1px solid var(--fw-border-light); border-radius: var(--fw-radius); padding: 18px; margin-bottom: 18px; }
.fw-exam-selfgrade-block { margin: 10px 0; }
.fw-exam-selfgrade-block-label { font-size: 12.5px; font-weight: 700; color: var(--fw-text-sub); margin-bottom: 4px; }
.fw-exam-selfgrade-answer { background: #f8fafc; border-radius: 8px; padding: 10px 12px; white-space: pre-line; font-size: 14px; }
.fw-exam-selfgrade-model { background: #eefbf3; border-radius: 8px; padding: 10px 12px; white-space: pre-line; font-size: 14px; }
.fw-exam-selfgrade-criteria { background: #fff7ed; border-radius: 8px; padding: 10px 12px; white-space: pre-line; font-size: 13.5px; }
.fw-exam-selfgrade-score { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.fw-exam-selfgrade-score input[type=number] { width: 80px; padding: 6px 10px; border: 1px solid var(--fw-border); border-radius: 6px; }

.fw-exam-answer-sheet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.fw-exam-sheet-btn {
    aspect-ratio: 1; border: 1px solid var(--fw-border-light); border-radius: 6px; background: #fff;
    font-size: 12px; cursor: pointer;
}
.fw-exam-sheet-btn.is-current { border-color: var(--fw-navy); border-width: 2px; font-weight: 800; }
.fw-exam-sheet-btn.is-answered { background: #eef2ff; border-color: var(--fw-blue); color: var(--fw-blue); }
.fw-exam-sheet-btn.is-flagged { background: #fff7ed; border-color: var(--fw-orange); color: var(--fw-orange); }
.fw-exam-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--fw-text-sub); }
.fw-exam-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--fw-border-light); vertical-align: middle; margin-right: 4px; }
.fw-exam-legend-dot.is-answered { background: #eef2ff; border-color: var(--fw-blue); }
.fw-exam-legend-dot.is-flagged { background: #fff7ed; border-color: var(--fw-orange); }

@media (max-width: 768px) {
    .fw-exam-body { flex-direction: column; }
    .fw-exam-sidebar { width: 100%; position: static; }
    .fw-exam-answer-sheet { grid-template-columns: repeat(8, 1fr); }
}

.fw-exam-paused-box {
    max-width: 480px; margin: 60px auto; text-align: center;
    background: #fff; border: 1px solid var(--fw-border); border-radius: var(--fw-radius);
    padding: 40px 30px;
}
.fw-exam-paused-box h2 { margin-top: 0; }
.fw-exam-paused-box form { margin: 20px 0; }

/* ---------- 계산기 ---------- */
.fw-exam-calc {
    position: fixed; right: 20px; bottom: 20px; z-index: 50;
    width: 240px; background: #fff; border: 1px solid var(--fw-border); border-radius: var(--fw-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 12px;
}
.fw-exam-calc-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; font-size: 13px; }
.fw-exam-calc-close { border: none; background: none; cursor: pointer; font-size: 14px; color: var(--fw-text-sub); }
.fw-exam-calc-display {
    width: 100%; box-sizing: border-box; text-align: right; font-size: 20px; font-variant-numeric: tabular-nums;
    padding: 10px; margin-bottom: 8px; border: 1px solid var(--fw-border-light); border-radius: 6px; background: #f8fafc;
}
.fw-exam-calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fw-exam-calc-key { padding: 10px 0; border: 1px solid var(--fw-border-light); border-radius: 6px; background: #fff; font-size: 14px; cursor: pointer; }
.fw-exam-calc-key:hover { background: #f1f5f9; }
.fw-exam-calc-key-op { background: #eef2ff; color: var(--fw-blue); }
.fw-exam-calc-key-fn { background: #f8fafc; color: var(--fw-text-sub); }
.fw-exam-calc-key-eq { background: var(--fw-blue); color: #fff; }

@media (max-width: 480px) {
    .fw-exam-calc { right: 10px; bottom: 10px; width: 210px; }
}

/* ---------- 결과 화면 ---------- */
.fw-exam-result-summary {
    display: flex; align-items: center; gap: 20px;
    padding: 20px; border-radius: var(--fw-radius); margin-bottom: 20px;
}
.fw-exam-result-summary.is-pass { background: #f0fdf4; border: 1px solid #bbf7d0; }
.fw-exam-result-summary.is-fail { background: #fef2f2; border: 1px solid #fecaca; }
.fw-exam-result-badge { font-size: 22px; font-weight: 800; }
.is-pass .fw-exam-result-badge { color: var(--fw-success); }
.is-fail .fw-exam-result-badge { color: var(--fw-danger); }
.fw-exam-result-score { font-size: 18px; font-weight: 700; }

/* SV164: 비회원 결과 화면 - "3초 회원가입" 유도 배너 */
.fw-exam-guest-cta {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--fw-radius);
    padding: 18px 20px; margin-bottom: 24px; text-align: center;
}
.fw-exam-guest-cta-title { font-size: 16px; font-weight: 800; color: #1d4ed8; margin: 0 0 6px; }
.fw-exam-guest-cta .fw-hint { margin: 0 0 14px; }
.fw-exam-guest-cta .fw-btn { display: inline-block; }

.fw-exam-review-item { border: 1px solid var(--fw-border-light); border-radius: var(--fw-radius); padding: 16px; margin-bottom: 14px; }
.fw-exam-review-choices { list-style: none; margin: 10px 0; padding: 0; font-size: 14px; }
.fw-exam-review-choices li { padding: 5px 0; }
.fw-exam-review-choices li.is-answer { color: var(--fw-success); font-weight: 700; }
.fw-exam-review-choices li.is-selected:not(.is-answer) { color: var(--fw-danger); font-weight: 700; }
.fw-exam-explanation { background: #f8fafc; border-radius: 6px; padding: 10px 12px; font-size: 13.5px; color: var(--fw-text); margin-top: 8px; }
