/* ============================================================
   JOSEPH BOBAY — BOOKING
   The private-lesson booking flow. Built only from the site tokens:
   paper, ink, stone, forest; ruled lines instead of cards; small radii.
   ============================================================ */

/* ── Header ─────────────────────────────────────────────── */
.bk-head {
  padding: clamp(40px, 7vw, 88px) var(--side-pad) clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
}
.bk-head-inner { max-width: var(--content-max); margin: 0 auto; }
.bk-head .eyebrow { margin-bottom: 18px; }
.bk-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  letter-spacing: -0.06em;
  line-height: 0.92;
  color: var(--ink);
}
.bk-lede {
  margin-top: 18px;
  max-width: 520px;
  color: var(--stone);
  font-size: 0.9375rem;
  line-height: 1.75;
}

/* ── Layout ─────────────────────────────────────────────── */
.bk-layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) var(--side-pad) clamp(56px, 8vw, 104px);
  min-height: 420px;
}
.bk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 900px) {
  .bk-grid { grid-template-columns: minmax(0, 1fr); }
}
.bk-flow { min-width: 0; }

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

.bk-section-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 16px;
}

/* ── Steps ──────────────────────────────────────────────── */
.bk-step-title, .bk-status-title, .bk-times-head, #reserve, .bk-field input {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.bk-step {
  border-top: 1px solid var(--border-md);
  padding: 22px 0 28px;
}
.bk-step-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.bk-step-num {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--forest);
  width: 18px;
  flex-shrink: 0;
}
.bk-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
}
.bk-step.is-done .bk-step-title { color: var(--stone); font-size: 1rem; }
.bk-step-summary {
  flex: 1 1 200px;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.5;
}
.bk-step-body { padding: 20px 0 0 32px; }
@media (max-width: 560px) {
  .bk-step-head .bk-link { margin-left: auto; order: 3; }
  .bk-step-summary { order: 4; flex-basis: 100%; padding-left: 32px; }
}
@media (max-width: 560px) {
  .bk-step-body { padding-left: 0; }
}

.bk-link {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 0.8125rem;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bk-link:hover { color: var(--canopy); }

.bk-note {
  margin-top: 14px;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--stone);
  max-width: 560px;
}
.bk-note a, .bk-empty-body a, .bk-policy a, .bk-noscript a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bk-loading {
  font-size: 0.875rem;
  color: var(--stone);
  padding: 8px 0;
}

/* ── Choices (lesson, payment): ruled rows, not cards ───── */
.bk-choices { border: none; display: flex; flex-direction: column; }
.bk-choice {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 16px 18px 14px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bk-choice + .bk-choice { margin-top: 10px; }
.bk-choice:hover { border-color: var(--stone); }
.bk-choice:has(input:checked) {
  border-color: var(--forest);
  background: rgba(28, 56, 41, 0.04);
  box-shadow: inset 3px 0 0 var(--forest);
}
.bk-choice input, .bk-time input, .bk-day input {
  accent-color: var(--forest);
}
.bk-choice input { width: 16px; height: 16px; margin: 0; }
.bk-choice-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-choice-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.3;
}
.bk-choice-meta { font-size: 0.8125rem; color: var(--stone); line-height: 1.5; }
.bk-choice-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.3;
}
.bk-choice-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.bk-choice-sub { font-size: 0.75rem; color: var(--stone); }
@media (max-width: 560px) {
  .bk-choice { grid-template-columns: 20px minmax(0, 1fr); }
  .bk-choice-price { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
}

/* ── Date range + days ──────────────────────────────────── */
.bk-range {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.bk-range-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  min-width: 140px;
  text-align: center;
}
.bk-range-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
.bk-range-btn:hover:not([disabled]) { border-color: var(--ink); }
.bk-range-btn[disabled] { opacity: 0.35; cursor: default; }

.bk-days {
  border: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 560px) {
  /* Phones: one swipeable row, two weeks long */
  .bk-days {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 58px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .bk-day { scroll-snap-align: start; }
}
.bk-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  min-height: 64px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.bk-day input, .bk-time input {
  position: absolute; inset: 0;
  opacity: 0; margin: 0; cursor: inherit;
}
.bk-day-wd {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}
.bk-day-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}
.bk-day:hover:not(.is-empty) { border-color: var(--ink); }
.bk-day.is-empty { cursor: default; border-style: dashed; opacity: 0.4; }
.bk-day:has(input:checked) { background: var(--forest); border-color: var(--forest); }
.bk-day:has(input:checked) .bk-day-wd,
.bk-day:has(input:checked) .bk-day-num { color: var(--on-forest); }
.bk-day:has(input:focus-visible), .bk-time:has(input:focus-visible), .bk-choice:has(input:focus-visible) {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}
.bk-day.is-skeleton { border-style: solid; background: var(--smoke); cursor: default; animation: bk-fade 1.4s ease-in-out infinite; }
@keyframes bk-fade { 50% { opacity: 0.45; } }

/* ── Times ──────────────────────────────────────────────── */
.bk-times {
  border: none;
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.bk-times-head {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.bk-tz {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}
.bk-time {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.bk-time:hover { border-color: var(--ink); }
.bk-time:has(input:checked) { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }

/* ── Empty / error ──────────────────────────────────────── */
.bk-empty {
  padding: 24px 0;
  border-top: 1px dashed var(--border-md);
}
.bk-empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 6px;
}
.bk-empty-body { font-size: 0.875rem; color: var(--stone); line-height: 1.8; }
.bk-empty-body .btn { margin-right: 6px; }

.bk-msg {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid #8a3b2a;
  background: rgba(138, 59, 42, 0.06);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #6e2f22;
  max-width: 600px;
}

/* ── Form ───────────────────────────────────────────────── */
.bk-form { display: flex; flex-direction: column; gap: 18px; max-width: 600px; }
.bk-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .bk-form-row { grid-template-columns: 1fr; } }
.bk-field { display: flex; flex-direction: column; gap: 6px; }
.bk-field label { font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.bk-opt { color: var(--stone); font-weight: 400; }
.bk-field input, .bk-field textarea {
  font-family: var(--font-body);
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--ink);
  background: #fbf8f2;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bk-field textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.bk-field input:focus, .bk-field textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(28, 56, 41, 0.12);
}
.bk-field.has-error input, .bk-field.has-error textarea { border-color: #8a3b2a; }
.bk-field-err { font-size: 0.75rem; color: #8a3b2a; }
.bk-field-err:empty { display: none; }

.bk-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.btn[disabled] { opacity: 0.6; cursor: default; }
@media (max-width: 560px) {
  .bk-actions .btn { width: 100%; white-space: normal; }
}

/* ── Terms (summary rows) ───────────────────────────────── */
.bk-terms { border-top: 1px solid var(--border-md); }
.bk-term {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.bk-term dt {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  flex-shrink: 0;
  padding-top: 3px;
}
.bk-term dd { font-size: 0.875rem; color: var(--ink); text-align: right; line-height: 1.5; }
.bk-review { margin-top: 22px; max-width: 600px; }
@media (min-width: 901px) {
  .bk-flow .bk-review { display: none; } /* desktop: the sticky summary beside the form shows it */
}

.bk-summary {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  padding-top: 22px;
  border-top: 1px solid var(--border-md);
}
@media (max-width: 900px) {
  .bk-summary { position: static; }
  .bk-flow + .bk-summary { display: none; } /* phones: the review appears inside the payment step */
  .bk-checkout .bk-summary { display: block; order: -1; }
}

/* ── Checkout ───────────────────────────────────────────── */
.bk-checkout-head { margin-bottom: 18px; border-top: 1px solid var(--border-md); padding-top: 22px; }
.bk-checkout .bk-grid { align-items: start; }
.bk-stripe { min-height: 420px; }

/* ── Status / confirmation ──────────────────────────────── */
.bk-status {
  max-width: 640px;
  border-top: 1px solid var(--border-md);
  padding-top: clamp(28px, 4vw, 44px);
}
.bk-status-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
  max-width: 620px;
  color: var(--ink);
}
.bk-status-body a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.bk-status-body {
  margin: 16px 0 26px;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--stone);
  max-width: 540px;
}
.bk-status--done .bk-status-title { color: var(--forest); }
.bk-status--attention { border-top-color: #8a6a2a; }
.bk-pulse {
  display: block;
  width: 10px; height: 10px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--forest);
  animation: bk-pulse 1.6s ease-in-out infinite;
}
@keyframes bk-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.bk-meet { margin-top: 18px; font-size: 0.9375rem; }
.bk-meet a { display: inline-block; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ── Policy ─────────────────────────────────────────────── */
.bk-policy {
  background: var(--smoke);
  padding: clamp(48px, 7vw, 88px) var(--side-pad);
}
.bk-policy-inner { max-width: var(--content-max); margin: 0 auto; }
.bk-policy-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border-md);
}
@media (max-width: 760px) { .bk-policy-list { grid-template-columns: 1fr; } }
.bk-policy-row { padding: 22px 32px 22px 0; border-bottom: 1px solid var(--border); }
.bk-policy-row dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.975rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 6px;
}
.bk-policy-row dd { font-size: 0.875rem; line-height: 1.75; color: var(--stone); max-width: 520px; }

.bk-turnstile { margin-top: 12px; }
.bk-turnstile:empty { display: none; }

.bk-noscript { padding: 24px 0; font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  .bk-pulse, .bk-day.is-skeleton { animation: none; }
  .bk-choice, .bk-day, .bk-time { transition: none; }
}

/* ── iPhone fix: fieldsets default to min-width: min-content, which let
   the two-week day row push the whole page sideways. Keep them inside
   their column so the day row scrolls on its own. ─────────────────── */
.bk-layout fieldset { min-width: 0; max-width: 100%; }

/* ── Photos (Unsplash License) ──────────────────────────── */
/* Header: a real lesson behind the title */
.bk-head {
  position: relative;
  overflow: hidden;
  border-bottom: none;
  background: var(--ink) url("../img/photos/lesson-in-person.jpg") center 35% / cover no-repeat;
  padding-top: clamp(64px, 10vw, 140px);
  padding-bottom: clamp(44px, 6vw, 80px);
}
.bk-head::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14, 13, 11, 0.86) 0%, rgba(14, 13, 11, 0.62) 55%, rgba(14, 13, 11, 0.25) 100%);
  pointer-events: none;
}
.bk-head-inner { position: relative; z-index: 1; }
.bk-head .eyebrow { color: rgba(245, 240, 230, 0.75); }
.bk-head .phrase-mark { color: var(--forest-lt, #6aad82); }
.bk-choice:has(#lesson-in_person) .bk-choice-main, .bk-choice:has(#lesson-online) .bk-choice-main { text-shadow: 0 0 10px var(--paper), 0 0 4px var(--paper); }
.bk-head .bk-title { color: var(--on-forest); }
.bk-head .bk-lede { color: rgba(245, 240, 230, 0.8); }
@media (max-width: 560px) {
  .bk-head { background-position: 62% center; }
  .bk-head::before { background: linear-gradient(180deg, rgba(14, 13, 11, 0.55) 0%, rgba(14, 13, 11, 0.85) 100%); }
}

/* Lesson choices: the photo fills the right side of the card and fades in */
.bk-choice:has(#lesson-in_person), .bk-choice:has(#lesson-online) {
  overflow: hidden;
  isolation: isolate;
  min-height: 112px;
}
.bk-choice:has(#lesson-in_person)::before, .bk-choice:has(#lesson-online)::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 58%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 12%, rgba(0,0,0,0.3) 45%, rgba(0,0,0,0.9) 100%);
          mask-image: linear-gradient(90deg, transparent 0%, transparent 12%, rgba(0,0,0,0.3) 45%, rgba(0,0,0,0.9) 100%);
  transition: opacity 0.2s;
}
.bk-choice:has(#lesson-in_person)::before { background-image: url("../img/photos/lesson-in-person.jpg"); }
.bk-choice:has(#lesson-online)::before { background-image: url("../img/photos/lesson-online.jpg"); }
/* Price sits on the photo: give it a paper backing so it stays readable */
.bk-choice:has(#lesson-in_person) .bk-choice-price, .bk-choice:has(#lesson-online) .bk-choice-price {
  background: rgba(245, 240, 230, 0.92);
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
@media (max-width: 560px) {
  .bk-choice:has(#lesson-in_person)::before, .bk-choice:has(#lesson-online)::before { width: 52%; }
  .bk-choice:has(#lesson-in_person) .bk-choice-price, .bk-choice:has(#lesson-online) .bk-choice-price { justify-self: start; }
}

/* ── Payment step: plain and the same on every screen. Cream page,
   Stripe's form on a white rounded card, "Your lesson" in a light panel
   beside it (underneath on phones). ─────────────────────────────── */
.bk-checkout .bk-grid { grid-template-columns: minmax(0, 520px) minmax(0, 320px); gap: 28px; }
.bk-checkout .bk-stripe {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* iPhone: clip the frame to the corners */
  box-shadow: 0 10px 30px rgba(14, 13, 11, 0.08), 0 0 0 1px rgba(14, 13, 11, 0.06);
}
.bk-checkout .bk-stripe iframe { display: block; width: 100% !important; border: 0; border-radius: 14px; background: #fff; }
.bk-checkout .bk-summary {
  background: var(--smoke);
  border-top: none;
  border-radius: 14px;
  padding: 22px;
}
@media (max-width: 900px) {
  .bk-checkout .bk-grid { grid-template-columns: minmax(0, 1fr); }
  .bk-checkout .bk-summary { order: 2; margin-top: 4px; }
}

/* Headings the page moves focus to (so screen readers land in the right
   place) shouldn't show a highlight box. They aren't clickable. */
.bk-layout [tabindex="-1"]:focus,
.bk-layout [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
