/* 글로스터호텔 킨텍스 행사코드 예약 — hotel-booking 디자인 시스템 기반 */
:root {
  --ink: #171717;
  --brown: #231815;
  --gold: #C2984E;
  --bg: #f7f8f9;
  --card: #ffffff;
  --line: #ececee;
  --muted: #8b8f94;
  --green: #16a34a;
  --green-bg: #e7f6ec;
  --red: #dc2626;
  --red-bg: #fdecea;
  --amber: #a16207;
  --amber-bg: #fdf3d7;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px -1px rgba(0,0,0,.07);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- 시작(코드 입력)/로그인 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
  background: #fff url('img/login_bg.webp') center/cover no-repeat;
}
.login-card {
  background: var(--card);
  border-radius: 24px;
  padding: 48px 36px;
  width: 100%; max-width: 440px;
  box-shadow: 0 10px 40px rgba(35, 24, 21, .18);
  text-align: center;
}
.login-logo { width: 120px; margin: 0 auto 18px; display: block; }
.login-card h1 { font-size: 28px; color: var(--brown); font-weight: 700; letter-spacing: -0.5px; }
.login-sub { color: var(--muted); font-size: 14px; margin: 12px 0 32px; line-height: 1.7; }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 14px; margin-bottom: 18px; font-weight: 600; color: var(--ink); }
.login-card input {
  width: 100%; margin-top: 8px; padding: 14px 16px;
  border: 1px solid var(--gold); border-radius: 12px; font-size: 16px;
  background: #fdfcfa; outline: none;
}
.login-card input:focus { border-width: 2px; padding: 13px 15px; }
.login-card .btn-block { margin-top: 6px; }
.login-help { margin-top: 22px; font-size: 13px; color: var(--muted); }
.login-help a { color: var(--muted); }
.login-copy { margin-top: 26px; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
#code-input { text-transform: uppercase; letter-spacing: 2px; font-weight: 700; text-align: center; }

/* ---------- 공통 요소 ---------- */
.btn {
  border: none; border-radius: 12px; padding: 13px 22px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: #f0f0f2; color: var(--ink);
  transition: filter .15s;
  font-family: inherit;
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--brown); color: var(--gold); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; padding: 15px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { width: 100%; resize: vertical; margin-top: 8px; }

.error-msg { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; text-align: center; white-space: pre-line; }
.error-msg.ok { color: var(--green); }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0; line-height: 1.7; }
code { background: #f0f0f2; padding: 2px 7px; border-radius: 6px; font-size: 12px; }

/* ---------- 레이아웃 ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px 80px; }
/* 관리자 화면은 창 너비를 그대로 사용 (예약 현황 표를 한눈에) */
#view-admin .container { max-width: none; }
h3 { font-size: 14px; margin: 4px 0 14px; font-weight: 700; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.page-head {
  display: flex; align-items: center; justify-content: center;
  position: relative; height: 58px;
  margin: 0 -20px 20px; padding: 0 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.page-title { font-size: 16px; font-weight: 700; }
.back-btn {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 8px;
  color: var(--ink); font-size: 20px;
}

/* ---------- 폼 배치 ---------- */
.form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- 행사 헤더 ---------- */
.event-head-card { border-top: 4px solid var(--gold); text-align: center; padding: 32px 24px; }
.event-code-badge {
  display: inline-block; background: var(--brown); color: var(--gold);
  font-weight: 700; letter-spacing: 2px; font-size: 13px;
  padding: 4px 14px; border-radius: 999px; margin-bottom: 14px;
}
.event-head-card h2 {
  font-size: 30px; color: var(--brown); font-weight: 800;
  letter-spacing: -0.5px; line-height: 1.35;
}
.event-desc { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
@media (max-width: 640px) { .event-head-card h2 { font-size: 24px; } }

/* ---------- 날짜 선택 캘린더 ---------- */
.cal-month { margin: 16px 0 6px; }
.cal-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--brown); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.cal-wd:first-child { color: var(--red); }
.cal-wd:last-child { color: #2563eb; }
.cal-day {
  min-height: 48px; border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; background: #fff; font-size: 14px; font-weight: 600;
  transition: background .1s, border-color .1s;
  user-select: none;
}
.cal-day:hover:not(.disabled):not(.empty) { border-color: var(--gold); }
.cal-day.empty { border: none; background: transparent; cursor: default; }
.cal-day.disabled { background: #f3f3f5; color: #c6c8cc; cursor: default; }
.cal-day.sun .cal-num { color: var(--red); }
.cal-day.sat .cal-num { color: #2563eb; }
.cal-day.disabled .cal-num { color: #c6c8cc; }
.cal-day.in-range { background: #f6efe1; border-color: #e5d3ab; }
.cal-day.sel-start, .cal-day.sel-end {
  background: var(--brown); border-color: var(--brown);
}
.cal-day.sel-start .cal-num, .cal-day.sel-end .cal-num { color: var(--gold); }
.cal-day.sel-start .cal-sub, .cal-day.sel-end .cal-sub { color: var(--gold); }
.cal-sub { font-size: 10px; line-height: 1.2; color: var(--red); font-weight: 700; }
.cal-day .cal-sub:empty { display: none; }
.cal-summary { font-size: 15px; font-weight: 700; color: var(--brown); margin: 12px 0 4px; }
@media (max-width: 640px) {
  .cal-day { min-height: 42px; font-size: 13px; border-radius: 8px; }
}

/* ---------- 객실 선택 카드 ---------- */
.room-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.room-opt:hover { border-color: var(--gold); }
.room-opt.selected { border-color: var(--gold); background: #fdfaf4; }
.room-opt.soldout { opacity: .55; cursor: not-allowed; }
.room-opt .r-name { font-weight: 700; font-size: 15px; }
.room-opt .r-desc { font-size: 13px; color: var(--muted); }
.room-opt .r-price { font-weight: 700; text-align: right; white-space: nowrap; }
.room-opt .r-remain { font-size: 12px; color: var(--muted); text-align: right; }
.room-opt .r-remain.low { color: var(--red); font-weight: 700; }
.total-line { font-size: 17px; font-weight: 700; margin-top: 14px; text-align: right; color: var(--brown); }

/* ---------- 예약 완료 ---------- */
.done-check {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--green-bg); color: var(--green);
  font-size: 34px; line-height: 64px; text-align: center;
}
.done-box {
  background: #faf8f4; border: 1px solid var(--gold); border-radius: 14px;
  padding: 18px; text-align: left; font-size: 14px;
}
.done-box .ref { font-size: 22px; font-weight: 700; color: var(--brown); letter-spacing: 1px; text-align: center; margin-bottom: 12px; }
.done-box dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.done-box dt { color: var(--muted); }
.done-box dd { font-weight: 600; }

/* ---------- 탭 ---------- */
.tabbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted);
  font-family: inherit;
}
.tab.active { background: var(--brown); color: var(--gold); border-color: var(--brown); }

/* ---------- 테이블 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl th { color: var(--muted); font-weight: 600; background: #fafafa; position: sticky; top: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; }

/* ---------- 상태 배지 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.off { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.code { background: var(--brown); color: var(--gold); letter-spacing: 1px; }

/* ---------- 행사 목록 카드 ---------- */
.event-item { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; }
.event-item .e-main { flex: 1; min-width: 240px; }
.event-item .e-name { font-size: 17px; font-weight: 700; margin: 6px 0 2px; }
.event-item .e-meta { font-size: 13px; color: var(--muted); }
.event-item .e-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 모달 ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 16px; overflow-y: auto;
}
.modal {
  background: var(--bg); border-radius: 18px; padding: 20px;
  width: 100%; max-width: 860px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 16px; }

/* ---------- 가용 달력(게스트) ---------- */
.avail-mini { margin-top: 14px; }
.avail-mini caption { text-align: left; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.avail-mini td.soldout { color: var(--red); font-weight: 700; }

/* ---------- 관리자 배정 캘린더 ---------- */
.al-monthnav { display: flex; align-items: center; gap: 10px; }
.al-monthnav b { font-size: 15px; min-width: 90px; text-align: center; }
.al-cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin: 14px 0 6px;
}
.al-wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.al-wd.sun { color: var(--red); }
.al-wd.sat { color: #2563eb; }
.al-cell {
  min-height: 66px; border: 1px solid var(--line); border-radius: 10px;
  padding: 5px 6px; cursor: pointer; background: #f7f7f9;
  font-size: 12px; line-height: 1.35; user-select: none;
  transition: border-color .1s, box-shadow .1s;
}
.al-cell:hover:not(.empty):not(.al-past) { border-color: var(--gold); }
.al-cell.empty { border: none; background: transparent; cursor: default; }
.al-cell.al-has { background: #fff; }
.al-cell.al-full { background: var(--red-bg); }
.al-cell.al-past { opacity: .45; cursor: default; }
.al-cell.al-sel { border: 2px solid var(--brown); box-shadow: 0 0 0 1px var(--brown); padding: 4px 5px; }
.al-day { font-weight: 700; font-size: 13px; }
.al-day.sun { color: var(--red); }
.al-day.sat { color: #2563eb; }
.al-price { color: var(--brown); font-weight: 700; }
.al-count { color: var(--muted); }
.al-count small { font-size: 10px; }
.al-tag { color: var(--red); font-weight: 700; font-size: 11px; }
.al-bf { color: var(--amber); font-size: 11px; font-weight: 600; }
.al-none { color: #c6c8cc; }
.al-applyrow { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .al-cell { min-height: 58px; font-size: 10px; padding: 4px; }
  .al-day { font-size: 12px; }
}

.admin-head { justify-content: flex-start; }
@media (max-width: 640px) {
  .card { padding: 18px; }
  .login-card { padding: 36px 24px; }
}
