/* Respite Wellness: booking page. Builds on the tokens in styles.css. */

.booking-page { --bk-error: #9b3d2e; --bk-field: rgba(41, 39, 35, .24); }

.bk-testmode { margin: 0; padding: .6rem clamp(1.4rem, 4vw, 4.5rem); background: #efe6d6; color: #5a4a30; font-size: .78rem; text-align: center; }
.bk-noscript { margin: 2rem clamp(1.4rem, 7vw, 7rem); padding: 1rem 1.2rem; border: 1px solid var(--line); background: var(--ivory); }
.bk-noscript a { border-bottom: 1px solid currentColor; }

/* ---------- Intro ---------- */
.bk-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 27rem); align-items: end; gap: 2rem clamp(3rem, 8vw, 9rem); padding: clamp(3.5rem, 7vw, 6rem) clamp(1.4rem, 7vw, 7rem) clamp(2.5rem, 4vw, 3.5rem); background: var(--ivory); border-bottom: 1px solid var(--line); }
.bk-hero h1 { margin: 0; font-size: clamp(3.3rem, 7vw, 6.6rem); line-height: .9; letter-spacing: -.04em; }
.bk-hero > p { margin: 0; color: var(--muted); }

/* ---------- Layout ---------- */
.bk-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); align-items: start; gap: clamp(3rem, 7vw, 7rem); padding: clamp(3.5rem, 6vw, 5.5rem) clamp(1.4rem, 7vw, 7rem) clamp(5rem, 9vw, 8rem); }
.bk-layout[hidden] { display: none; }
.bk-step { margin-bottom: clamp(3.5rem, 6vw, 5rem); }
.bk-step:last-child { margin-bottom: 0; }
.bk-step-head { display: grid; grid-template-columns: 2.3rem 1fr; align-items: baseline; padding-bottom: 1.1rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.bk-step-num { font-size: .69rem; color: var(--muted); }
.bk-step-head h2 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.1; }
.bk-note, .bk-hint { margin: 1.1rem 0 0; font-size: .82rem; color: var(--muted); }
.bk-error { margin: .75rem 0 0; font-size: .82rem; font-weight: 500; color: var(--bk-error); }
.bk-error[hidden] { display: none; }

/* ---------- Step 1: package table ---------- */
.bk-pkg-row { display: grid; grid-template-columns: minmax(12rem, 1.5fr) repeat(var(--bk-cols, 3), minmax(5.5rem, 1fr)); align-items: center; gap: .65rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.bk-pkg-head { padding: 0 0 .8rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.bk-pkg-head span:not(:first-child) { text-align: center; }
.bk-pkg-name h3 { margin: 0; font-size: clamp(1.45rem, 2vw, 1.8rem); line-height: 1.1; }
.bk-pkg-name p { margin: .35rem 0 0; max-width: 24rem; font-size: .84rem; line-height: 1.5; color: var(--muted); }
.bk-option-empty { text-align: center; color: var(--muted); }

.bk-option { position: relative; display: block; cursor: pointer; }
.bk-option input, .bk-day input, .bk-time input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bk-option-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 4rem; padding: .6rem; background: var(--ivory); border: 1px solid rgba(41, 39, 35, .1); transition: background .2s ease, border-color .2s ease, color .2s ease; }
.bk-option-dur { display: none; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #7b756f; }
.bk-option-box strong { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; line-height: 1.1; }
.bk-option:hover .bk-option-box { border-color: var(--ink); }
.bk-option input:checked + .bk-option-box { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bk-option input:checked + .bk-option-box .bk-option-dur { color: #cbc7c0; }

.bk-option input:focus-visible + .bk-option-box,
.bk-day input:focus-visible + .bk-day-box,
.bk-time input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Step 2: calendar ---------- */
.bk-calendar[hidden] { display: none; }
.bk-calendar.is-loading .bk-days, .bk-calendar.is-loading .bk-times { opacity: .45; transition: opacity .2s ease; }
.bk-days-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.bk-range { margin: 0; font-family: var(--serif); font-size: 1.35rem; }
.bk-arrows { display: flex; gap: .5rem; }
.bk-arrow { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font: inherit; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.bk-arrow:hover:not(:disabled) { border-color: var(--ink); }
.bk-arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.bk-arrow:disabled { opacity: .35; cursor: default; }

.bk-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .45rem; }
.bk-day { position: relative; display: block; cursor: pointer; }
.bk-day-box { display: flex; flex-direction: column; align-items: center; padding: .6rem .2rem .55rem; background: var(--ivory); border: 1px solid rgba(41, 39, 35, .1); line-height: 1.15; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.bk-day-wd, .bk-day-mon { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: #7b756f; }
.bk-day-num { margin: .2rem 0 .15rem; font-family: var(--serif); font-size: 1.55rem; }
.bk-day:hover:not(.is-off) .bk-day-box { border-color: var(--ink); }
.bk-day input:checked + .bk-day-box { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bk-day input:checked + .bk-day-box .bk-day-wd, .bk-day input:checked + .bk-day-box .bk-day-mon { color: #cbc7c0; }
.bk-day.is-off { cursor: default; }
.bk-day.is-off .bk-day-box { background: transparent; border-style: dashed; color: rgba(41, 39, 35, .38); }
.bk-day.is-off .bk-day-wd, .bk-day.is-off .bk-day-mon { color: rgba(41, 39, 35, .38); }

.bk-times:not(:empty) { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.bk-time-group + .bk-time-group { margin-top: 1.1rem; }
.bk-time-label { margin: 0 0 .55rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.bk-time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.8rem, 1fr)); gap: .45rem; }
.bk-time { position: relative; display: block; cursor: pointer; }
.bk-time span { display: block; padding: .65rem .4rem; background: var(--ivory); border: 1px solid rgba(41, 39, 35, .1); text-align: center; font-size: .86rem; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.bk-time:hover span { border-color: var(--ink); }
.bk-time input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Step 3: details ---------- */
.bk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem 1.25rem; }
.bk-field-wide { grid-column: 1 / -1; }
.bk-field label { display: block; margin-bottom: .45rem; font-size: .84rem; font-weight: 500; }
.bk-optional { margin-left: .35rem; font-weight: 400; color: var(--muted); }
.bk-field input, .bk-field textarea { width: 100%; padding: .8rem .9rem; border: 1px solid var(--bk-field); border-radius: 0; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; transition: border-color .2s ease; }
.bk-field textarea { resize: vertical; min-height: 7rem; line-height: 1.55; }
.bk-field input:hover, .bk-field textarea:hover { border-color: rgba(41, 39, 35, .45); }
.bk-field input:focus, .bk-field textarea:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 0; }
.bk-field.is-invalid input { border-color: var(--bk-error); }
.bk-field.is-invalid input:focus { outline-color: var(--bk-error); }
.bk-field .bk-error { margin-top: .4rem; }
.bk-help { margin: .4rem 0 0; font-size: .76rem; color: var(--muted); }

/* ---------- Summary + PayPal ---------- */
.bk-summary { position: sticky; top: 2rem; padding: clamp(1.6rem, 3vw, 2.2rem); background: var(--ivory); border: 1px solid var(--line); }
.bk-summary .bk-step-head { margin-bottom: .4rem; }
.bk-summary-list { margin: 0; }
.bk-summary-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.bk-summary-list dt { flex: none; font-size: .78rem; color: var(--muted); }
.bk-summary-list dd { margin: 0; font-size: .9rem; text-align: right; }
.bk-total { display: flex; justify-content: space-between; align-items: baseline; padding: 1.2rem 0 1.3rem; }
.bk-total span { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.bk-total strong { font-family: var(--serif); font-size: 2.4rem; font-weight: 400; line-height: 1; }
.bk-paypal { min-height: 3.2rem; position: relative; z-index: 1; }
.bk-secure { margin: 1rem 0 0; font-size: .74rem; line-height: 1.55; color: var(--muted); }

.bk-status { margin: 0 0 1rem; padding: .8rem .95rem; border-left: 2px solid var(--ink); background: var(--paper); font-size: .84rem; line-height: 1.5; }
.bk-status[hidden] { display: none; }
.bk-status.is-error { border-left-color: var(--bk-error); color: var(--bk-error); }

.bk-summary.is-busy { pointer-events: none; }
.bk-busy { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; background: rgba(247, 246, 242, .93); text-align: center; }
.bk-busy[hidden] { display: none; }
.bk-busy p { margin: 0; font-family: var(--serif); font-size: 1.4rem; }
.bk-spinner { width: 2rem; height: 2rem; border: 1px solid rgba(41, 39, 35, .2); border-top-color: var(--ink); border-radius: 50%; animation: bk-spin 1s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ---------- Confirmation ---------- */
.bk-confirmed { max-width: 50rem; margin: 0 auto; padding: clamp(4rem, 8vw, 7rem) clamp(1.4rem, 7vw, 7rem) clamp(5rem, 9vw, 8rem); scroll-margin-top: 1rem; }
.bk-confirmed[hidden] { display: none; }
.bk-confirmed h2 { margin: 0 0 1.2rem; font-size: clamp(2.8rem, 5.5vw, 4.8rem); line-height: 1; letter-spacing: -.03em; }
.bk-confirmed h2:focus { outline: none; }
.bk-confirmed-lead { max-width: 34rem; margin: 0 0 2.2rem; color: var(--muted); font-size: 1.05rem; }
.bk-confirmed-list { margin: 0; border-top: 1px solid var(--line); }
.bk-confirmed-list div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.bk-confirmed-list dt { font-size: .8rem; color: var(--muted); }
.bk-confirmed-list dd { margin: 0; }
.bk-confirmed-list div:first-child dd { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; }
.bk-confirmed-note { max-width: 36rem; margin: 1.6rem 0 0; font-size: .86rem; color: var(--muted); }
.bk-confirmed-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.2rem 1.6rem; margin-top: 2.2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .bk-pkg-row { grid-template-columns: minmax(10rem, 1.2fr) repeat(var(--bk-cols, 3), minmax(4.8rem, 1fr)); }
}

@media (max-width: 920px) {
  .bk-hero { grid-template-columns: 1fr; }
  .bk-layout { grid-template-columns: 1fr; }
  .bk-summary { position: relative; top: auto; }
}

@media (max-width: 650px) {
  .bk-pkg-head { display: none; }
  .bk-pkg-row { grid-template-columns: repeat(var(--bk-cols, 3), minmax(0, 1fr)); padding: 1.3rem 0; }
  .bk-pkg-head + .bk-pkg-row { padding-top: 0; }
  .bk-pkg-name { grid-column: 1 / -1; margin-bottom: .35rem; }
  .bk-option-dur { display: block; }
  .bk-option-box { min-height: 4.4rem; }
  .bk-days { gap: .3rem; }
  .bk-day-box { padding: .5rem 0 .45rem; }
  .bk-day-wd, .bk-day-mon { font-size: .56rem; letter-spacing: .04em; }
  .bk-day-num { font-size: 1.3rem; }
  .bk-fields { grid-template-columns: 1fr; }
  .bk-confirmed-list div { grid-template-columns: 1fr; gap: .15rem; }
  .bk-confirmed-actions { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-spinner { animation-duration: 2.5s !important; animation-iteration-count: infinite !important; }
}
