/* ── 設計 token（A 清晰俐落 · 藍色信任系）— 1:1 取自設計原型 ───────── */
:root {
  --bg: oklch(0.984 0.005 250);
  --surface: #ffffff;
  --surface2: oklch(0.975 0.006 250);
  --sb-bg: oklch(0.971 0.008 250);
  --sb-fg: oklch(0.24 0.02 258);
  --sb-muted: oklch(0.52 0.018 258);
  --sb-line: oklch(0.88 0.01 250);
  --text: oklch(0.24 0.02 258);
  --muted: oklch(0.54 0.018 258);
  --border: oklch(0.91 0.008 250);
  --border2: oklch(0.84 0.01 250);
  --primary: oklch(0.55 0.16 256);
  --primary-h: oklch(0.49 0.16 256);
  --primary-fg: #ffffff;
  --primary-soft: oklch(0.955 0.03 256);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 14px 36px -18px rgba(20, 35, 75, .18);
  --booked-bg: oklch(0.955 0.004 258);
  --booked-fg: oklch(0.72 0.012 258);
  --pad: 32px;
  --danger: oklch(0.6 0.19 25);
}

* { box-sizing: border-box; }
body { margin: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }

.page {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding: 34px 24px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.card {
  width: 100%;
  max-width: 1060px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.scrl::-webkit-scrollbar { width: 8px; }
.scrl::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ── 版面：左側欄 + 右側流程 ─────────────────────────────────── */
.booking { display: grid; grid-template-columns: 372px 1fr; }

.aside {
  background: var(--sb-bg);
  border-right: 1px solid var(--border);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand b {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 21px;
  color: var(--sb-fg); letter-spacing: -.01em;
}
.brand span { font-size: 13px; color: var(--sb-muted); font-weight: 500; letter-spacing: .02em; }

/* 摘要 */
.summary { display: flex; flex-direction: column; gap: 13px; }
.sum-head { display: flex; align-items: center; gap: 12px; }
.sum-badge {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sum-badge b { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; line-height: 1; }
.sum-badge span { font-size: 8px; font-weight: 600; }
.sum-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sum-title {
  font-size: 14.5px; font-weight: 700; color: var(--sb-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sum-sub { font-size: 12px; color: var(--sb-muted); }
.sum-row { display: flex; align-items: center; gap: 10px; }
.sum-row .ic { width: 17px; display: flex; justify-content: center; color: var(--primary); flex: 0 0 auto; }
.sum-row span { font-size: 13.5px; font-weight: 600; color: var(--sb-fg); white-space: nowrap; }
.sum-empty { font-size: 13px; color: var(--sb-muted); }

.divider { height: 1px; background: var(--sb-line); }
.divider-r { height: 1px; background: var(--border); }

/* 表單 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-title { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.req { color: var(--primary); }
.optional { color: var(--muted); font-weight: 500; }
.row2 { display: flex; gap: 10px; }
.row2 .field { flex: 1; min-width: 0; }

.input, .textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field-err { font-size: 11.5px; color: var(--danger); font-weight: 500; }

.err-box {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: oklch(0.96 0.05 25); color: oklch(0.5 0.18 25);
  font-size: 12.5px; font-weight: 600;
}

/* 檔案上傳 */
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 18px 12px; border: 1.5px dashed var(--border2); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s;
}
.upload:hover, .upload.drag { border-color: var(--primary); background: var(--primary-soft); }
.upload .u-ic { color: var(--primary); }
.upload .u-main { font-size: 13px; font-weight: 600; color: var(--text); }
.upload .u-sub { font-size: 11px; color: var(--muted); }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.file-item .f-ic { color: var(--primary); flex: 0 0 auto; }
.file-item .f-name { font-size: 12.5px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; flex: 0 0 auto; }
.file-item button:hover { color: var(--text); }

.btn-primary {
  margin-top: 4px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm); border: none;
  background: var(--primary); color: var(--primary-fg);
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 20px -10px var(--primary); transition: background .15s;
}
.btn-primary:hover { background: var(--primary-h); }
.btn-primary:disabled { opacity: .6; cursor: progress; }

.notes { display: flex; flex-direction: column; gap: 7px; padding-top: 8px; }
.note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sb-muted); }
.note .dot { width: 7px; height: 7px; border-radius: 50%; background: oklch(0.7 0.16 150); flex: 0 0 auto; }

/* ── 右側：日曆 + 時間 ───────────────────────────────────────── */
.panel { padding: var(--pad); display: flex; flex-direction: column; gap: 24px; }
.panel-head { display: flex; flex-direction: column; gap: 6px; }
.panel-head h1 { font-family: 'Sora', sans-serif; font-size: 23px; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--text); }
.panel-head p { margin: 0; font-size: 14px; color: var(--muted); }

.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-top { display: flex; align-items: center; justify-content: space-between; }
.cal-month { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; font-size: 16px; transition: border-color .15s, color .15s;
}
.cal-nav button:hover { border-color: var(--border2); color: var(--text); }
.cal-nav button:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays div { height: 28px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cal-weeks { display: flex; flex-direction: column; gap: 4px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-blank { height: 46px; }
.day {
  height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 500; font-family: inherit;
  border: none; background: transparent; color: var(--text); cursor: pointer; padding: 0;
  transition: background .15s, color .15s;
}
.day:not(.is-disabled):not(.is-selected):hover { background: var(--primary-soft); color: var(--primary); }
.day.is-selected { background: var(--primary); color: var(--primary-fg); font-weight: 700; pointer-events: none; }
.day.is-disabled { color: var(--muted); opacity: .35; cursor: not-allowed; pointer-events: none; }

/* 時間 */
.timeblock { display: flex; flex-direction: column; gap: 20px; }
.timegroup { display: flex; flex-direction: column; gap: 11px; }
.timegroup-head { display: flex; align-items: baseline; gap: 8px; }
.timegroup-head b { font-family: 'Sora', sans-serif; font-size: 14.5px; font-weight: 600; color: var(--text); }
.timegroup-head span { font-size: 12px; color: var(--muted); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.chip {
  display: flex; align-items: center; justify-content: center;
  padding: 11px 6px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.chip.free:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chip.selected {
  background: var(--primary); color: var(--primary-fg); border-color: var(--primary);
  cursor: default; pointer-events: none; box-shadow: 0 8px 18px -10px var(--primary);
}
.chip.booked {
  background: var(--booked-bg); color: var(--booked-fg); border-color: transparent;
  cursor: not-allowed; pointer-events: none; font-weight: 500;
}
.chip.disabled {
  background: var(--surface2); color: var(--muted); border-color: transparent;
  opacity: .45; cursor: not-allowed; pointer-events: none; font-weight: 500;
}
.hint { font-size: 13px; color: var(--muted); }
.empty-box {
  border: 1px dashed var(--border2); border-radius: var(--radius);
  padding: 30px 20px; text-align: center; color: var(--muted); font-size: 13.5px;
}

/* ── 成功頁 ─────────────────────────────────────────────────── */
.done { padding: 64px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.done-check {
  width: 62px; height: 62px; border-radius: 50%; background: var(--primary); color: var(--primary-fg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px -10px var(--primary); margin-bottom: 8px;
}
.done h1 { font-family: 'Sora', sans-serif; font-size: 25px; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--text); }
.done p { margin: 0; font-size: 14px; color: var(--muted); max-width: 380px; line-height: 1.5; }
.done p b { color: var(--text); font-weight: 600; }
.done-card {
  width: 100%; max-width: 400px; margin-top: 18px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 14px; text-align: left; background: var(--surface2);
}
.done-card .dc-head { display: flex; align-items: center; gap: 12px; }
.done-card .dc-badge {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto;
}
.done-card .dc-badge b { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; line-height: 1; }
.done-card .dc-badge span { font-size: 8px; font-weight: 600; }
.done-card .dc-title { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.done-card .dc-sub { font-size: 12px; color: var(--muted); }
.done-card .dc-line { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text); font-weight: 600; white-space: nowrap; }
.done-card .dc-line .ic { color: var(--primary); flex: 0 0 auto; }
.done-card .dc-meet { font-size: 13px; }
.done-card .dc-meet a { color: var(--primary); font-weight: 700; text-decoration: none; word-break: break-all; }

.done-actions { display: flex; gap: 12px; margin-top: 24px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px;
  border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; text-decoration: none; transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
  padding: 12px 22px; border-radius: var(--radius-sm); border: none; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); }

.foot { font-size: 12px; color: var(--muted); }
.hidden { display: none !important; }

/* ── 響應式 ─────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .booking { grid-template-columns: 1fr; }
  .aside { border-right: none; border-bottom: 1px solid var(--border); }
}
