/* Booking calendar, adapted from the lead magnet's static/booking.css and
 * restyled with this site's tokens (site.css): --brand, --ink, --ink-soft,
 * --muted, --surface, --line, --tint, --error, --body. */

.booking-status {
  margin: 22px 0 0;
  min-height: 24px;
  font-size: 15px;
  color: var(--muted);
}

.booking-step {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.booking-step-first { margin-top: 18px; }

fieldset.booking-step {
  min-width: 0;
  padding: 0;
  border: 0;
}

/* A fieldset draws its top border through the legend's middle, so the
   fieldset steps carry the separator on the legend instead. */
fieldset.booking-step legend {
  width: 100%;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.booking-label,
.booking-step legend {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.booking-step legend span {
  margin-left: 5px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.booking-calendar {
  width: min(100%, 470px);
  margin-inline: auto;
}

.booking-calendar-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.booking-calendar-month {
  /* stays centered even when the single-month nav arrows are hidden */
  grid-column: 2;
  grid-row: 1;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: var(--ink);
}

.booking-calendar-nav {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 21px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}

.booking-calendar-nav:hover:not(:disabled) { background: var(--tint); }

.booking-calendar-nav:disabled {
  color: color-mix(in srgb, var(--muted) 35%, var(--surface));
  cursor: default;
}

.booking-calendar-weekdays,
.booking-dates {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.booking-calendar-weekdays { margin-bottom: 5px; }

.booking-calendar-weekdays span {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  color: var(--muted);
}

.booking-calendar-blank,
.booking-calendar-day,
.booking-date {
  display: grid;
  place-items: center;
  justify-self: center;
  /* cells track the grid column so seven always fit; capped at 44px */
  width: 100%;
  max-width: 44px;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 500;
}

.booking-calendar-day {
  font-weight: 400;
  color: var(--muted);
  opacity: 0.4;
}

.booking-calendar-day.is-today {
  opacity: 0.7;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.booking-date {
  padding: 0;
  border: 1px solid transparent;
  background: var(--tint);
  color: var(--ink);
  cursor: pointer;
}

@media (hover: hover) {
  .booking-date:hover { border-color: var(--ink-soft); }
}

.booking-date[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.booking-date.is-today:not([aria-pressed="true"]) {
  box-shadow: inset 0 0 0 1px var(--ink-soft);
}

.booking-times {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.booking-time {
  min-height: 48px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}

@media (hover: hover) {
  .booking-time:hover { border-color: var(--ink-soft); }
}

.booking-time[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.booking-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.booking-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.booking-field span {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.booking-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
}

.booking-field input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.booking-field.is-invalid input { border-color: var(--error); }

.booking-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.booking-submit,
.booking-again {
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 12px 20px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.booking-submit:disabled {
  /* only while the preview is being prepared */
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.booking-again {
  background: transparent;
  color: var(--ink);
}

@media (hover: hover) {
  .booking-again:hover { background: var(--tint); }
}

.booking-calendar-nav:focus-visible,
.booking-date:focus-visible,
.booking-time:focus-visible,
.booking-submit:focus-visible,
.booking-again:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.booking-error {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--error);
}

.booking-empty {
  grid-column: 1 / -1;
  padding: 12px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

/* success */

.booking-success { margin-top: 14px; }

.booking-success:focus { outline: none; }

.booking-success-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
  padding: 18px;
  border-radius: 12px;
  background: var(--tint);
  font-size: 15px;
}

.booking-success-details dt { color: var(--muted); }
.booking-success-details dd { overflow-wrap: anywhere; color: var(--ink); }

.booking-fineprint {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}

/* After a time is picked, Continue sticks to the bottom of the screen
   (thumb reach) until the details step opens. */
.booking-continue-wrap {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 18px -4px 0;
  padding: 10px 4px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255, 255, 255, 0), var(--surface) 30%);
}

.booking-continue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 22px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(42, 33, 28, 0.22);
}

.booking-continue-when { font-size: 15px; font-weight: 400; color: rgba(255, 255, 255, 0.85); }
.booking-continue-label { font-size: 15px; font-weight: 600; }

.booking-continue:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.empty-switch {
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .booking-date,
  .booking-time,
  .booking-submit,
  .booking-again {
    transition: border-color 120ms ease-out, background-color 120ms ease-out,
                color 120ms ease-out;
  }
}

@media (max-width: 560px) {
  .booking-times { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .booking-calendar { width: 100%; }
}
