/* 글꼴 Pretendard 1.3.9 (SIL OFL 1.1, 라이선스는 assets/fonts/Pretendard-LICENSE.txt) — 가변 글꼴 하나로 굵기 45~920 */
@font-face { font-family: "Pretendard Variable"; font-weight: 45 920; font-style: normal; font-display: swap; src: url("/assets/fonts/PretendardVariable.woff2") format("woff2-variations"), url("/assets/fonts/PretendardVariable.woff2") format("woff2"); }
:root {
  /* PEMS 콘솔과 같은 색 — 바탕·패널·선·글자·남색 강조·하늘색 */
  --bg: #f5f7fb; --card: #fff; --panel2: #eef2fa; --line: #e4e8f0; --text: #1a2233; --muted: #5b6577;
  --pri: #16255A; --pri-d: #22336F; --cyan: #00AEEF; --sky: #D6E8F8;
  --ok: #2ea043; --bad: #e5484d; --warn: #b8860b;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif; word-break: keep-all; overflow-wrap: anywhere; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.65; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--pri); text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.35; }
h1 { font-size: 24px; font-weight: 700; margin: 4px 0 20px; }
h2 { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin: 28px 0 10px; }
.card h2, .policy h2 { color: var(--text); font-size: 16px; letter-spacing: -0.02em; }
code, kbd, .mono { font-family: "D2Coding", Consolas, "SF Mono", Menlo, monospace; font-size: .92em; letter-spacing: 0; }
code { background: var(--panel2); border-radius: 4px; padding: 1px 5px; }
table, .timer, .omr, .score .big, .tag, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.6; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 56px; background: linear-gradient(90deg, #D6E8F8, #E2EFFB); border-bottom: 1px solid #C7DBEF; }
.top .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -0.03em; color: var(--pri); white-space: nowrap; }
.mark { width: 28px; height: 28px; border-radius: 8px; background: #fff; display: grid; place-items: center; padding: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.top nav a { padding: 6px 12px; border-radius: 8px; color: #586178; white-space: nowrap; font-size: 14.5px; font-weight: 500; }
.top nav a:hover { background: rgba(255,255,255,.6); color: var(--pri); }
.top nav a.on { background: #fff; color: var(--pri); font-weight: 600; box-shadow: 0 2px 8px rgba(22,37,90,.10); }
.who { display: flex; gap: 12px; align-items: center; white-space: nowrap; font-size: 14px; }
.who a { color: var(--text); }

main { max-width: 920px; margin: 0 auto; padding: 24px 16px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--pri); background: var(--pri); color: #fff; cursor: pointer; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.btn:hover { background: var(--pri-d); }
.btn.ghost { background: #fff; color: var(--pri); }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f0c4c4; }
.btn.sm { padding: 5px 10px; font-size: 13px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,174,239,.15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }

/* 로그인 — PEMS 관리자 로그인 카드와 같은 모양 */
.loginwrap { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.logincard { width: 320px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px; }
.logincard .brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 0 4px; }
.logincard .brand .logo { width: 32px; height: 32px; border-radius: 9px; background: #fff; display: grid; place-items: center; padding: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.logincard .brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logincard .brand b { font-size: 17px; letter-spacing: -0.03em; color: var(--pri); }
.logincard .brand small { display: block; color: #8A94A8; font-size: 12px; letter-spacing: 0; }
.logincard .lc-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 2px 0 16px; }
.logincard input { width: 100%; padding: 11px 12px; margin: 6px 0; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 14px; }
.logincard input:focus { outline: none; border-color: var(--pri); box-shadow: none; }
.logincard button { width: 100%; padding: 11px; border-radius: 9px; border: 0; background: var(--pri); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 10px; }
.logincard button:hover { filter: brightness(1.1); }
.loginErr { color: #fff; background: var(--bad); border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-top: 8px; text-align: center; }
.lc-foot { text-align: center; font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.lc-foot a { color: var(--pri); font-weight: 600; }
.lc-link { background: none; border: 0; padding: 0; margin: 0; width: auto !important; color: var(--muted) !important; font-size: 13px !important; font-weight: 400 !important; cursor: pointer; }
.logincard .lc-link { background: none; margin: 0; }
.lc-link.strong { color: var(--pri) !important; font-weight: 600 !important; }
.lc-sep { margin: 0 8px; color: #c5cbd6; }
.lc-info { font-size: 13px; color: var(--muted); margin: 0 0 8px; line-height: 1.6; }
.lc-info strong { color: var(--text); }
.loginwrap { flex-direction: column; justify-content: flex-start; overflow-y: auto; }
.loginwrap .logincard { margin-top: auto; flex: none; }
.loginwrap .lc-legal { margin-bottom: auto; }
.lc-legal { margin-top: 14px; font-size: 12px; }
.lc-legal a { color: var(--muted); }
.agree { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 13px; }
.agree label { display: flex; align-items: center; gap: 6px; cursor: pointer; flex: 1; min-width: 0; white-space: nowrap; font-size: 12.5px; }
.agree .lc-link { flex: none; white-space: nowrap; font-size: 12px !important; }
.logincard .agree input[type=checkbox] { width: 16px; height: 16px; margin: 0; padding: 0; }
.req { color: var(--pri); font-weight: 600; }
.agree-detail { background: var(--panel2); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.agree-detail table { font-size: 12px; }
.agree-detail th, .agree-detail td { padding: 4px 6px; border-color: #dde3ee; }
.agree-detail p { margin: 8px 0 0; }
.policy h1 { margin-bottom: 12px; }
.policy h2 { font-size: 15px; margin: 22px 0 8px; }
.policy p { margin: 6px 0; }
.site-foot { max-width: 920px; margin: 0 auto; padding: 0 16px 28px; font-size: 12px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* 시험 목록 */
.exam-item { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.exam-item h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.tag { display: inline-block; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 2px 7px; border-radius: 4px; background: #eef1f5; color: var(--muted); margin-right: 4px; letter-spacing: 0; }
.tag.ok { background: #e3f6eb; color: var(--ok); }
.tag.bad { background: #fbe9e9; color: var(--bad); }
.tag.off { background: #fff3d6; color: var(--warn); }

/* 문제 풀기 */
.bar { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: 10px 0; margin-bottom: 8px; }
.progress { height: 6px; background: #e3e8ef; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--cyan); transition: width .2s; }
.timer { font-weight: 700; font-size: 16px; letter-spacing: 0; }
.timer.low { color: var(--bad); }
.q-body { white-space: pre-wrap; margin: 0 0 16px; font-size: 16.5px; font-weight: 500; line-height: 1.7; letter-spacing: -0.015em; }
.q-no { color: var(--pri); font-weight: 700; margin-right: 8px; font-variant-numeric: tabular-nums; }
.sec-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--pri); border-bottom: 1px solid var(--sky); padding: 0 0 6px; margin-bottom: 12px; letter-spacing: 0; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; text-align: left; width: 100%; line-height: 1.6; }
.choice:hover { border-color: #b8c9e6; }
.choice .n { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 1px solid #c5cdd8; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.choice.sel { border-color: var(--pri); background: var(--panel2); }
.choice.sel .n { background: var(--pri); border-color: var(--pri); color: #fff; }
.choice.right { border-color: var(--ok); background: #eefaf3; }
.choice.right .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.choice.wrong { border-color: var(--bad); background: #fdf0f0; }
.choice.wrong .n { background: var(--bad); border-color: var(--bad); color: #fff; }
.choice[disabled] { cursor: default; color: inherit; }
.expl { margin-top: 12px; padding: 12px 14px; background: var(--panel2); border-left: 3px solid var(--cyan); border-radius: 6px; white-space: pre-wrap; font-size: 14.5px; line-height: 1.75; }
.omr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.omr a, .omr button { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); background: #fff; }
.omr .done { background: var(--sky); border-color: #C7DBEF; color: var(--pri); }
.omr .right { background: #e3f6eb; border-color: #a9dfbf; color: var(--ok); }
.omr .wrong { background: #fbe9e9; border-color: #f0c4c4; color: var(--bad); }

/* 결과 */
.score { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.score .big { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.score .big small { font-size: 18px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; letter-spacing: 0; }
.table-wrap { overflow-x: auto; }

.choice-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.choice-edit input[type=radio] { width: 18px; height: 18px; flex: none; }
.choice-edit input[type=text] { flex: 1; }
pre.code { background: #1d2530; color: #e6edf3; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; font-family: "D2Coding", Consolas, "SF Mono", Menlo, monospace; letter-spacing: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2530; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 50; max-width: 90vw; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 6px 12px; }
  .top nav { order: 3; flex-basis: 100%; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { padding: 6px 9px; font-size: 14px; }
  .who { margin-left: auto; }
  .bar { top: 92px; }
  main { padding: 16px 10px 80px; }
  .card { padding: 16px; }
  .grid2, .grid4 { grid-template-columns: 1fr 1fr; }
  .exam-item { flex-direction: column; align-items: stretch; }
  .exam-item .btn { width: 100%; }
}
.omr button { cursor: pointer; font: inherit; }
