/* ==========================================================================
   선재낚시공원 · 온라인 입어 (손님 화면)
   밝은 바탕 · 바다색 한 가지 · 선과 표로 정리한다 (2026-10-19 다시 그림)
   그라데이션·빛 번짐·이모지·움직이는 장식은 쓰지 않는다. 색은 :root 토큰으로만.
   ========================================================================== */

:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --line: #e3e7eb;
  --line-2: #cdd3d9;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #8b95a1;

  --brand: #0a70c4;          /* 주 행동 — 로고 하늘색(#0f92f3)을 흰 글자가 읽히게 한 단계 짙게 */
  --brand-dark: #085a9e;
  --brand-weak: #e8f2fb;
  --brand-ink: #ffffff;
  --logo-blue: #0f92f3;      /* 로고 SUNJE 글자색 */

  /* 방 상태 (글자 · 바탕 · 테두리) */
  --free: #12733f;  --free-bg: #e8f5ee;  --free-bd: #9fd3b4;
  --soon: #9a5b00;  --soon-bg: #fff5e3;  --soon-bd: #edc988;
  --over: #b42318;  --over-bg: #fdeceb;  --over-bd: #f0b0aa;
  --busy: #6b7684;  --busy-bg: #f2f4f6;  --busy-bd: #dde1e6;
  --resv: #4b4f96;  --resv-bg: #efeff9;  --resv-bd: #c8caec;

  --ok: #12733f;
  --warn: #9a5b00;
  --err: #b42318;

  --radius: 8px;
  --radius-s: 6px;
  --gutter: 16px;
  --maxw: 560px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font-family: inherit; }
a { color: var(--brand); }
img { max-width: 100%; }

/* ── 뼈대 ─────────────────────────────────────────────────────────────── */
.topbar-wrap { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 var(--gutter);
  max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; padding-left: 10px; border-left: 1px solid var(--line); }
.brand-text b { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.top-actions { display: flex; gap: 8px; }
.chip-btn {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  height: 32px; padding: 0 11px; border-radius: var(--radius-s); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip-btn:hover { border-color: var(--text-3); color: var(--text); }

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 120px; }

/* ── 글자 ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; }
.h-xl { font-size: 23px; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; }
.h-l { font-size: 19px; line-height: 1.35; font-weight: 700; letter-spacing: -.015em; }
.h-m { font-size: 16px; font-weight: 700; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.page-head { padding: 20px 0 4px; }
.page-head .faint { margin-bottom: 2px; }

/* ── 상자 ─────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 10px; }
.card.tight { padding: 4px 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ── 첫 화면 ──────────────────────────────────────────────────────────── */
.intro { padding: 22px 0 16px; text-align: center; }
.intro-logo { display: block; width: 216px; max-width: 64%; height: auto; margin: 0 auto 14px; }
.intro .date-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.intro p { margin: 6px auto 0; color: var(--text-2); font-size: 14.5px; max-width: 30em; }
.status { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; }
.status .stat { padding: 14px 12px; text-align: center; }
.status .stat + .stat { border-left: 1px solid var(--line); }
.status .stat b { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; }
.status .stat span { font-size: 12.5px; color: var(--text-2); }
.status .stat.free b { color: var(--free); }
.status-note { font-size: 12px; color: var(--text-3); margin: 6px 2px 0; text-align: right; }

/* ── 큰 선택 줄 (지금 입어 / 끝나는 방 예약 / 내 입어) ───────────────── */
.menu { margin-top: 14px; }
.choice {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  padding: 16px; border: 0; border-radius: 0; background: var(--surface); color: var(--text); cursor: pointer;
  font: inherit;
}
.choice + .choice { border-top: 1px solid var(--line); }
.choice:hover { background: #f8f9fa; }
.choice b { display: block; font-size: 16px; font-weight: 700; }
.choice span span, .choice .sub { display: block; font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.choice .arrow { margin-left: auto; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-top: 2px solid var(--text-3); transform: rotate(45deg); }
.choice[disabled] { opacity: .45; pointer-events: none; }
.choice.primary { background: var(--brand); color: var(--brand-ink); }
.choice.primary:hover { background: var(--brand-dark); }
.choice.primary span span { color: rgba(255, 255, 255, .82); }
.choice.primary .arrow { border-color: rgba(255, 255, 255, .85); }
.choice.boxed { border: 1px solid var(--line); border-radius: var(--radius); }
.choice.boxed + .choice.boxed { border-top: 1px solid var(--line); margin-top: 8px; }

/* ── 버튼 ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--brand); cursor: pointer;
  font-size: 16px; font-weight: 700;
  color: var(--brand-ink); background: var(--brand);
  width: 100%;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:disabled { background: #c5ccd3; border-color: #c5ccd3; color: #fff; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--text-3); }
.btn.sea { background: var(--free); border-color: var(--free); }
.btn.sea:hover { background: #0e5c32; border-color: #0e5c32; }
.btn.small { height: 38px; font-size: 14px; width: auto; padding: 0 14px; }
.btn.danger { background: var(--surface); color: var(--err); border-color: #e8a9a3; }
.btn.danger:hover { background: var(--over-bg); }
.link-btn { background: none; border: 0; color: var(--text-2); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 6px 0; }

/* 화면 아래 고정 줄 */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.dock-inner { max-width: var(--maxw); margin: 0 auto; }
.dock .sum { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; }
.dock .sum b { font-size: 20px; font-weight: 700; }

/* ── 입력 ─────────────────────────────────────────────────────────────── */
.field { display: block; }
.field label { display: block; font-size: 13.5px; color: var(--text-2); margin: 0 0 6px; font-weight: 600; }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-size: 17px; outline: none;
}
.input::placeholder { color: #b0b8c1; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 112, 196, .14); }
.otp { text-align: center; font-size: 22px; letter-spacing: .35em; padding-left: .35em; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 1px 0 0; flex: none; }
.check span { font-size: 14.5px; line-height: 1.45; }

/* ── 진행 단계 (방 선택 › 인원 › 본인 확인 › 결제) ───────────────────── */
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 4px 0 14px; font-size: 12.5px; color: var(--text-3); }
.steps .on { color: var(--brand); font-weight: 700; }
.steps .done { color: var(--text-2); }
.steps .sep { color: #c5ccd3; }

/* ── 구역 탭 ──────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; height: 44px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
  background: transparent; color: var(--text-3); font-weight: 600; font-size: 15px;
}
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.tab small { font-weight: 500; color: var(--text-3); margin-left: 4px; }

/* ── 범례 ─────────────────────────────────────────────────────────────── */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0, 0, 0, .12); }

/* ── 방 칸 ────────────────────────────────────────────────────────────── */
.rooms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (min-width: 420px) { .rooms { grid-template-columns: repeat(6, 1fr); } }
.rooms.duplex { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.room {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-s); cursor: pointer;
  border: 1px solid var(--busy-bd); background: var(--busy-bg); color: var(--busy);
  padding: 4px 2px; text-align: center; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  -webkit-tap-highlight-color: transparent;
}
.rooms.duplex .room { aspect-ratio: 2.2 / 1; }
.room b { font-size: 16px; font-weight: 700; line-height: 1.1; color: var(--text); }
.room small { font-size: 10.5px; font-weight: 600; line-height: 1.1; }
.room.free { background: var(--free-bg); border-color: var(--free-bd); color: var(--free); }
.room.soon { background: var(--soon-bg); border-color: var(--soon-bd); color: var(--soon); }
.room.over { background: var(--over-bg); border-color: var(--over-bd); color: var(--over); }
.room.busy { background: var(--busy-bg); border-color: var(--busy-bd); color: var(--busy); }
.room.busy b { color: var(--text-3); }
.room.resv, .room.hold, .room.kiosk { background: var(--resv-bg); border-color: var(--resv-bd); color: var(--resv); cursor: not-allowed; }
.room.off { opacity: .3; pointer-events: none; }
.room.sel { outline: 2px solid var(--brand); outline-offset: 1px; }
.room .star { position: absolute; top: 3px; right: 4px; font-size: 9px; color: var(--soon); }

/* ── 이용권 · 인원 ────────────────────────────────────────────────────── */
.item-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.item-row + .item-row { border-top: 1px solid var(--line); }
.item-row .nm b { display: block; font-size: 15.5px; font-weight: 600; }
.item-row .nm span { font-size: 13px; color: var(--text-2); }
.stepper { display: flex; align-items: center; margin-left: auto; border: 1px solid var(--line-2); border-radius: var(--radius-s); overflow: hidden; }
.stepper button {
  width: 38px; height: 36px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); font-size: 19px; line-height: 1;
}
.stepper button:hover { background: #f2f4f6; }
.stepper button:disabled { color: #c5ccd3; cursor: default; background: var(--surface); }
.stepper output { min-width: 34px; height: 36px; line-height: 36px; text-align: center; font-size: 16px; font-weight: 700;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 76px; padding: 8px 6px; border-radius: var(--radius-s); cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 700; font-size: 15px; line-height: 1.3;
}
.seg button small { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.seg button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); box-shadow: inset 0 0 0 1px var(--brand); }
.seg button.on small { color: var(--brand); }
.seg button:disabled { opacity: .4; }

/* ── 금액표 ───────────────────────────────────────────────────────────── */
.bill { font-size: 14.5px; }
.bill .ln { display: flex; justify-content: space-between; padding: 6px 0; gap: 12px; }
.bill .ln span:first-child { color: var(--text-2); }
.bill .ln span:last-child { text-align: right; }
.bill .ln.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 11px; font-size: 17px; font-weight: 700; }
.bill .ln.total span:first-child { color: var(--text); }

/* ── 표시 글자 ────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; background: #eef0f3; color: var(--text-2); }
.badge.we { background: var(--soon-bg); color: var(--soon); }
.badge.wd { background: var(--brand-weak); color: var(--brand); }
.badge.hol { background: var(--over-bg); color: var(--over); }
.badge.ok { background: var(--free-bg); color: var(--free); }
.badge.warn { background: var(--soon-bg); color: var(--soon); }

/* ── 안내 상자 ────────────────────────────────────────────────────────── */
.note { border-radius: var(--radius-s); padding: 11px 13px; font-size: 13.5px; line-height: 1.55; background: #fff8e6; border: 1px solid #f1dca5; color: #6b4a00; }
.note.info { background: var(--brand-weak); border-color: #c2dcf3; color: #0b4a80; }
.note.err { background: var(--over-bg); border-color: var(--over-bd); color: #8a1c13; }
.rules-list { padding-left: 18px; margin: 6px 0 0; line-height: 1.7; color: var(--text-2); font-size: 14px; }

/* ── 입어권 · QR ──────────────────────────────────────────────────────── */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); overflow: hidden; }
.ticket .top { padding: 16px 18px 14px; border-bottom: 1px dashed var(--line-2); }
.ticket .top .label { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--free); margin-bottom: 2px; }
.ticket .top b { display: block; font-size: 21px; font-weight: 700; }
.ticket .body { padding: 14px 18px 16px; }
.ticket .kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 14.5px; }
.ticket .kv span { color: var(--text-2); }
.ticket .kv b { text-align: right; font-weight: 600; }
.ticket .cut { border-top: 1px dashed var(--line-2); margin: 14px -18px 0; }
.ticket .qr { display: flex; flex-direction: column; align-items: center; padding: 14px 0 2px; }
.ticket .qr svg, .ticket .qr img { width: 200px; height: 200px; display: block; }
.ticket .qr .code { margin-top: 6px; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mini-qr { display: flex; flex-direction: column; align-items: center; margin-top: 10px; }
.mini-qr svg { width: 168px; height: 168px; display: block; border: 1px solid var(--line); border-radius: 4px; }
.key-line { font-size: 15.5px; font-weight: 700; margin: 0 0 4px; }

/* ── 진행 중 표시 ─────────────────────────────────────────────────────── */
.status-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand); animation: rot .9s linear infinite; flex: none; }
.state-line { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.state-line:last-child { border-bottom: 0; }
.state-line span { color: var(--text-2); }

/* ── 아래에서 올라오는 창 ─────────────────────────────────────────────── */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-width: var(--maxw); margin: 0 auto; max-height: 86vh; overflow: auto;
  background: var(--surface); border-radius: 14px 14px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
}
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 4px auto 14px; }
.sheet pre, .sheet .prose { white-space: pre-wrap; font-family: inherit; font-size: 13.5px; line-height: 1.65; color: var(--text-2); margin: 0; }

/* ── 알림 줄 ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  width: max-content; max-width: calc(100% - 32px); padding: 11px 15px; border-radius: var(--radius);
  background: #2b3138; color: #fff; font-weight: 500; font-size: 14px;
}
.toast.err { background: var(--err); }

/* ── 불러오는 중 ──────────────────────────────────────────────────────── */
.skel { border-radius: var(--radius); background: #e9ecef; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ── 사업자 정보 ──────────────────────────────────────────────────────── */
.foot { max-width: var(--maxw); margin: 32px auto 0; padding: 18px var(--gutter) 140px; font-size: 12px; line-height: 1.75; color: var(--text-3); border-top: 1px solid var(--line); }
.foot b { color: var(--text-2); }
.foot a { color: var(--text-2); }

.fade-in { }
.center { text-align: center; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

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