/* Booking flow: progress, service cards, slot picker. Shared chrome lives in website/site.css. */
.booking-progress {
  margin: var(--space-2) 0 var(--space-1);
}

/* iOS-style progress: four thin segments, the reached ones in the tint, a small label
   under each; the step number stays for screen readers only. */
.booking-progress ol {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 0.35rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
}

.booking-progress li {
  position: relative;
  min-width: 0;
  min-height: 2.75rem;
  padding-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.6875rem;
  font-weight: var(--weight-medium);
  line-height: 1.2;
}

.booking-progress li::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--line-strong);
  content: "";
}

.booking-progress li > span:first-of-type {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.booking-progress li > span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.booking-progress :is(.is-current, .is-complete)::before {
  background: var(--brand);
}

.booking-progress .is-current {
  color: var(--ink);
  font-weight: var(--weight-strong);
}

.booking-progress .has-link {
  color: var(--brand-deep);
}

.booking-progress-back {
  position: absolute;
  z-index: 2;
  border-radius: var(--radius-s);
  cursor: pointer;
  inset: 0;
}

.booking-progress-back:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.1rem;
}

/* Step 1: booking action inside the shared public service card. */
.booking-service-group + .booking-service-group {
  margin-top: var(--space-5);
}

.booking-service-group > h2 {
  margin: 0 0 var(--space-1);
  padding-inline: 1rem;
  color: var(--ink-soft);
  font-size: var(--step--2);
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.service-card-submit {
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.service-card-submit:hover {
  color: var(--brand);
}

/* Categories: a sticky segmented control that switches the list in place (site.js); without
   JavaScript its links jump to each section. Services are grouped rows with a chevron. */
.booking-category-nav { position: sticky; z-index: 5; top: calc(var(--header-height) + 0.5rem); margin-bottom: var(--space-3); box-shadow: 0 0 0 0.5rem var(--canvas); }
.booking-category-nav[data-segment-enhanced] + .service-choice-form .booking-service-group > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.booking-category-nav[data-segment-enhanced] + .service-choice-form .booking-service-group + .booking-service-group { margin-top: 0; }


.service-choice-form .data-collection-notice {
  margin-top: var(--space-3);
  text-align: center;
}

.slot-time {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.service-choice-form + .small-note {
  margin-top: var(--space-3);
}

.booking-alternative {
  margin: var(--space-3) 0 0;
  color: var(--ink-soft);
  font-size: var(--step--1);
  text-align: center;
}

.edit-link {
  display: inline-flex;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  align-items: center;
  border-radius: 999px;
  color: var(--brand-deep);
  font-size: var(--step--1);
  font-weight: var(--weight-strong);
  white-space: nowrap;
}

.edit-link:hover {
  background: var(--mint);
}

.form-card > .small-note {
  margin: 0;
}

.booking-facts {
  margin-bottom: var(--space-4);
}

/* Date control: always visible, one change = one request */
.date-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.date-toolbar label {
  color: var(--ink-soft);
  font-size: var(--step--1);
  font-weight: var(--weight-body);
}

.date-toolbar input[type="date"] {
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  background: var(--fill);
  color: var(--brand-deep);
  font-size: max(1rem, var(--step-0));
  font-weight: var(--weight-medium);
}

.date-toolbar input[type="date"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.date-toolbar .errorlist {
  flex-basis: 100%;
}

.slot-search-help,
.slot-search-result {
  margin: 0 0 var(--space-3);
  font-size: var(--step--1);
}

.slot-search-help {
  color: var(--ink-soft);
}

/* Slot picker (booking and reschedule) */
.slot-picker,
.reschedule-picker {
  display: grid;
  gap: 0.75rem;
}

/* One day at a time: a horizontal strip of day chips above that day's times. */
.slots-toolbar { display: flex; margin-bottom: var(--space-2); align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
.slots-toolbar .group-title { margin: 0; padding: 0; }
.day-strip { display: flex; margin: 0 -1rem var(--space-3); padding: 0.25rem 1rem 0.5rem; gap: 0.5rem; overflow-x: auto; scroll-padding-inline: 1rem; scroll-snap-type: x proximity; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip :is(a, button) { position: relative; }
.day-strip a { display: grid; min-width: 3.6rem; padding: 0.45rem 0.5rem 0.5rem; flex: 0 0 auto; justify-items: center; gap: 0.05rem; border-radius: var(--radius-m); background: var(--paper); box-shadow: var(--tile-shadow); color: var(--ink); line-height: 1.15; scroll-snap-align: start; }
.day-strip a > span:not(.visually-hidden) { color: var(--ink-soft); font-size: 0.6875rem; font-weight: var(--weight-medium); text-transform: uppercase; }
.day-strip a > strong { font-size: var(--step-1); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.day-strip a[aria-current="true"] { background: var(--brand); color: var(--paper); }
.day-strip a[aria-current="true"] > span:not(.visually-hidden) { color: color-mix(in srgb, var(--paper) 82%, transparent); }
.day-strip form { display: flex; margin: 0; }
.day-strip button { padding-inline: 0.85rem; border: 0; border-radius: var(--radius-m); background: color-mix(in srgb, var(--brand) 11%, var(--paper)); color: var(--brand-deep); font-weight: var(--weight-medium); white-space: nowrap; }
/* Without JavaScript the links jump below the sticky category control and header. */
.booking-service-group > h2 { scroll-margin-top: calc(var(--header-height) + env(safe-area-inset-top) + 4.5rem); }
.review-confirmation .check-field:has([aria-invalid="true"]) { border-color: var(--danger); }

.slot-day {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.slot-day + .slot-day {
  margin-top: var(--space-3);
}

.day-strip[data-segment-enhanced] + form .slot-day {
  margin-top: 0;
}

.slot-day h3 {
  display: flex;
  width: 100%;
  margin: 0 0 var(--space-2);
  padding-inline: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--ink);
  font-size: var(--step-0);
  font-weight: var(--weight-strong);
  letter-spacing: -0.005em;
}

.slot-day-count {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: var(--step--1);
  font-weight: var(--weight-body);
  letter-spacing: 0;
}

.slot-day .slot-grid {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.slot-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.slot-time,
.slot-choice label {
  display: grid;
  min-width: 0;
  min-height: 3rem;
  padding: 0.6rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  background: var(--paper);
  box-shadow: var(--tile-shadow);
  color: var(--brand-deep);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.slot-time:hover,
.slot-choice label:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  background: var(--paper);
}

.slot-time:active {
  background: var(--brand);
  color: var(--paper);
}

.slot-time:focus-visible {
  position: relative;
  z-index: 1;
}

.slot-choice {
  position: relative;
}

.slot-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  inset: 50% auto auto 50%;
}

.slot-choice input:focus-visible + label {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

.slot-choice input:checked + label {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--paper);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--brand);
}

/* In flow until a time is chosen, then pinned above the tab bar: it never hides the times
   still to choose from. */
.reschedule-picker:has(:checked) .reschedule-action {
  position: sticky;
}

.reschedule-action {
  z-index: 4;
  bottom: var(--space-2);
  display: flex;
  padding: var(--space-2);
  justify-content: flex-end;
  border: 0;
  border-radius: var(--radius-m);
  background: rgb(255 255 255 / 95%);
  box-shadow: var(--shadow);
}

@media (max-width: 48rem) {
  .reschedule-action {
    bottom: calc(4.6rem + var(--space-2) + env(safe-area-inset-bottom));
  }
}

/* Radio choices rendered by widgets/radio_option.html (guest contact channel) */
.form-field fieldset input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.choice-option {
  display: flex;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  cursor: pointer;
  font-weight: var(--weight-medium);
}

.choice-option-mark {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.form-field fieldset input[type="radio"]:checked + .choice-option {
  border-color: var(--brand);
  background: var(--mint);
  color: var(--brand-deep);
}

.form-field fieldset input[type="radio"]:checked + .choice-option .choice-option-mark {
  border: 0.35rem solid var(--brand);
  background: var(--paper);
}

.form-field fieldset input[type="radio"]:focus-visible + .choice-option {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.2rem;
}

/* Step 4: review */
.review-summary {
  display: grid;
  margin: 0;
}

.review-summary > div {
  display: grid;
  padding-block: var(--space-2);
  gap: var(--space-2);
  border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(7.5rem, 0.3fr) minmax(0, 1fr);
}

.review-summary dt {
  color: var(--ink-soft);
  font-size: var(--step--1);
  font-weight: var(--weight-strong);
}

.review-summary dd {
  display: flex;
  min-width: 0;
  margin: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-weight: var(--weight-strong);
}

.review-essential {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-s);
  background: var(--mint);
}

.review-essential p {
  font-size: var(--step--1);
}

.review-essential p:last-child {
  margin-bottom: 0;
}

.review-confirmation {
  margin-top: var(--space-3);
}

.review-confirmation .button {
  width: 100%;
}

/* Confirmation */
.confirmation-card h2 {
  margin-block: var(--space-2) 0.25rem;
}

.confirmation-time {
  margin: 0;
  font-size: var(--step-1);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}

.confirmation-time + .muted {
  margin: var(--space-2) 0 0;
}

/* Mon espace: appointment list and detail */
.appointment-section-title {
  margin-top: var(--space-4);
}

.appointment-history > div > h2 {
  font-size: var(--step-1);
}

.appointment-history .record-list {
  margin-bottom: var(--space-3);
}

.appointment-next-step {
  margin: 0;
}

.appointment-disclosure {
  margin-top: 0;
  border-top: 0;
}

@media (max-width: 48rem) {
  .slot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .review-summary > div {
    gap: 0.3rem;
    grid-template-columns: 1fr;
  }

  .review-summary dd {
    align-items: start;
    flex-direction: column;
  }

  .review-summary .edit-link {
    margin-left: -0.75rem;
  }
}

@media (max-width: 30rem) {
  .date-toolbar {
    position: relative;
    width: 100%;
    justify-content: space-between;
    inset-inline-end: auto;
  }

  .date-toolbar .button,
  .reschedule-action .button {
    width: 100%;
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .slot-time,
  .slot-choice label {
    min-height: 2.75rem;
    padding-inline: 0.35rem;
  }

  .reschedule-action {
    justify-content: stretch;
  }
}

@media (max-width: 22rem) {
  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
