/* Staging-only online booking page (booking.js). Uses the site tokens from site.css. */
.online-booking {
  display: grid;
  gap: 28px;
}

/* At least one screen high (minus the sticky header), so a short step never pulls the footer into view
   and the page does not grow and shrink from step to step. */
.online-booking__app {
  display: grid;
  gap: 24px;
  min-height: calc(100vh - 100px);
  min-height: calc(100svh - 100px);
  align-content: start;
}

.online-booking-page__section {
  padding-top: 56px;
}

.online-booking__header {
  display: grid;
  gap: 12px;
}

.online-booking__title {
  margin: 0;
  font-family: var(--heading-font);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
}

.online-booking__intro {
  margin: 0;
  max-width: 720px;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Stepper: each step is a circle with its label below; lines stretch between the steps.
   Completed steps show a check and stay clickable. As wide as the intro text at most. */
.online-booking__progress {
  --step-size: 30px;
  display: flex;
  max-width: 720px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.online-booking__progress li {
  display: flex;
  flex: 1 1 auto;
}

.online-booking__progress li:last-child {
  flex: 0 0 auto;
}

.online-booking__progress li:not(:last-child)::after {
  content: "";
  flex: 1 1 auto;
  min-width: 16px;
  height: 2px;
  margin: calc(var(--step-size) / 2 - 1px) 8px 0;
  border-radius: 1px;
  background: var(--border);
}

.online-booking__progress li.is-complete::after {
  background: var(--text);
}

/* Same height whether a step is plain text or a button, so the layout never shifts. */
.online-booking__progress-step {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  white-space: nowrap;
}

button.online-booking__progress-step {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: color 0.2s ease;
}

button.online-booking__progress-step:hover {
  color: var(--accent);
}

.online-booking__progress-number {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--step-size);
  height: var(--step-size);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.online-booking__progress .is-complete .online-booking__progress-number {
  border-color: var(--text);
  background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  color: transparent;
}

button.online-booking__progress-step:hover .online-booking__progress-number {
  border-color: var(--accent);
  background-color: var(--accent);
}

.online-booking__progress .is-current {
  color: var(--text);
  font-weight: 700;
}

/* Every label reserves its bold width, so the current step does not push the others aside. */
.online-booking__progress-label {
  display: inline-grid;
}

.online-booking__progress-label::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  font-weight: 700;
  visibility: hidden;
}

.online-booking__progress .is-current .online-booking__progress-number {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(210, 13, 27, 0.14);
}

.online-booking__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 24px;
  align-items: start;
}

.online-booking__layout--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 820px;
}

.online-booking__panel,
.online-booking__summary {
  padding: var(--layout-panel-padding);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.online-booking__panel {
  position: relative;
}

/* Loading: a thin running bar along the top edge instead of fading the step. */
.online-booking__panel[aria-busy="true"]::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat;
  background-size: 40% 100%;
  animation: online-booking-bar 1.1s ease-in-out infinite;
}

.online-booking__panel[aria-busy="true"] button,
.online-booking__panel[aria-busy="true"] a.online-booking__option {
  cursor: progress;
}

.online-booking__panel[aria-busy="true"] a.online-booking__option {
  pointer-events: none;
}

@keyframes online-booking-bar {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}

@keyframes online-booking-spin {
  to { transform: rotate(360deg); }
}

@keyframes online-booking-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* The element that started the request shows a small spinner. */
.is-loading::after {
  content: "";
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: online-booking-spin 0.7s linear infinite;
}

.online-booking__option.is-loading {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.online-booking__option.is-loading::after {
  position: absolute;
  top: 18px;
  right: 18px;
  margin: 0;
  color: var(--accent);
}

.online-booking__slot.is-loading {
  position: relative;
  border-color: var(--accent);
  color: transparent;
}

.online-booking__slot.is-loading::after {
  position: absolute;
  inset: 0;
  margin: auto;
  color: var(--accent);
}

/* Placeholders while the first data of a step loads. */
.online-booking__skeleton-heading,
.online-booking__skeleton-card {
  display: block;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #ebe6e1 0%, #f7f4f1 50%, #ebe6e1 100%);
  background-size: 200% 100%;
  animation: online-booking-shimmer 1.4s ease-in-out infinite;
}

.online-booking__skeleton-heading {
  width: min(420px, 80%);
  height: 35px;
  margin-bottom: 20px;
}

.online-booking__skeleton-card {
  height: 92px;
}

.online-booking__summary {
  position: sticky;
  top: 110px;
  background: var(--surface);
}

.online-booking__summary h2 {
  margin: 0 0 16px;
  font-size: var(--font-size-card-title);
  font-weight: 600;
}

.online-booking__summary-empty {
  margin: 0;
  color: var(--text-soft);
}

/* Wide screens: the selection column shows the details at confirm/done, the step does not repeat them. */
@media (min-width: 901px) {
  .online-booking__panel .online-booking__summary-list--recap {
    display: none;
  }
}

.online-booking__heading {
  margin: 0 0 20px;
  font-family: var(--heading-font);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  font-weight: 500;
  line-height: 1.15;
}

/* Focus targets stay clear of the sticky header when scrolled into view. */
.online-booking__heading,
.online-booking__error {
  scroll-margin-top: 120px;
}

/* Headings receive focus only to guide screen readers to the new step; no visible frame. */
.online-booking__heading:focus {
  outline: none;
}

.online-booking__lead,
.online-booking__privacy,
.online-booking__account {
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.6;
}

.online-booking__privacy a,
.online-booking__lead a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.online-booking__group + .online-booking__group {
  margin-top: 28px;
}

.online-booking__group h3,
.online-booking__day h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.online-booking__options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.online-booking__option {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 18px 44px 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.online-booking__option {
  text-decoration: none;
}

.online-booking__option:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.online-booking__option--featured {
  grid-column: 1 / -1;
  border-color: var(--accent);
}

.online-booking__option-title {
  font-weight: 700;
  line-height: 1.3;
}

/* Location cards: building photo above the name. */
.online-booking__options--locations {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.online-booking__option--location {
  align-content: start;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.online-booking__location-media {
  --location-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-muted);
}

/* The ratio sits on the picture itself; on its container the image's own height would win. */
.online-booking__location-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--location-ratio);
  object-fit: cover;
  transition: transform 0.4s ease;
}

.online-booking__location-media--empty {
  aspect-ratio: var(--location-ratio);
}

.online-booking__option--location:hover .online-booking__location-media img {
  transform: scale(1.03);
}

.online-booking__location-icon {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-soft);
}

.online-booking__location-body {
  display: grid;
  gap: 4px;
  padding: 16px 44px 18px 20px;
}

.online-booking__option--location.is-loading::after {
  top: auto;
  bottom: 20px;
}

/* Therapist cards: portrait from the team page, initials when there is none. */
.online-booking__option--person {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.online-booking__person-body {
  display: grid;
  gap: 4px;
}

.online-booking__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.online-booking__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.online-booking__avatar--initials {
  border: 1px solid var(--border);
}

.online-booking__avatar-group {
  display: flex;
}

.online-booking__avatar-group .online-booking__avatar {
  width: 44px;
  height: 44px;
  border: 2px solid var(--surface);
  font-size: 0.85rem;
}

.online-booking__avatar-group .online-booking__avatar + .online-booking__avatar {
  margin-left: -14px;
}

.online-booking__summary-person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

.online-booking__summary-person .online-booking__avatar {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.online-booking__option-meta {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

.online-booking__option-text {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.online-booking__week {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.online-booking__week-caption {
  font-weight: 700;
}

.online-booking__week-button,
.online-booking__back,
.online-booking__link,
.online-booking__switch button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.online-booking__week-button:disabled {
  color: var(--text-soft);
  text-decoration: none;
  cursor: default;
}

.online-booking__back {
  margin-top: 24px;
}

.online-booking__day + .online-booking__day {
  margin-top: 22px;
}

.online-booking__slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.online-booking__slot {
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.online-booking__slot:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.online-booking__empty {
  color: var(--text-soft);
}

.online-booking__switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.online-booking__switch button {
  padding: 0 18px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}

.online-booking__switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
}

.online-booking__form {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.online-booking__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.online-booking__field {
  display: grid;
  gap: 6px;
}

.online-booking__field label {
  font-weight: 700;
}

.online-booking__field input,
.online-booking__field select,
.online-booking__field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #b9b2ac;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.online-booking__field textarea {
  resize: vertical;
}

.online-booking__field select {
  padding-right: 40px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23171717' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 18px;
}

.online-booking__field.has-error input,
.online-booking__field.has-error select {
  border-color: var(--accent);
  border-width: 2px;
}

.online-booking__hint {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.online-booking__field-error {
  color: var(--accent-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

/* Buttons do not inherit the page font by default. */
.online-booking button.button {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.online-booking__submit {
  justify-self: start;
  margin-top: 6px;
}

.online-booking__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.online-booking__error:empty {
  display: none;
}

.online-booking__error {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #fdecec;
  color: var(--accent-dark);
  font-weight: 700;
}

.online-booking__error:focus {
  outline: none;
}

.online-booking__notice {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 4px solid var(--text-soft);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.55;
  white-space: pre-line;
}

.online-booking__summary-list {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.online-booking__summary-list div {
  display: grid;
  align-content: start;
  gap: 2px;
}

.online-booking__summary-list dt {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.online-booking__summary-list dd {
  margin: 0;
  font-weight: 700;
}

.online-booking__panel .online-booking__summary-list {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.online-booking__actions,
.online-booking__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.online-booking button:focus-visible,
.online-booking a:focus-visible,
.online-booking input:focus-visible,
.online-booking select:focus-visible,
.online-booking textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .online-booking__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On small screens the selection sits above the step it belongs to. */
  .online-booking__summary {
    position: static;
    order: -1;
    padding: 20px;
  }

  /* Above the step only once something is selected; at confirm/done the step lists the details itself. */
  .online-booking__summary--empty,
  .online-booking__summary--recap {
    display: none;
  }

  .online-booking__summary .online-booking__summary-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    margin: 0;
  }
}

@media (max-width: 640px) {
  .online-booking-page__section {
    padding-top: 36px;
  }

  .online-booking__panel {
    padding: 22px 18px;
  }

  /* Phones: numbers only, the step heading below names the current step. */
  .online-booking__progress {
    --step-size: 28px;
  }

  .online-booking__progress-step {
    justify-content: center;
    min-height: 44px;
  }

  .online-booking__progress li:not(:last-child)::after {
    align-self: center;
    min-width: 8px;
    margin: 0 4px;
  }

  .online-booking__progress-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  /* On phones the selection is one compact line above the step, so it barely moves the step. */
  .online-booking__summary {
    padding: 12px 16px;
  }

  .online-booking__summary h2,
  .online-booking__summary .online-booking__summary-list dt {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .online-booking__summary .online-booking__summary-list {
    display: block;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .online-booking__summary .online-booking__summary-list div,
  .online-booking__summary .online-booking__summary-list dd {
    display: inline;
  }

  .online-booking__summary .online-booking__summary-list div + div dd::before {
    content: "·";
    margin: 0 8px;
    color: var(--text-soft);
    font-weight: 400;
  }

  .online-booking__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .online-booking__options {
    grid-template-columns: minmax(0, 1fr);
  }

  .online-booking__location-media {
    --location-ratio: 16 / 8;
  }

  /* Phones: the group of faces above the text, so the text keeps the full width. */
  .online-booking__option--featured.online-booking__option--person {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .online-booking__summary-person .online-booking__avatar {
    width: 22px;
    height: 22px;
  }

  .online-booking__submit {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .online-booking__option,
  .online-booking__location-media img {
    transition: none;
  }

  .online-booking__option--location:hover .online-booking__location-media img {
    transform: none;
  }

  .online-booking__panel[aria-busy="true"]::before,
  .online-booking__skeleton-heading,
  .online-booking__skeleton-card {
    animation: none;
  }

  .is-loading::after {
    animation-duration: 1.6s;
  }
}
