:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5d6677;
  --border: #d9dde5;
  --primary: #1f5fbf;
  --primary-text: #ffffff;
  --error-bg: #fdecec;
  --error: #a32020;
  --info-bg: #e9f2fd;
  --info: #1b4f94;
  --warn-bg: #fff6e0;
  --warn: #7a5300;
  --brand-blue: #0068b7;
  --brand-red: #e60012;
  --footer-bg: #1c2533;
  --footer-text: #b9c0cc;
  --footer-muted: #8590a3;
  --footer-line: #2f3a4d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --surface: #1d2129;
    --text: #e6e9ef;
    --muted: #9aa3b2;
    --border: #343a46;
    --primary: #5b9bf0;
    --primary-text: #0d1117;
    --error-bg: #3a1d1d;
    --error: #ff9c9c;
    --info-bg: #1b2a40;
    --info: #9cc4ff;
    --warn-bg: #3a2f14;
    --warn: #f2cf7a;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }
/* 학생 화면 header: 학교 로고 │ 서비스명. 로고 대비를 위해 다크 모드에서도 흰 바탕 */
.site-header { padding-top: 3px; background: linear-gradient(90deg, var(--brand-blue) 85%, var(--brand-red) 85%) top / 100% 3px no-repeat, #ffffff; border-bottom: 1px solid #d9dde5; }
.site-header-inner { max-width: 640px; margin: 0 auto; padding: 14px 16px; }
.brand { display: inline-flex; align-items: center; color: #1d2330; text-decoration: none; }
.brand-logo { display: block; width: auto; height: 46px; }
.brand-divider { width: 1px; height: 34px; margin: 0 18px; background: #d9dde5; }
.brand-service { display: flex; flex-direction: column; justify-content: space-between; height: 40px; padding-top: 2px; }
.brand-title { font-size: 19px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; line-height: 1.1; letter-spacing: .02em; color: #5d6677; }
@media (max-width: 480px) {
  .site-header-inner { padding: 12px 16px; }
  .brand-logo { height: 38px; }
  .brand-divider { height: 28px; margin: 0 12px; }
  .brand-service { height: 33px; }
  .brand-title { font-size: 15px; }
  .brand-sub { font-size: 11px; letter-spacing: 0; }
  .brand-domain { display: none; }
}
/* mock 시험 콘솔(dev.html)은 글자 header를 그대로 쓴다 */
.site-header.dev-header { padding: 14px 16px; background: var(--surface); border-bottom-color: var(--border); display: flex; justify-content: space-between; align-items: center; }
.dev-header .brand { font-weight: 700; color: var(--text); }
.header-link { color: var(--primary); }
.container { width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.container.wide { max-width: 1400px; }
h1 { font-size: 1.6rem; margin: 8px 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; }
.lead { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin: 16px 0; overflow-x: auto; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.card > form input[type=text], .card > form input[type=password], form.card input[type=text], form.card input[type=password] { width: 100%; }
button, .button {
  display: inline-block; font: inherit; padding: 9px 16px; margin: 4px 4px 4px 0; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.danger { border-color: var(--error); color: var(--error); }
form.card button.primary { margin-top: 16px; width: 100%; }
/* 제출 대기 표시 (submit-guard.js) */
button[disabled] { opacity: .7; cursor: progress; }
.is-pending::before {
  content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.15em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-pending::before { animation: none; border-right-color: currentColor; opacity: .5; } }
.pending-note { background: var(--info-bg); color: var(--info); padding: 10px 12px; border-radius: 8px; margin: 12px 0 0; font-size: .95rem; }
.pending-note[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions form { margin: 0; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 6px 6px 6px 0; flex-wrap: wrap; }
.alert { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.alert.error { background: var(--error-bg); color: var(--error); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.message { font-size: 1.05rem; font-weight: 600; }
.muted { color: var(--muted); font-size: .9rem; }
.account { font-size: 1.4rem; font-weight: 700; letter-spacing: .02em; }
.notice { white-space: pre-wrap; font: inherit; margin: 0; }
.note { color: var(--muted); font-size: .95rem; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.steps li.on { color: var(--primary); font-weight: 700; }
.site-footer { background: var(--footer-bg); color: var(--footer-text); font-size: .85rem; }
.site-footer-inner { max-width: 640px; margin: 0 auto; padding: 24px 16px 20px; }
.site-footer p { margin: 0 0 12px; }
.site-footer code { color: #e6e9ef; }
.footer-logo { display: block; width: auto; height: 36px; margin-bottom: 12px; }
.site-footer .copyright { margin: 0; padding-top: 10px; border-top: 1px solid var(--footer-line); color: var(--footer-muted); font-size: .8rem; }
@media (max-width: 480px) { .footer-logo { height: 30px; } }
code { font-family: Consolas, "D2Coding", monospace; font-size: .9em; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td input, td select { padding: 4px 6px; font-size: .88rem; }
.nowrap { white-space: nowrap; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: .8rem; border: 1px solid var(--border); }
.badge.active { color: var(--info); }
.badge.suspended { color: var(--warn); }
.badge.deleted { color: var(--error); }
.mail { border-top: 1px solid var(--border); padding: 8px 0; }
.mail-head { font-size: .9rem; }
.mail pre { white-space: pre-wrap; margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
