@font-face {
  font-family: "Pretendard";
  src: url("../fonts/PretendardSubset.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #FFFFFF;
  --porcelain: #F4F5F3;
  --press: #E9ECE9;
  --ink: #15201E;
  --text: #2F3A37;
  --sub: #5A6662;
  --line: #E1E5E2;
  --teal: #134E4A;
  --teal-press: #0E3B38;
  --teal-tint: #E2EEEB;
  --champagne: #B8A67C;
  --danger: #B42318;
  --danger-tint: #FDF1F0;
  --warn-tint: #FFF6E5;
  --warn: #8A5300;

  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); scrollbar-color: #B9C2BE transparent; accent-color: var(--teal); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; letter-spacing: -0.01em;
  color: var(--text); background: var(--bg); word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 700; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--teal); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
input, textarea { caret-color: var(--teal); }
::selection { background: #CDE3DE; color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.container { width: min(1120px, 100% - 48px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 200; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: 12px; }
.tnum { font-variant-numeric: tabular-nums; }

/* 데모 안내 띠 */
.demo-bar { background: var(--ink); color: #DCE5E2; font-size: .875rem; text-align: center; padding: 9px 16px; line-height: 1.5; }
.demo-bar strong { color: #fff; font-weight: 600; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--r-md);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), transform .12s var(--ease), color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not([disabled]) { background: var(--teal-press); }
.btn-soft { background: var(--teal-tint); color: var(--teal-press); }
.btn-soft:hover:not([disabled]) { background: #D2E5E0; }
.btn-ghost { background: transparent; color: var(--sub); }
.btn-ghost:hover:not([disabled]) { background: var(--porcelain); color: var(--ink); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.0625rem; }
.btn-block { width: 100%; }

/* 헤더 */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.logo b { font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.04em; }
.logo span { font-size: .8125rem; color: var(--sub); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--sub); text-decoration: none; font-size: .9375rem; font-weight: 500; }
.nav a:hover { background: var(--porcelain); color: var(--ink); }
.nav a.btn-primary { color: #fff; }
.nav a.btn-primary:hover { background: var(--teal-press); color: #fff; }
.nav .btn { margin-left: 8px; min-height: 40px; padding: 0 16px; font-size: .9375rem; }

/* 히어로 */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(64px, 8vw, 112px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(2.375rem, 1.4rem + 3.8vw, 4.25rem); line-height: 1.14; letter-spacing: -0.045em; font-weight: 800; }
.hero-lead { margin: 24px 0 0; font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); color: var(--sub); max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.hero-figure { margin: 0; position: relative; }
.hero-figure img { width: 100%; aspect-ratio: 4 / 5; max-height: 640px; object-fit: cover; border-radius: 28px; background: var(--porcelain); }
.hero-note {
  position: absolute; left: -24px; bottom: 32px; max-width: 260px;
  background: #fff; border-radius: var(--r-md); padding: 16px 18px;
  box-shadow: 0 2px 4px rgba(16,32,30,.06), 0 18px 40px -16px rgba(16,32,30,.28);
  font-size: .9375rem; line-height: 1.5; color: var(--text);
}
.hero-note strong { display: block; color: var(--ink); margin-bottom: 2px; }

/* 섹션 */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-soft { background: var(--porcelain); }
.section-title { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.625rem); line-height: 1.25; letter-spacing: -0.04em; }
.section-lead { margin: 14px 0 0; color: var(--sub); font-size: 1.125rem; max-width: 36em; }

/* 진료 항목 */
.proc-list { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 64px; }
.proc-list li { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); align-items: baseline; }
.proc-list li:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
.proc-list h3 { font-size: 1.125rem; letter-spacing: -0.03em; }
.proc-list p { margin: 0; color: var(--sub); font-size: .9375rem; }

/* 방문 순서 */
.visit-steps { list-style: none; margin: 56px 0 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 28px; }
.visit-steps li { counter-increment: step; position: relative; }
.visit-steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: var(--porcelain); color: var(--ink); font-weight: 700; font-size: .9375rem;
  position: relative; z-index: 1; margin-bottom: 22px; font-variant-numeric: tabular-nums;
}
.visit-steps li::after { content: ""; position: absolute; top: 17px; left: 44px; right: -20px; height: 1.5px; background: #CBD3CF; }
.visit-steps li:last-child::after { display: none; }
.visit-steps h3 { font-size: 1.125rem; margin-bottom: 6px; letter-spacing: -0.03em; }
.visit-steps p { color: var(--sub); font-size: .9375rem; margin: 0; }

/* 예약 마법사 */
.booking { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.booking > * { min-width: 0; }
.booking-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.booking-aside .section-lead { margin-bottom: 28px; }
.step-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step-nav li { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--sub); font-weight: 500; }
.step-nav li span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #C5CDC9; font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.step-nav li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.step-nav li[aria-current="step"] span { border-color: var(--teal); background: var(--teal); color: #fff; }
.step-nav li.done span { border-color: var(--teal); color: var(--teal); }
.privacy-note { margin-top: 28px; padding: 16px 18px; border-radius: var(--r-md); background: var(--warn-tint); color: var(--warn); font-size: .875rem; line-height: 1.55; }

.panel {
  background: #fff; border-radius: 28px; padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 1px 2px rgba(16,32,30,.04), 0 24px 48px -28px rgba(16,32,30,.25);
}
.panel h3 { font-size: 1.375rem; letter-spacing: -0.035em; margin-bottom: 6px; }
.panel .hint { color: var(--sub); font-size: .9375rem; margin-bottom: 24px; }
.step[hidden] { display: none; }

.field { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; font-size: .9375rem; color: var(--ink); margin-bottom: 8px; padding: 0; }
.optional { font-weight: 400; color: var(--sub); }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 1.5px solid transparent; border-radius: var(--r-md);
  background: var(--porcelain); color: var(--ink); font-size: 1.0625rem; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A6662' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: #87918D; }
.input:hover, .select:hover, .textarea:hover { background-color: var(--press); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--teal); background-color: #fff; box-shadow: 0 0 0 4px rgba(19,78,74,.14); }
[aria-invalid="true"] { border-color: var(--danger) !important; background-color: var(--danger-tint) !important; }
.field-error { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: .875rem; font-weight: 500; margin: 8px 0 0; }
.field-error[hidden] { display: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--porcelain); border: 1.5px solid transparent; font-weight: 500; font-size: .9375rem; color: var(--text);
  transition: all .18s var(--ease);
}
.chip:hover span { background: var(--press); }
.chip input:checked + span { background: var(--teal-tint); border-color: var(--teal); color: var(--teal-press); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

.dates { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.date-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; border-radius: var(--r-sm);
  border: 1.5px solid transparent; background: var(--porcelain); cursor: pointer; font-variant-numeric: tabular-nums;
}
.date-btn small { font-size: .75rem; color: var(--sub); }
.date-btn b { font-size: 1.0625rem; color: var(--ink); }
.date-btn:hover:not([disabled]) { background: var(--press); }
.date-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); }
.date-btn[aria-pressed="true"] small, .date-btn[aria-pressed="true"] b { color: #fff; }
.date-btn[disabled] { opacity: .38; cursor: not-allowed; }
.date-btn.sat small { color: #2457A6; }
.date-btn[aria-pressed="true"].sat small { color: #fff; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; min-height: 52px; }
.slot-btn {
  min-height: 46px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink);
}
.slot-btn:hover:not([disabled]) { border-color: var(--teal); }
.slot-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.slot-btn[disabled] { background: var(--porcelain); border-color: transparent; color: #A3ACA8; text-decoration: line-through; cursor: not-allowed; }
.slots-msg { grid-column: 1 / -1; color: var(--sub); font-size: .9375rem; padding: 12px 0; }

.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.step-actions .btn-primary { min-width: 160px; }

.summary { margin: 0 0 24px; border-top: 1px solid var(--line); }
.summary div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.summary dt { color: var(--sub); }
.summary dd { margin: 0; color: var(--ink); font-weight: 500; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .9375rem; line-height: 1.55; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.consent-box { background: var(--porcelain); border-radius: var(--r-md); padding: 16px 18px; font-size: .875rem; color: var(--sub); margin-bottom: 14px; line-height: 1.6; }
.consent-box ul { margin: 6px 0 0; padding-left: 18px; }

.form-alert { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--danger-tint); color: var(--danger); font-weight: 500; font-size: .9375rem; }
.form-alert[hidden] { display: none; }

.done-panel { text-align: center; padding: 24px 0 8px; }
.done-icon { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; background: var(--teal-tint); display: grid; place-items: center; }
.done-panel h3 { font-size: 1.625rem; margin-bottom: 10px; }
.done-panel p { color: var(--sub); }

/* 오시는 길 */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.visit-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 24px; background: var(--porcelain); }
.info-list { margin: 32px 0 0; }
.info-list div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.info-list div:last-child { border-bottom: 1px solid var(--line); }
.info-list dt { font-weight: 600; color: var(--ink); }
.info-list dd { margin: 0; }

.site-footer { border-top: 1px solid var(--line); padding: 40px 0 120px; color: var(--sub); font-size: .875rem; }
.site-footer p { margin: 0 0 4px; }

/* AI 상담 위젯 */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 80; display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff;
  font-weight: 600; cursor: pointer; box-shadow: 0 16px 32px -12px rgba(16,32,30,.5);
  transition: transform .15s var(--ease), background-color .2s;
}
.chat-fab:hover { background: #24322F; }
.chat-fab:active { transform: scale(.96); }
.chat-fab[aria-expanded="true"] { visibility: hidden; }
.chat-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 90; width: min(400px, calc(100% - 32px)); height: min(640px, calc(100dvh - 48px));
  display: flex; flex-direction: column; background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(16,32,30,.08), 0 40px 80px -24px rgba(16,32,30,.45);
  transform-origin: bottom right;
}
.chat-panel[hidden] { display: none; }
.chat-panel.is-open { animation: chatIn .32s var(--ease); }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 1.0625rem; letter-spacing: -0.02em; }
.chat-head p { margin: 2px 0 0; font-size: .8125rem; color: var(--sub); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--porcelain); color: var(--sub); cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--press); color: var(--ink); }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: .9375rem; line-height: 1.55; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--porcelain); color: var(--ink); border-bottom-left-radius: 6px; }
.msg.user { align-self: flex-end; background: var(--teal); color: #fff; border-bottom-right-radius: 6px; }
.msg.notice { align-self: stretch; max-width: none; background: var(--warn-tint); color: var(--warn); font-size: .875rem; border-radius: 12px; }
.msg.urgent { background: var(--danger-tint); color: var(--danger); font-weight: 500; }
.msg-actions { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 14px 16px; background: var(--porcelain); border-radius: 18px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #93A09B; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat-suggest { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chat-suggest button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .875rem; cursor: pointer; color: var(--text); }
.chat-suggest button:hover { border-color: var(--teal); color: var(--teal); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form .input { min-height: 48px; border-radius: 999px; padding: 10px 18px; font-size: 1rem; }
.chat-form .btn { min-height: 48px; border-radius: 999px; padding: 0 18px; }
.chat-foot { padding: 0 16px 12px; font-size: .75rem; color: var(--sub); text-align: center; }

/* 반응형 */
@media (max-width: 900px) {
  .hero-grid, .booking, .visit-grid { grid-template-columns: 1fr; }
  .hero-figure img { aspect-ratio: 4 / 3; }
  .hero-note { left: 16px; bottom: 16px; }
  .booking-aside { position: static; }
  .step-nav { grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 16px; }
  .step-nav li b { display: none; }
  .privacy-note { margin-top: 16px; }
  .proc-list { grid-template-columns: 1fr; }
  .proc-list li:nth-last-child(2) { border-bottom: 0; }
  .visit-steps { grid-template-columns: 1fr 1fr; gap: 32px 28px; }
  .visit-steps li:nth-child(2)::after { display: none; }
}
@media (max-width: 720px) {
  .nav a:not(.btn) { display: none; }
  .logo span { display: none; }
}
@media (max-width: 560px) {
  .container { width: calc(100% - 40px); }
  .proc-list li { grid-template-columns: 1fr; gap: 4px; }
  .visit-steps { grid-template-columns: 1fr; gap: 0; }
  .visit-steps li { display: grid; grid-template-columns: 36px 1fr; column-gap: 16px; padding-bottom: 28px; }
  .visit-steps li::before { grid-row: span 2; margin: 0; }
  .visit-steps li::after, .visit-steps li:nth-child(2)::after { display: block; top: 36px; bottom: 0; left: 17px; right: auto; width: 1.5px; height: auto; }
  .visit-steps li:last-child::after { display: none; }
  .row-2 { grid-template-columns: 1fr; }
  .dates { grid-template-columns: repeat(7, minmax(40px, 1fr)); overflow-x: auto; }
  .step-actions { flex-direction: column-reverse; }
  .step-actions .btn { width: 100%; }
  .chat-panel { right: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0; }
  .chat-fab { right: 16px; bottom: 16px; }
  .hero-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
