/* 답칸 수학: 모든 쪽이 함께 쓰는 스타일 */
:root {
  --blue: #1F5BD8;
  --blue-deep: #1748B0;
  --sky: #EAF1FF;
  --sky-line: #BFD2FA;
  --navy: #0F1E3D;
  --ink: #111827;
  --muted: #4B5563;
  --line: #E3E8F0;
  --soft: #F4F7FC;
  --yellow: #FFD54A;
  --red: #B42318;
  --radius: 16px;
  --wrap: 1200px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-color: var(--blue) var(--soft); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { display: flex; flex-direction: column; min-height: 100svh; background: #fff; color: var(--ink); font-family: 'Wanted Sans Variable', 'Wanted Sans', 'Malgun Gothic', sans-serif; font-size: 17px; font-weight: 500; line-height: 1.7; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; caret-color: var(--blue); }
main { flex: 1; }
::selection { background: var(--sky-line); color: var(--navy); }
h1, h2, h3 { color: var(--navy); font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: 84px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 40px; }
.num { font-variant-numeric: tabular-nums; }
.note { font-size: 14px; font-weight: 500; color: var(--muted); }
.hidden { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px; border: 1.5px solid transparent; border-radius: 12px; font-size: 16px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background-color .15s ease-out, border-color .15s ease-out; }
.btn i { font-size: 19px; }
.btn-ink { background: var(--blue); color: #fff; }
.btn-ink:hover { background: var(--blue-deep); }
.btn-line { border-color: var(--sky-line); background: #fff; color: var(--navy); }
.btn-line:hover { border-color: var(--blue); }

/* 머리글 */
.top { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); text-decoration: none; }
.brand .mk { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0; }
.nav { display: flex; gap: 2px; font-size: 15.5px; font-weight: 600; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.nav a:hover { background: var(--soft); color: var(--blue); }
.call { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; color: var(--navy); }
.top .btn { height: 44px; padding: 0 18px; font-size: 15px; }

/* 첫 화면: 교실 사진과 반 찾기 */
.hero { position: relative; background: var(--soft); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .92) 46%, rgba(255, 255, 255, .3) 62%, rgba(255, 255, 255, 0) 76%); }
.hero-in { position: relative; z-index: 1; padding-block: 72px 168px; }
.hero h1 { max-width: 13em; font-size: 54px; line-height: 1.2; letter-spacing: -0.04em; }
.hero h1 span { color: var(--blue); }
.hero .lead { max-width: 30em; margin-top: 18px; font-size: 18px; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--navy); }
.facts i { font-size: 17px; color: var(--blue); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.photo-note { position: absolute; right: 16px; top: 14px; z-index: 1; padding: 3px 10px; border-radius: 999px; background: rgba(15, 30, 61, .74); font-size: 12px; font-weight: 600; color: #fff; }

.find-wrap { position: relative; z-index: 2; margin-top: -120px; }
.finder { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: #fff; border-radius: 22px; box-shadow: 0 1px 3px rgba(15, 30, 61, .08), 0 30px 60px -36px rgba(15, 30, 61, .45); }
.finder-q { padding: 28px 32px 30px; }
.finder-q h2 { font-size: 24px; }
.finder-q > p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.qs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin-top: 20px; }
.q { border: 0; min-width: 0; }
.q legend { margin-bottom: 8px; font-size: 15px; font-weight: 800; color: var(--navy); }
.q legend small { margin-left: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: 15px; font-weight: 700; color: var(--ink); transition: border-color .15s ease-out, background-color .15s ease-out, color .15s ease-out; }
.opt:hover span { border-color: var(--sky-line); }
.opt input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.result-pane { padding: 28px 30px; background: var(--soft); border-radius: 0 22px 22px 0; }
.result-pane h3 { font-size: 18px; }
.result { margin-top: 8px; }
.result .range { font-size: 15px; font-weight: 600; color: var(--muted); }
.result .range b { display: block; margin-top: 2px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); font-variant-numeric: tabular-nums; }
.result .range span { font-size: 14px; }
.result .empty { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sky-line); font-size: 15.5px; color: var(--muted); }
.pick { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--blue); line-height: 1.3; }
.pick-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin-top: 12px; font-size: 15.5px; }
.pick-facts dt { font-weight: 600; color: var(--muted); }
.pick-facts dd { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.pick-facts.blank dd { min-height: 1.6em; border-bottom: 1px dashed var(--sky-line); }
.miss { margin-top: 12px; padding: 10px 12px; background: #fff; border-radius: 10px; font-size: 14px; color: var(--muted); }
.exam { margin-top: 12px; font-size: 14.5px; color: var(--muted); }
.exam b { color: var(--navy); }
.dday { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--yellow); color: var(--navy); font-weight: 800; font-variant-numeric: tabular-nums; }
.result .btn { width: 100%; margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) {
  .result.pop .pick, .result.pop .pick-facts, .result.pop .exam { animation: rise .45s cubic-bezier(.16, 1, .3, 1) both; }
  .result.pop .pick-facts { animation-delay: .05s; }
  .result.pop .exam { animation-delay: .1s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* 구역 */
.section { padding-block: 104px; }
.soft { background: var(--soft); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.sec-head h2 { font-size: 36px; line-height: 1.25; }
.sec-lead { max-width: 40em; margin-top: 10px; color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }

/* 반 안내 표 */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 24px; align-items: start; margin-top: 36px; }
.table-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.grid-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.grid-table caption { padding: 16px 20px 0; font-size: 14px; color: var(--muted); text-align: left; }
.grid-table th, .grid-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--line); }
.grid-table thead th { font-size: 14px; font-weight: 700; color: var(--muted); }
.grid-table tbody tr:last-child th, .grid-table tbody tr:last-child td { border-bottom: 0; }
.grid-table tbody th { font-weight: 800; color: var(--navy); white-space: nowrap; }
.grid-table td { font-variant-numeric: tabular-nums; }
.grid-table td.num { font-weight: 800; color: var(--navy); white-space: nowrap; }
.box { padding: 24px 26px; }
.box h3 { font-size: 17px; }
.box h3 + p { margin-top: 6px; font-size: 15px; color: var(--muted); }
.box h3.mt { margin-top: 22px; }
.refund { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 14.5px; }
.refund th, .refund td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.refund td { font-weight: 800; color: var(--navy); text-align: right; white-space: nowrap; }
.refund tr:last-child th, .refund tr:last-child td { border-bottom: 0; }
.exams-table { margin-top: 36px; }
.exams-table td[data-n] { font-weight: 800; }
.grid-table tr.is-pick, .grid-table tr.is-pick th, .grid-table tr.is-pick td { background: var(--sky); }

/* 원장 소개 */
.mentor { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 32px; align-items: start; max-width: 860px; margin-top: 32px; padding: 30px 32px; }
.avatar { display: grid; place-items: center; align-content: center; gap: 4px; width: 136px; height: 136px; border-radius: 50%; background: var(--sky); border: 1.5px dashed var(--sky-line); color: var(--blue); }
.avatar b { font-size: 40px; font-weight: 800; line-height: 1; }
.avatar span { font-size: 12.5px; font-weight: 700; }
.t-name { font-size: 22px; font-weight: 800; color: var(--navy); }
.t-text { margin-top: 8px; color: var(--muted); }
.t-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.t-facts dt { font-weight: 700; color: var(--navy); }
.t-facts dd { color: var(--muted); }
.t-note { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* 수업 방식 */
.how { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; margin-top: 28px; }
.how li { padding: 22px 0 24px; border-top: 1px solid var(--sky-line); }
.how h3 { font-size: 19px; }
.how p { max-width: 34em; margin-top: 6px; font-size: 16px; color: var(--muted); }

/* 상담 신청 */
.apply { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; align-items: start; margin-top: 36px; }
.apply-sheet { display: grid; gap: 22px; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 22px; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.sheet-head h3 { font-size: 22px; }
.sheet-head [data-class-note] { font-size: 14.5px; font-weight: 700; color: var(--blue); }
.apply-qs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.apply-qs .q.wide { grid-column: 1 / -1; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 700; color: var(--navy); }
.field small { font-weight: 500; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; padding: 13px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.field input:hover, .field textarea:hover { border-color: var(--sky-line); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
.field textarea { min-height: 110px; resize: vertical; }
.field ::placeholder { color: #6B7280; }
.err { display: none; font-size: 13.5px; font-weight: 600; color: var(--red); }
.invalid .err { display: block; }
.invalid input:not([type="checkbox"]) { border-color: var(--red); }
.consent { padding: 16px 18px; background: var(--soft); border-radius: 12px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.consent label { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; align-items: start; margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.consent input { margin-top: 3px; }
.consent input { width: 20px; height: 20px; accent-color: var(--blue); }
.consent .err { grid-column: 2; }
.submit .btn { width: 100%; }
.apply-side { position: sticky; top: 96px; }
.apply-side h3 { font-size: 20px; }
.pick-card { margin-bottom: 26px; padding: 18px 20px; background: var(--sky); border-radius: 14px; }
.pick-card[hidden] { display: none; }
.pick-card b { display: block; font-size: 22px; font-weight: 800; color: var(--navy); }
.pick-card span { display: block; margin-top: 2px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.apply-side ol { margin-top: 14px; counter-reset: s; }
.apply-side li { position: relative; padding: 16px 0 16px 46px; border-bottom: 1px solid var(--line); counter-increment: s; }
.apply-side li:first-child { border-top: 1px solid var(--line); }
.apply-side li::before { content: counter(s); position: absolute; left: 0; top: 16px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sky); color: var(--blue); font-size: 14px; font-weight: 800; }
.apply-side li b { display: block; font-size: 17px; color: var(--navy); }
.apply-side li p { font-size: 15px; color: var(--muted); }

/* 오시는 길 */
.visit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 32px; }
.visit > div { padding: 24px 28px; }
.visit > div + div { border-left: 1px solid var(--line); }
.visit dt { font-size: 14px; font-weight: 700; color: var(--muted); }
.visit dd { margin-top: 4px; font-size: 18px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }

/* 하위 쪽 (접수 완료, 개인정보처리방침) */
.page-head { padding-block: 64px 32px; }
.page-head h1 { font-size: 44px; line-height: 1.2; }
.page-head .lead { max-width: 40em; margin-top: 14px; font-size: 18px; color: var(--muted); }
.doc { max-width: 820px; padding-bottom: 104px; }
.doc h2 { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 20px; line-height: 1.4; letter-spacing: -0.02em; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc ul, .doc ol { margin-top: 12px; font-size: 16px; line-height: 1.75; }
.doc ul { padding-left: 20px; list-style: disc; }
.doc ol { padding-left: 22px; list-style: decimal; }
.doc li + li { margin-top: 6px; }
.doc table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.doc th, .doc td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc thead th, .doc tbody th { background: var(--soft); font-weight: 700; }
.doc .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.sample-note { display: inline-block; margin-top: 14px; padding: 4px 10px; border-radius: 6px; background: var(--soft); font-size: 13px; font-weight: 700; color: var(--muted); }

/* 바닥글과 고정 버튼 */
.foot { background: var(--navy); color: #BCC6D9; font-size: 14px; line-height: 1.85; }
.foot .wrap { padding-block: 44px; }
.foot strong { font-size: 17px; color: #fff; }
.foot a { color: #fff; }
.sample { margin-top: 10px; }
.dock { display: none; }

@media (max-width: 1100px) {
  .nav a { padding: 8px 8px; }
  .call span { display: none; }
  .finder { grid-template-columns: 1fr; }
  .result-pane { border-radius: 0 0 22px 22px; }
  .split, .apply { grid-template-columns: 1fr; }
  .apply-side { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .top-in { flex-wrap: wrap; height: auto; padding-block: 10px 0; row-gap: 4px; }
  .top .btn { display: none; }
  .nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; padding: 0 28px 10px 0; font-size: 15px; white-space: nowrap; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .nav a { padding: 4px 0; }
  [id] { scroll-margin-top: 110px; }
  .hero { background: #fff; }
  .hero-img { position: static; aspect-ratio: 16 / 10; height: auto; }
  .hero::after { display: none; }
  .hero-in { padding-block: 24px 36px; }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 16px; }
  .facts li { height: 32px; padding: 0 12px; font-size: 14px; }
  .hero-cta { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-cta .btn { padding: 0 10px; font-size: 15px; }
  .photo-note { top: calc(62.5vw - 30px); right: 10px; }
  .find-wrap { margin-top: 0; }
  .finder-q { padding: 22px 18px; }
  .finder { border-radius: 18px; }
  .qs, .apply-qs { grid-template-columns: 1fr; gap: 16px; }
  .result-pane { padding: 22px 18px; border-radius: 0 0 18px 18px; }
  .section { padding-block: 64px; }
  .sec-head h2 { font-size: 27px; }
  .grid-table thead { display: none; }
  .grid-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .grid-table tbody tr:last-child { border-bottom: 0; }
  .grid-table th, .grid-table td { display: block; padding: 0; border: 0; }
  .grid-table td[data-label]::before { content: attr(data-label) " "; font-size: 13px; font-weight: 600; color: var(--muted); }
  .grid-table td.num, .grid-table td[data-n] { grid-column: 2; grid-row: 1; text-align: right; }
  .grid-table td.num::before, .grid-table td[data-n]::before { content: none; }
  .mentor { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; padding: 22px 20px; }
  .avatar { width: 96px; height: 96px; }
  .avatar b { font-size: 30px; }
  .how { grid-template-columns: 1fr; }
  .how li { padding: 18px 0 20px; }
  .apply-sheet { padding: 22px 18px; }
  .fields { grid-template-columns: 1fr; }
  .visit { grid-template-columns: 1fr; }
  .visit > div { padding: 18px 20px; }
  .visit > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .page-head { padding-block: 36px 20px; }
  .page-head h1 { font-size: 29px; }
  .doc { padding-bottom: 72px; }
  .foot .wrap { padding-bottom: 120px; }
  .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); transition: transform .3s cubic-bezier(.3, .7, .2, 1), visibility 0s; }
  .dock.is-hidden { transform: translateY(110%); visibility: hidden; transition: transform .3s cubic-bezier(.3, .7, .2, 1), visibility 0s .3s; }
  .dock-result { flex-basis: 100%; font-size: 14px; font-weight: 700; color: var(--blue); text-decoration: none; }
  .dock-result[hidden] { display: none; }
  .dock .btn { flex: 1; height: 50px; padding: 0 10px; }
  .dock .btn-ink { flex: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .dock, .dock.is-hidden { transition: none; }
}
