/* booking-app LIFF予約ページ — 正本: ../DESIGN.md */

:root {
  --bg: #f6f5f9;
  --surface: #ffffff;
  --text: #2b2933;
  --muted: #736e80;
  --line: #e4e1ea;
  --primary: #544a86;
  --primary-dark: #423a6b;
  --primary-soft: #edeaf6;
  --danger: #b3423f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* ---- ヘッダー・ステップ表示 ---- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.steps {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  padding: 2px 8px;
}

.step.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ---- 共通部品 ---- */

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin: 16px 0 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card.soft {
  background: var(--primary-soft);
  border-color: var(--primary-soft);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}

.loading-text {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

.btn {
  display: block;
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 12px 16px;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:active { background: var(--primary-dark); }

.btn.primary:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  margin-top: 12px;
}

.btn.text {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  margin-top: 8px;
}

/* ---- メニュー選択 ---- */

.menu-list { display: flex; flex-direction: column; gap: 12px; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.menu-item .minutes {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ---- 日時選択 ---- */

.selected-summary {
  font-size: 14px;
  color: var(--primary);
  padding: 10px 16px;
}

/* 直近の空きチップ */

.quick-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 6px;
}

.quick-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
  padding-bottom: 2px;
}

.quick-chip {
  flex-shrink: 0;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  cursor: pointer;
}

/* 月カレンダー */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 8px;
}

.cal-title { font-size: 15px; font-weight: 700; }

.cal-nav {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}

.cal-nav:disabled { color: var(--line); cursor: default; }

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 2px 0;
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.cal-day .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

/* 過去・受付範囲外: 枠なしの薄い数字 */
.cal-day.past {
  background: transparent;
  border-color: transparent;
  color: #b9b4c6;
  font-weight: 400;
  cursor: default;
}

/* 満席: 数字のみ・押せない（×や赤は使わない） */
.cal-day.full {
  background: var(--bg);
  border-color: transparent;
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}

/* 定休日・休業日: 「休」を小さく添える */
.cal-day.closed {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}

.cal-day.closed .closed-mark { font-size: 9px; line-height: 1; }

.cal-day.today { border-color: var(--primary); }

.cal-day.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cal-day.selected .dot { background: #fff; }

.cal-day.blank {
  visibility: hidden;
}

.cal-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}

.legend-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: 2px;
  margin-right: 3px;
}

.cal-range {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 16px;
}

/* 選択日の時間一覧 */

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.time-chip {
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}

.time-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px 0 8px;
}

/* ---- 確認・入力 ---- */

.confirm-list {
  display: grid;
  grid-template-columns: 5em 1fr;
  gap: 4px 8px;
  margin: 0;
}

.confirm-list dt {
  font-size: 13px;
  color: var(--muted);
}

.confirm-list dd {
  margin: 0;
  font-weight: 600;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}

.field textarea { resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 0;
}

/* ---- 下部固定CTA ---- */

.cta-spacer { height: 72px; }

.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.cta-bar .btn { max-width: 448px; margin: 0 auto; }

/* ---- 完了 ---- */

.done-card { text-align: center; }

.done-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 12px;
}

.done-card .confirm-list {
  text-align: left;
  margin: 0 auto;
  max-width: 260px;
}
