/* Public booking page (spec §1-7, §19). Builds on base.css tokens. */

.bk-page {
  min-height: 100vh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 20px;
}
.bk-card { width: 100%; max-width: 980px; padding: 40px 36px; }

/* §2 header */
.bk-header { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 28px; }
.bk-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bk-header-top .masthead { margin-bottom: 0; }
.bk-header .masthead img { width: 48px; height: 48px; }
.bk-header .masthead .brand-word { font-size: 16px; color: var(--ink); }
.bk-lang-switch { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; flex-shrink: 0; }
.bk-lang-switch a {
  padding: 5px 10px; font-size: 12.5px; font-weight: 700; border-radius: 6px;
  color: var(--ink-soft); text-decoration: none; letter-spacing: .02em;
}
.bk-lang-switch a:hover { color: var(--ink); }
.bk-lang-switch a.is-active { background: var(--gold); color: var(--ink); }
.bk-title { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.bk-duration { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; color: var(--ink-soft); font-weight: 600; }
.bk-description { margin: 0; color: var(--ink-soft); white-space: pre-line; max-width: 62ch; }
.bk-notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 12px 16px; }

/* §3 scheduler layout */
.bk-scheduler { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; }

.bk-icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.bk-icon-btn:hover:not(:disabled) { border-color: var(--gold-deep); color: var(--gold-deep); }
.bk-icon-btn:focus-visible { outline: 3px solid rgba(30,223,165,.45); outline-offset: 1px; }
.bk-icon-btn:disabled { opacity: .35; cursor: default; }

/* §3a calendar */
.bk-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bk-month { margin: 0; font-size: 20px; font-weight: 700; }
.bk-month span { color: var(--ink-soft); font-weight: 400; }
.bk-cal-nav { display: flex; gap: 8px; }

.bk-weekdays, .bk-days {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
}
.bk-weekdays { margin-bottom: 6px; }
.bk-weekdays li {
  text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-soft);
  padding: 4px 0;
}
.bk-days.is-loading { opacity: .5; }
.bk-day {
  width: 100%; aspect-ratio: 1 / 1; max-height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid transparent;
  background: #FDF6D3; color: var(--ink);
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  position: relative;
}
.bk-day:hover:not(:disabled) { border-color: var(--gold-deep); }
.bk-day:focus-visible { outline: 3px solid rgba(30,223,165,.5); outline-offset: 1px; }
.bk-day:disabled { background: transparent; color: #B7B19C; font-weight: 400; cursor: default; }
.bk-day.is-today::after {
  content: ""; position: absolute; bottom: 6px; left: 50%; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 50%; background: currentColor;
}
.bk-day.is-selected { background: var(--gold); color: var(--ink); border-color: var(--gold); }

.bk-month-empty { margin-top: 18px; text-align: center; color: var(--ink-soft); }
.bk-month-empty p { margin: 0 0 10px; }

/* §3b slot column */
.bk-day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 36px; }
.bk-back { display: none; }
.bk-day-label { display: flex; flex-direction: column; line-height: 1.3; }
.bk-day-label strong { font-family: "Manrope", ui-sans-serif, system-ui, sans-serif; font-size: 17px; }
.bk-day-label span { color: var(--ink-soft); font-size: 14.5px; }

.bk-tz { position: relative; margin-bottom: 16px; }
.bk-tz-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  padding: 9px 12px; font: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer; text-align: left;
}
.bk-tz-btn:hover { border-color: var(--gold-deep); }
.bk-tz-btn:focus-visible { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(30,223,165,.25); }
.bk-tz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bk-tz-clock { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bk-tz-caret { color: var(--ink-soft); flex-shrink: 0; }

.bk-tz-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px;
}
.bk-tz-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 300px; overflow-y: auto; }
.bk-tz-group {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); padding: 10px 8px 4px;
}
.bk-tz-option {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14.5px;
}
.bk-tz-option:hover, .bk-tz-option:focus { background: var(--panel); outline: none; }
.bk-tz-option.is-current { background: var(--ink); color: #fff; }
.bk-tz-option.is-current .bk-tz-opt-clock { color: #d9d5c4; }
.bk-tz-opt-clock { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.bk-tz-none { padding: 10px; color: var(--ink-soft); font-size: 14px; }

.bk-slots {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  max-height: 380px; overflow-y: auto;
}
.bk-slot {
  width: 100%; height: 42px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.bk-slot:hover { background: #FDF6D3; border-color: var(--gold-deep); }
.bk-slot:focus-visible { outline: 3px solid rgba(30,223,165,.5); outline-offset: 1px; }
.bk-slots-empty { color: var(--ink-soft); margin: 8px 0 0; }

/* §4 mobile: calendar first, then drill down to a day */
@media (max-width: 767px) {
  .bk-page { padding: 16px 12px; }
  .bk-card { padding: 24px 18px; }
  .bk-title { font-size: 21px; }
  .bk-scheduler { grid-template-columns: 1fr; gap: 0; scroll-margin-top: 12px; }
  .bk-slot-col { display: none; }
  .bk-scheduler.show-day .bk-cal-col { display: none; }
  .bk-scheduler.show-day .bk-slot-col { display: block; animation: bk-slide-in .2s ease-out; }
  .bk-back { display: inline-flex; background: var(--gold); border-color: var(--gold); }
  .bk-slots { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .bk-slot { height: 46px; }
}
@keyframes bk-slide-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* §5 modal */
.bk-modal {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  border: none; border-radius: var(--radius); padding: 32px 28px 28px;
  box-shadow: 0 20px 60px rgba(32,29,20,.25); color: var(--ink); background: var(--paper);
}
.bk-modal[open] { animation: bk-modal-in .2s ease-out; }
.bk-modal::backdrop { background: rgba(32,29,20,.45); backdrop-filter: blur(2px); }
@keyframes bk-modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.bk-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer;
}
.bk-modal-close:hover, .bk-modal-close:focus-visible { border-color: var(--gold-deep); color: var(--ink); outline: none; }

.bk-summary { margin-top: 8px; }
.bk-summary-title { font-size: 17px; margin: 0 0 4px; padding-right: 28px; }
.bk-summary .summary-row { margin: 6px 0 0; }
.bk-summary .summary-row svg { flex-shrink: 0; }

.bk-form-heading { font-size: 17px; margin: 26px 0 14px; }
.bk-field { margin-bottom: 16px; }
.bk-req { color: var(--gold-deep); }
.field-input[aria-invalid="true"], .field-textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-textarea { resize: vertical; }

.bk-meeting-type { border: 0; padding: 0; margin: 0 0 16px; }
.bk-meeting-type legend { padding: 0; margin-bottom: 8px; }
.bk-meeting-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-meeting-option {
  display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: var(--paper); transition: border-color .15s, background-color .15s;
}
.bk-meeting-option:hover { border-color: var(--gold-deep); }
.bk-meeting-option:has(input:checked) { border-color: var(--gold-deep); background: #E8FBF4; box-shadow: 0 0 0 1px var(--gold-deep) inset; }
.bk-meeting-option:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(30,223,165,.35); }
.bk-meeting-option input { accent-color: var(--gold-deep); width: 17px; height: 17px; margin: 0 0 2px; }
.bk-meeting-option-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.bk-meeting-option-hint { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

@media (max-width: 480px) {
  .bk-meeting-options { grid-template-columns: 1fr; }
}

.bk-prep { margin: 4px 0 18px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px; }
.bk-prep summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink-soft); }
.bk-prep summary:hover { color: var(--ink); }
.bk-prep[open] summary { margin-bottom: 12px; }
.bk-prep-body .bk-field:last-child { margin-bottom: 4px; }
.bk-optional { font-weight: 400; }

altcha-widget { display: block; margin-bottom: 12px; }

.bk-form-error {
  background: var(--danger-bg); color: var(--danger); border-radius: 8px;
  padding: 10px 14px; font-size: 14.5px; margin: 0 0 12px;
}
.bk-req-note { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }
.bk-submit { width: 100%; padding: 13px 18px; font-size: 16px; transition: background .15s; }

/* §7 confirmation */
.bk-success { text-align: center; margin-bottom: 18px; }
.bk-success-badge {
  width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #FDF6D3; color: var(--gold-deep);
}
.bk-success-title { font-size: 20px; margin: 0; }
.bk-success-body { margin-top: 18px; }
.bk-success-message { margin: 0 0 16px; }
.bk-manage { margin: 0; font-size: 14.5px; }
