/* =========================================================
   새봄 입시계산기 — 공통 스타일시트
   순수 정적 CSS (빌드 도구 불필요)
   ========================================================= */

:root {
  --navy: #0b2545;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f7f9fc;
  --card: #ffffff;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #eef4ff;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 37, 69, .04), 0 8px 24px rgba(15, 37, 69, .06);
  --shadow-sm: 0 1px 2px rgba(15, 37, 69, .06);
  --max: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.35; letter-spacing: -0.02em; color: var(--navy); margin: 0 0 .6em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: #fff; color: var(--navy);
  padding: 10px 16px; z-index: 999; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--primary), #3b82f6);
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: -0.03em;
  box-shadow: 0 2px 6px rgba(29, 78, 216, .3);
}
.logo-text { font-weight: 800; font-size: 17px; color: var(--navy); letter-spacing: -0.03em; }
.logo-text small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; line-height: 1.2; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.site-nav a {
  color: #334155; font-size: 14.5px; font-weight: 600; padding: 9px 12px;
  border-radius: var(--radius-sm); text-decoration: none; white-space: nowrap;
}
.site-nav a:hover { background: var(--primary-soft); color: var(--primary-dark); text-decoration: none; }
.site-nav a.active { color: var(--primary-dark); background: var(--primary-soft); }

.nav-toggle {
  display: none; margin-left: auto; background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); width: 40px; height: 38px; font-size: 18px; line-height: 1;
  color: var(--navy); cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 8px 14px 14px; gap: 2px;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 14px; font-size: 15.5px; }
}

/* ---------- 히어로 ---------- */
.hero {
  background:
    radial-gradient(900px 380px at 12% -10%, #dbeafe 0%, rgba(219, 234, 254, 0) 70%),
    radial-gradient(700px 340px at 92% 0%, #ccfbf1 0%, rgba(204, 251, 241, 0) 68%),
    #fff;
  border-bottom: 1px solid var(--line);
  padding: 54px 0 46px;
}
.hero h1 { font-size: clamp(26px, 4.2vw, 38px); margin-bottom: 14px; }
.hero p.lead { font-size: 17px; color: #475569; margin: 0 0 22px; max-width: 720px; }
.hero .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--primary-dark); background: var(--primary-soft);
  border: 1px solid #dbe7ff; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}

.page-head { padding: 34px 0 10px; }
.page-head h1 { font-size: clamp(24px, 3.4vw, 31px); margin-bottom: 8px; }
.page-head p { color: var(--muted); margin: 0; font-size: 15.5px; }

.breadcrumb { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin: 0 6px; opacity: .55; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; padding: 11px 20px; font-size: 15px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .06s;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(29, 78, 216, .22); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--navy); }
.btn-ghost:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-sm { padding: 7px 13px; font-size: 13.5px; border-radius: 8px; }
.btn-danger-ghost { background: #fff; border-color: #f1c6c6; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 카드 ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; margin: 0; }
.section-head a { font-size: 14px; font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.tool-card .icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); font-size: 19px;
}
.tool-card h3 { font-size: 17px; margin: 2px 0 0; }
.tool-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.tool-card .more { margin-top: auto; padding-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--primary); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 19px; margin-bottom: 14px; }
.panel h3 { font-size: 16px; margin: 20px 0 8px; }

/* ---------- 계산기 공통 ---------- */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .calc-layout { grid-template-columns: 1fr; } }

.field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field-label { font-size: 13px; font-weight: 700; color: #475569; }
.field input, .field select,
td input, td select, .input {
  font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; background: #fff;
  min-width: 0;
}
.field input:focus, .field select:focus, td input:focus, td select:focus {
  outline: 2px solid #bfdbfe; border-color: var(--primary); outline-offset: 0;
}
.input-sm { padding: 6px 8px; font-size: 14px; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.55; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1 1 auto; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: #334155;
  border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.chip:hover { border-color: #93c5fd; background: var(--primary-soft); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data-table th {
  text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted);
  padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data-table td { padding: 6px 6px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.data-table td input, table.data-table td select { width: 100%; }
table.data-table .num { text-align: center; }
table.data-table td.num input, table.data-table td.num select { text-align: center; }
.row-del {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 7px;
  width: 30px; height: 30px; cursor: pointer; font-size: 15px; line-height: 1;
}
.row-del:hover { color: var(--danger); border-color: #f1c6c6; background: var(--danger-soft); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 결과 */
.result-card {
  background: linear-gradient(180deg, #f8fbff, #fff);
  border: 1px solid #dbe7ff; border-radius: var(--radius); padding: 22px;
}
.result-label { font-size: 13px; font-weight: 700; color: var(--primary-dark); letter-spacing: .02em; }
.result-big {
  font-size: clamp(38px, 7vw, 50px); font-weight: 800; color: var(--navy);
  line-height: 1.1; margin: 4px 0 2px; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.result-big .unit { font-size: .42em; font-weight: 700; color: var(--muted); margin-left: 3px; }
.result-sub { font-size: 14px; color: var(--muted); }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; border: 1px solid transparent;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.badge-fail { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); border-color: #dbe7ff; }

.verdict {
  border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; border: 1px solid;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.verdict.ok { background: var(--ok-soft); border-color: #a7f3d0; }
.verdict.fail { background: var(--danger-soft); border-color: #fecaca; }
.verdict.warn { background: var(--warn-soft); border-color: #fde68a; }
.verdict .big { font-size: 20px; font-weight: 800; }
.verdict.ok .big { color: var(--ok); }
.verdict.fail .big { color: var(--danger); }
.verdict.warn .big { color: var(--warn); }
.verdict p { margin: 0; font-size: 14px; color: #475569; }

.note {
  background: #f8fafc; border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 13px 16px; font-size: 14px;
  color: #475569; margin: 16px 0;
}
.note strong { color: var(--navy); }
.note-warn { border-left-color: #f59e0b; background: var(--warn-soft); }

/* ---------- 광고 슬롯 안내 ---------- */
.ad-slot {
  margin: 26px 0; min-height: 100px; border-radius: var(--radius);
  background: #fff; border: 1px dashed #dbe3ee;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; font-size: 12.5px;
}
.ad-slot::before { content: "광고"; letter-spacing: .2em; }

/* ---------- 가이드 본문 ---------- */
.prose { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 34px 40px; box-shadow: var(--shadow-sm); }
@media (max-width: 640px) { .prose { padding: 24px 18px 28px; } }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 21px; margin: 34px 0 12px; padding-top: 6px; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 7px; }
.prose li > ul, .prose li > ol { margin-top: 7px; margin-bottom: 4px; }
.prose blockquote {
  margin: 18px 0; padding: 14px 18px; background: var(--primary-soft);
  border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; color: #1e3a8a;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 20px; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.prose th { background: #f6f8fc; font-weight: 700; color: var(--navy); font-size: 13.5px; }
.prose .table-wrap { margin: 16px 0 20px; }
.prose .table-wrap table { margin: 0; }
.prose strong { color: var(--navy); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

.article-meta { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.article-meta .tag { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; padding: 2px 9px; border-radius: 999px; font-size: 12px; }

.toc { background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 26px; }
.toc h2 { font-size: 14px !important; margin: 0 0 8px !important; color: var(--muted); letter-spacing: 0; }
.toc ol { margin: 0 !important; padding-left: 20px !important; font-size: 14px; }
.toc li { margin-bottom: 4px; }
.toc a { color: #334155; }

.related { margin-top: 26px; }
.related h2 { font-size: 16px; margin-bottom: 10px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 15px; font-size: 14.5px; font-weight: 600; color: var(--navy); }
.related a:hover { border-color: #bfdbfe; background: #f8fbff; text-decoration: none; }

/* ---------- 목록 ---------- */
.list-rows { display: grid; gap: 10px; }
.list-row {
  display: flex; gap: 14px; align-items: flex-start; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 18px;
  color: inherit; text-decoration: none;
}
.list-row:hover { border-color: #bfdbfe; background: #f8fbff; text-decoration: none; }
.list-row .n { font-weight: 800; color: #93c5fd; font-variant-numeric: tabular-nums; min-width: 22px; }
.list-row h3 { font-size: 15.5px; margin: 0 0 2px; }
.list-row p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- 푸터 ---------- */
.site-footer { background: #0b2545; color: #c7d2e3; margin-top: 56px; padding: 42px 0 30px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.site-footer h4 { color: #fff; font-size: 13.5px; margin: 0 0 10px; letter-spacing: .02em; }
.site-footer a { color: #c7d2e3; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.site-footer p { margin: 0; line-height: 1.7; color: #9fb3cd; font-size: 13px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 12.5px; color: #8698b3; }

/* ---------- 타이머 ---------- */
.dday-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dday-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.dday-box .t { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.dday-box .d { font-size: 30px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.dday-box .d span { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.dday-box .s { font-size: 12.5px; color: var(--muted); }
.dday-box.past { opacity: .55; }

.timer-stage { text-align: center; padding: 8px 0 4px; }
.timer-clock {
  font-size: clamp(56px, 15vw, 96px); font-weight: 800; color: var(--navy);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1;
}
.timer-clock.warning { color: var(--danger); }
.timer-subject { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.timer-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.timer-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 18px; }
.timer-presets button {
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 10px;
  cursor: pointer; font-family: inherit; text-align: left;
}
.timer-presets button:hover { border-color: #93c5fd; background: var(--primary-soft); }
.timer-presets button.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.timer-presets .n { display: block; font-size: 14.5px; font-weight: 700; color: var(--navy); }
.timer-presets .m { font-size: 12.5px; color: var(--muted); }
.progress { height: 8px; background: #e8eef7; border-radius: 99px; overflow: hidden; margin-top: 18px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3b82f6, #0f766e); transition: width .3s linear; }

/* ---------- 기타 ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.inline-code { background: #f1f5f9; border-radius: 4px; padding: 1px 5px; font-size: .92em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.contact-box { background: var(--primary-soft); border: 1px solid #dbe7ff; border-radius: var(--radius); padding: 20px; margin: 18px 0; }
.contact-box a { font-weight: 700; }

.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: 15px; }
.faq details p { margin: 8px 0 0; font-size: 14.5px; color: #475569; }

.print-only { display: none; }
@media print {
  .site-header, .site-footer, .ad-slot, .toolbar, .timer-actions { display: none; }
  body { background: #fff; }
}
