:root {
  --green: #0c9f22;
  --green-dark: #087a19;
  --ink: #161616;
  --muted: #676767;
  --rule: rgba(0, 0, 0, 0.3);
  --focus: #0a6fca;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Inter, Pretendard, "Noto Sans KR", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-header {
  height: 101px;
  background: #fff;
  position: relative;
  z-index: 5;
}

.header-inner {
  width: min(1118px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
}

.brand { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.main-nav { display: flex; align-items: center; gap: 42px; font-size: 22px; }
.main-nav a { position: relative; padding: 10px 0; }
.main-nav a.active { font-weight: 800; }
.main-nav a::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 50%; right: 50%; bottom: 2px;
  background: var(--green);
  transition: left .2s, right .2s;
}
.main-nav a:hover::after, .main-nav a:focus-visible::after { left: 0; right: 0; }
.account-nav { display: flex; gap: 30px; font-size: 15px; }

.page-shell {
  min-height: calc(100vh - 101px);
  padding: 61px max(24px, calc((100vw - 1239px) / 2)) 20px;
  background: linear-gradient(180deg, rgba(0,0,0,.14) 0, rgba(255,255,255,0) 20%);
}

.reservation-grid {
  width: min(1239px, 100%);
  min-height: 842px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 303px 551px 303px;
  gap: 41px;
}

.step { min-width: 0; padding: 10px; position: relative; }
.step + .step::before {
  content: "";
  position: absolute;
  left: -21px; top: 0; bottom: 56px;
  width: 3px;
  background: var(--rule);
}

.step-title {
  height: 47px;
  margin: 0 0 30px;
  padding: 10px;
  color: white;
  background: var(--green);
  font-size: 22px;
  line-height: 27px;
  font-weight: 800;
  white-space: nowrap;
}
.step-title span { margin-right: 6px; }

.calendar-card {
  width: 280px;
  height: 340px;
  padding: 18px 14px 14px;
  overflow: hidden;
  border-radius: 24px;
  background: white;
  box-shadow: 0 8px 30px rgba(0,0,0,.06);
}
.calendar-prompt { display: flex; align-items: center; gap: 7px; margin: 0 0 13px; font-size: 13px; font-weight: 700; }
.calendar-icon { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 2px; position: relative; }
.calendar-icon::before { content: ""; position: absolute; left: -2px; right: -2px; top: 2px; border-top: 2px solid currentColor; }
.calendar-toolbar { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; margin-bottom: 10px; text-align: center; }
.calendar-toolbar strong { font-size: 18px; }
.month-button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #999; font-size: 26px; cursor: pointer; }
.month-button:hover:not(:disabled) { color: var(--green); background: #eef8ef; }
.month-button:disabled { opacity: .25; cursor: not-allowed; }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekday-row { margin-bottom: 5px; color: #666; font-size: 10px; text-align: center; }
.calendar-grid { grid-template-rows: repeat(6, 34px); gap: 2px 0; }
.calendar-day { position: relative; width: 30px; height: 30px; justify-self: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #222; font-size: 11px; cursor: pointer; }
.calendar-day:nth-child(7n+1) { color: #ff4e52; }
.calendar-day.outside { color: #c9c9c9; }
.calendar-day:disabled { color: #d1d1d1; cursor: not-allowed; text-decoration: line-through; text-decoration-thickness: 1px; }
.calendar-day:not(:disabled):hover { background: #eef8ef; }
.calendar-day.selected { color: white; background: var(--green); font-weight: 700; }
.calendar-day.today::after { content: "오늘"; position: absolute; left: 0; right: 0; bottom: 1px; font-size: 6px; line-height: 1; }
.calendar-day:focus-visible, .month-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.time-range { width: 280px; margin: 22px 0 0; padding: 0; border: 0; }
.time-range legend { margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.time-selects { display: grid; grid-template-columns: 1fr 18px 1fr; align-items: end; gap: 5px; }
.time-selects label { display: grid; gap: 4px; color: #555; font-size: 9px; }
.time-selects select { width: 100%; height: 30px; padding: 0 7px; border: 1px solid #d9d9d9; border-radius: 999px; background: white; color: #111; font-size: 11px; }
.time-selects select:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.time-separator { padding-bottom: 7px; text-align: center; color: var(--green); }
.time-range p { margin: 7px 0 0; color: #777; font-size: 9px; text-align: center; }
.time-range .duration-warning {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #f2b6b6;
  border-radius: 7px;
  background: #fff4f4;
  color: #c52d2d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.room-layout { height: 472px; position: relative; }
.capacity-note {
  position: absolute; left: 7px; top: 130px;
  width: 121px; height: 202px;
  border: 1px solid #111; background: white;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; line-height: 22.5px; z-index: 3; white-space: nowrap;
}
.capacity-note strong { font-weight: 400; }
.floor-plan { position: absolute; left: 142px; top: 0; width: 384px; height: 462px; }
.floor-plan > img { position: absolute; pointer-events: none; }
.plan-lines { inset: 0; width: 100%; height: 100%; }
.plan-details { left: 11px; top: 12px; width: 204px; height: 140px; }
.plan-doors { left: 83px; top: 16px; width: 198px; height: 362px; }

.plan-zone, .plan-label {
  position: absolute; z-index: 2;
  border: 0; background: transparent;
  padding: 4px; font-size: 12px; line-height: 1.2; white-space: nowrap;
}
.plan-zone { cursor: pointer; border-radius: 4px; }
.plan-zone:hover, .plan-zone.active { color: white; background: var(--green); }
.room-a { left: 278px; top: 6px; }
.room-b { left: 278px; top: 53px; }
.room-c { left: 278px; top: 98px; }
.room-d { left: 278px; top: 152px; }
.room-e { left: 276px; top: 307px; }
.room-f { left: 236px; top: 399px; }
.room-g {
  left: 141px;
  top: 411.5px;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
}
.hall { left: 91px; top: 66px; }
.counter { left: 259px; top: 230px; }
.restroom {
  left: 50px;
  top: 335px;
  transform: translate(-50%, -50%);
  text-align: center;
}
.entrance { left: 19px; top: 205px; line-height: 13px; text-align: center; }

.booking-fields { border: 0; margin: 30px 13px 0; padding: 0; font-size: 10px; }
.booking-fields legend { padding: 0; margin-bottom: 4px; }
.radio-row, .checkbox-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.radio-row label, .checkbox-row label { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.checkbox-row label.option-disabled { color: #999; cursor: not-allowed; }
input[type="radio"], input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.field-label { display: block; margin-top: 6px; }
.booking-fields .option-warning {
  width: fit-content;
  margin: 6px 0 0;
  padding: 5px 7px;
  border-radius: 6px;
  background: #fff4f4;
  color: #c52d2d;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.35;
}
.booking-fields .native-attendees { display: none; }
.attendee-picker { position: relative; width: 100px; }
.attendee-trigger {
  position: relative;
  width: 100%;
  height: 26px;
  padding: 0 28px 0 7px;
  border: 1px solid #aaa;
  background: white;
  color: #111;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.attendee-trigger::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: rotate(45deg);
}
.attendee-trigger[aria-expanded="true"]::after { top: 10px; transform: rotate(225deg); }
.attendee-trigger:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.attendee-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 3px);
  left: 0;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #aaa;
  background: white;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .14);
}
.attendee-option {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0 7px;
  border: 0;
  background: white;
  color: #111;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.attendee-option:hover,
.attendee-option:focus-visible,
.attendee-option[aria-selected="true"] { background: #eef8ef; outline: none; }
.booking-fields textarea { display: block; width: 100%; height: 55px; margin-top: 10px; padding: 8px; resize: vertical; border: 1px solid #aaa; }

.summary-card { width: 100%; font-size: 12px; line-height: 1.6; }
.room-photo-frame { width: 283px; margin: 0 0 30px; overflow: hidden; }
.room-photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.room-photo-frame[data-room="스터디룸 E"] img,
.room-photo-frame[data-room="스터디룸 F"] img,
.room-photo-frame[data-room="홀 이용"] img { object-position: center bottom; }
.summary-card p { margin: 0; }
.summary-card label { display: block; margin-top: 2px; }
.summary-card input { width: 100%; height: 27px; border: 1px solid #999; padding: 3px 8px; }
.summary-card hr { border: 0; border-top: 1px solid #eee; margin: 10px 0; }
.summary-card .price { margin-top: 6px; font-size: 16px; }

.reserve-button { display: block; width: 235px; height: 70px; margin: 30px auto 0; padding: 0; border: 0; background: none; cursor: pointer; }
.reserve-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reserve-button:hover { filter: brightness(.92); transform: translateY(-1px); }
.reserve-button:active { transform: translateY(1px); }
.reserve-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.reservation-contact { margin: 7px 0 0; color: #777; font-size: 11px; line-height: 1.4; text-align: center; }
.form-status { min-height: 22px; text-align: center; font-size: 13px; font-weight: 700; color: var(--green-dark); }
.form-status.error { color: #c52d2d; }

.success-page { min-height: calc(100vh - 101px); background: #fff; }
.success-content { width: min(640px, calc(100% - 48px)); margin: 0 auto; padding: 90px 0 70px; }
.success-content h2 { margin: 0 0 48px; color: #050505; font-size: 40px; line-height: 1.3; font-weight: 900; letter-spacing: -.04em; }
.success-content h3 { margin: 0 0 34px; color: #050505; font-size: 28px; line-height: 1.35; font-weight: 900; letter-spacing: -.035em; }
.confirmation-form { margin-top: 30px; }
.reservation-editor { padding: 26px 28px; border: 1px solid #dedede; border-radius: 12px; background: #fafafa; }
.reservation-editor h4 { margin: 0 0 20px; color: var(--green-dark); font-size: 21px; }
.confirmation-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 18px; min-height: 54px; border-top: 1px solid #e5e5e5; }
.confirmation-field label,
.confirmation-label,
.confirmation-options legend { color: #555; font-size: 14px; font-weight: 800; }
.confirmation-field input,
.confirmation-field select,
.confirmation-time-row select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #c9c9c9;
  border-radius: 7px;
  background: white;
  color: #111;
}
.confirmation-field input:focus,
.confirmation-field select:focus,
.confirmation-time-row select:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.confirmation-time-row { display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; text-align: center; }
.confirmation-room { font-size: 15px; }
.confirmation-options { display: grid; grid-template-columns: 110px auto auto; align-items: center; gap: 18px; min-height: 58px; margin: 0; padding: 0; border: 0; border-top: 1px solid #e5e5e5; }
.confirmation-options legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.confirmation-options::before { content: "추가 옵션"; color: #555; font-size: 14px; font-weight: 800; }
.confirmation-options label { display: flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.confirmation-options input { width: 17px; height: 17px; }
.confirmation-options small { grid-column: 2 / -1; margin: -14px 0 8px; color: #c52d2d; font-weight: 700; }
.payment-information { margin-top: 32px; padding: 22px 25px; border-radius: 10px; background: #f7f7f7; }
.payment-information p { margin: 3px 0; color: #171717; font-size: 20px; line-height: 1.45; }
.payment-information strong { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.payment-information .payment-price { margin-top: 12px; font-weight: 800; }
.payment-complete-button { display: block; width: 100%; min-height: 68px; margin-top: 28px; border: 0; border-radius: 10px; background: var(--green); color: white; font-size: 22px; font-weight: 900; cursor: pointer; box-shadow: 0 7px 16px rgba(12, 159, 34, .22); }
.payment-complete-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.payment-complete-button:active { transform: translateY(1px); }
.payment-complete-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.payment-complete-button:disabled { background: #6aaf74; cursor: wait; transform: none; box-shadow: none; }
.confirmation-message { min-height: 24px; margin-top: 14px; color: #c52d2d; font-size: 16px; font-weight: 700; text-align: center; }
.confirmation-message.success { color: var(--green-dark); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .site-header { height: auto; }
  .header-inner { min-height: 88px; grid-template-columns: 1fr auto; }
  .brand { font-size: 26px; }
  .main-nav { order: 3; grid-column: 1 / -1; justify-content: center; padding-bottom: 14px; font-size: 17px; gap: 28px; }
  .account-nav { font-size: 13px; }
  .page-shell { padding-top: 38px; }
  .reservation-grid { grid-template-columns: minmax(280px, 1fr) minmax(470px, 1.7fr); gap: 32px; }
  .step-three { grid-column: 1 / -1; width: min(560px, 100%); justify-self: center; }
  .step-three::before { display: none; }
}

@media (max-width: 760px) {
  .header-inner { width: min(100% - 28px, 620px); }
  .account-nav { gap: 15px; }
  .main-nav { overflow-x: auto; justify-content: flex-start; }
  .page-shell { padding: 28px 16px; }
  .reservation-grid { display: block; }
  .step { width: min(551px, 100%); margin: 0 auto 28px; padding: 0; }
  .step + .step::before { display: none; }
  .calendar-card, .time-range { margin-left: auto; margin-right: auto; }
  .room-layout { transform-origin: top left; }
}

@media (max-width: 570px) {
  .brand { font-size: 22px; }
  .account-nav { font-size: 11px; }
  .main-nav { gap: 22px; font-size: 15px; }
  .step-title { font-size: 19px; }
  .step-two { overflow: hidden; }
  .room-layout { width: 531px; transform: scale(calc((100vw - 32px) / 531)); margin-bottom: calc(-472px + (472px * ((100vw - 32px) / 531))); }
  .booking-fields { margin-left: 0; margin-right: 0; font-size: 12px; }
  .success-content { width: min(100% - 32px, 640px); padding-top: 55px; }
  .success-content h2 { margin-bottom: 30px; font-size: 30px; }
  .success-content h3 { font-size: 22px; }
  .reservation-editor { padding: 20px 16px; }
  .confirmation-field { grid-template-columns: 82px 1fr; gap: 10px; }
  .confirmation-options { grid-template-columns: 82px 1fr; gap: 8px 10px; padding: 12px 0; }
  .confirmation-options label { grid-column: 2; }
  .confirmation-options small { grid-column: 2; margin: 0; }
  .payment-information p { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
