/* ===== Booking wizard — one question per screen, large touch targets ===== */

.booking-form-card {
  --bk-accent: var(--primary-green);
  --bk-heading: var(--primary-green);
  --bk-selected-bg: #f0f7f3;
  --bk-done: #2D6A4F;
  --bk-error: #b03a2e;
  max-width: 640px;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  font-size: 1.05rem;
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}

[data-theme="dark"] .booking-form-card {
  --bk-heading: #95D5B2;
  --bk-selected-bg: rgba(64, 145, 108, 0.16);
  --bk-done: #52B788;
  --bk-error: #f2a196;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Progress ----- */
.bk-top { margin-bottom: 1.5rem; }
.bk-stepcount { font-size: 0.95rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.5rem; }
.bk-bar { height: 8px; background: var(--gray-100); border-radius: 100px; overflow: hidden; }
.bk-bar span { display: block; height: 100%; width: 20%; background: var(--bk-done); border-radius: inherit; transition: width var(--transition); }

/* ----- Question + help ----- */
.bk-q {
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--bk-heading);
  margin-bottom: 0.5rem;
  outline: none;
}
.bk-help { color: var(--gray-600); margin-bottom: 1.5rem; line-height: 1.6; }
.bk-sub { font-weight: 700; color: var(--text-charcoal); margin: 1.5rem 0 0.75rem; }
.bk-step > .bk-sub:first-of-type { margin-top: 0; }

/* ----- Fields ----- */
.bk-field { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.25rem; }
.bk-field label { font-size: 1rem; font-weight: 600; color: var(--text-charcoal); }
.bk-optional { font-weight: 400; color: var(--gray-600); }
.booking-form .bk-field input,
.booking-form .bk-field select {
  font-size: 1.1rem;
  min-height: 56px;
  padding: 0.9rem 1rem;
  width: 100%;
  box-sizing: border-box;
}
.bk-field-short input { max-width: 10rem; text-transform: uppercase; }
.booking-form .is-invalid { border-color: var(--bk-error) !important; }
.bk-error { color: var(--bk-error); font-size: 0.95rem; font-weight: 600; }
.bk-error:empty { display: none; }
.bk-error::before { content: '⚠ '; }
.bk-field-hint { font-size: 0.9rem; color: var(--gray-600); }
.bk-field-hint:empty { display: none; }

/* ----- Practitioner cards ----- */
.booking-form-card .practitioner-selector { max-width: none; grid-template-columns: 1fr; gap: 1rem; }
.booking-form-card .practitioner-option {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "emoji title" "emoji desc" "emoji price";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.2rem;
  text-align: left;
  padding: 1.25rem 1.25rem;
  min-height: 110px;
}
.booking-form-card .practitioner-option .practitioner-emoji { grid-area: emoji; font-size: 2.4rem; margin: 0; }
.booking-form-card .practitioner-option .practitioner-title { grid-area: title; font-size: 1.25rem; }
.booking-form-card .practitioner-option .practitioner-desc { grid-area: desc; max-width: none; font-size: 0.95rem; }
.booking-form-card .practitioner-option .practitioner-price { grid-area: price; justify-self: start; margin-top: 0.35rem; font-size: 0.95rem; }
.booking-form-card .practitioner-option.selected { background: var(--bk-selected-bg); border-color: var(--bk-accent); }
.booking-form-card .practitioner-option.selected::after {
  content: '✓';
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--bk-accent);
  color: #fff;
  font-weight: 700;
}

/* ----- Date strip ----- */
.date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}
.date-chip,
.time-chip {
  font-family: var(--font-body);
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  background: var(--white);
  color: var(--text-charcoal);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.date-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.55rem 0.25rem;
  min-height: 72px;
}
.date-chip-dow { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; color: var(--gray-600); }
.date-chip-day { font-size: 1.3rem; font-weight: 700; line-height: 1.1; }
.date-chip-mon { font-size: 0.78rem; color: var(--gray-600); }
.date-chip:hover,
.time-chip:hover:not(:disabled) { border-color: var(--sage-green); }
.date-chip[aria-checked="true"],
.time-chip[aria-checked="true"] {
  background: var(--bk-accent);
  border-color: var(--bk-accent);
  color: #fff;
}
.date-chip[aria-checked="true"] .date-chip-dow,
.date-chip[aria-checked="true"] .date-chip-mon { color: rgba(255, 255, 255, 0.9); }

/* ----- Time chips ----- */
.time-slots { display: flex; flex-direction: column; gap: 1rem; }
.time-group-label { font-size: 0.9rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.45rem; }
.time-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; }
.time-chip { padding: 0.7rem 0.4rem; min-height: 52px; font-size: 1.05rem; font-weight: 600; }
.time-chip:disabled { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }
.time-slots-empty { color: var(--gray-600); padding: 0.5rem 0; }

.bk-platform-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-top: 1.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-cream);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  color: var(--text-charcoal);
}

/* ----- Inline text buttons ----- */
.bk-link {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bk-heading);
  text-decoration: underline;
  cursor: pointer;
}

/* ----- Consent ----- */
.bk-consent-text {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--bg-cream);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  line-height: 1.65;
}
.bk-consent-text p { margin: 0 0 0.75rem; }
.bk-consent-text ul { margin: 0; padding-left: 1.2rem; }
.bk-consent-text li { list-style: disc; margin-bottom: 0.6rem; }

.bk-check {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
}
.bk-check:has(input:checked) { border-color: var(--bk-accent); background: var(--bk-selected-bg); }
.bk-check input { width: 1.6rem; height: 1.6rem; flex-shrink: 0; accent-color: var(--primary-green); }
.bk-check + .bk-error { margin-top: 0.5rem; }

/* ----- Summary ----- */
.bk-summary {
  margin: 0 0 1.25rem;
  padding: 0.5rem 1.25rem;
  background: var(--bg-cream);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
}
.bk-summary > div {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--gray-200);
}
.bk-summary > div:last-child { border-bottom: 0; }
.bk-summary dt { color: var(--gray-600); font-size: 0.95rem; }
.bk-summary dd { margin: 0; font-weight: 600; color: var(--text-charcoal); display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.bk-summary-total dt,
.bk-summary-total [data-sum="total"] { font-size: 1.2rem; font-weight: 700; color: var(--text-charcoal); }
.bk-currency select { padding: 0.4rem 2rem 0.4rem 0.6rem; font-size: 0.85rem; min-height: 40px; background-position: right 0.6rem center; }

/* ----- Voucher ----- */
.bk-voucher { margin-bottom: 1.5rem; }
.bk-voucher summary { cursor: pointer; font-weight: 600; color: var(--bk-heading); padding: 0.35rem 0; }
.bk-voucher-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.bk-voucher-row input { flex: 1; min-width: 0; min-height: 52px; font-size: 1.05rem; text-transform: uppercase; }

/* ----- Payment ----- */
#payment-section { margin-bottom: 1rem; }
#payment-section .bk-sub { margin-top: 0; }
#capitec-form { max-width: 520px; margin: 0 auto; }

.bk-reassure {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--gray-600);
}
.bk-reassure li::before { content: '✓ '; color: var(--bk-done); font-weight: 700; }

/* ----- Back / Next ----- */
.bk-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}
.bk-nav .btn { min-height: 58px; font-size: 1.1rem; justify-content: center; }
.bk-next { flex: 1; }
.bk-back { flex: 0 0 auto; padding-inline: 1.4rem; }
.bk-nav [hidden] { display: none; }

.bk-form-msg:empty { display: none; }
.bk-form-msg {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--border-radius);
  background: #fdf1ef;
  border: 1px solid #f0c9c3;
  color: #8a2c22;
}
[data-theme="dark"] .bk-form-msg { background: rgba(176, 58, 46, 0.15); border-color: rgba(176, 58, 46, 0.4); color: #f2b8b0; }

.bk-helpline {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--gray-600);
}
.bk-helpline a { font-weight: 600; color: var(--bk-heading); }

/* ----- Focus ----- */
.booking-form-card .practitioner-option:focus-visible,
.date-chip:focus-visible,
.time-chip:focus-visible,
.bk-link:focus-visible,
.bk-voucher summary:focus-visible,
.bk-check:focus-within {
  outline: 3px solid var(--sage-green);
  outline-offset: 2px;
}

/* ----- Phones ----- */
.date-chip[hidden] { display: none; }
.bk-more-days { margin-top: 0.6rem; }

@media (max-width: 560px) {
  .date-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .time-group-grid { grid-template-columns: repeat(3, 1fr); }
  .bk-summary > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-bar span,
  .date-chip,
  .time-chip { transition: none; }
}

/* Global `section` padding must not apply to wizard steps. */
.booking-form-card .bk-step { padding: 0; }
.booking-form-card .bk-step[hidden] { display: none; }

/* --white flips to a dark grey in dark mode; button text must stay white. */
.booking-form-card .btn-primary { color: #fff; }

/* Consent checkbox: `.booking-form input { appearance: none }` in style.css erased the
   native tick, so draw our own large, high-contrast box + tick. */
.booking-form .bk-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 2px solid var(--gray-400);
  border-radius: 8px;
  background: var(--white) center / 20px 20px no-repeat;
  cursor: pointer;
  transform: none;
  box-shadow: none;
}
.booking-form .bk-check input[type="checkbox"]:checked {
  border-color: var(--bk-accent);
  background-color: var(--bk-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.booking-form .bk-check input[type="checkbox"]:focus-visible { outline: 3px solid var(--sage-green); outline-offset: 2px; }
.bk-check { min-height: 64px; user-select: none; }
