/*
 * Booking widget — self-contained styles.
 *
 * No Tailwind, no build step: this has to drop into the legacy Framer export
 * (which is plain HTML) as readily as into Astro, and survive a frontend
 * rewrite. Tokens are mirrored from site-next/src/styles/global.css rather
 * than imported, for the same reason.
 *
 * Everything is scoped under .sb — the legacy pages carry Framer's own global
 * CSS and the two must not collide.
 */

.sb {
  --sb-ink: #111;
  --sb-text: #212121;
  --sb-muted: #707070;
  --sb-surface: #fff;
  --sb-line: #e4e4e4;
  --sb-lav: #cdbaf4;
  --sb-lav-deep: #956adc;
  --sb-lime: #dcff7e;
  --sb-orange: #ff652d;

  --sb-radius: 14px;
  --sb-gap: 1rem;

  box-sizing: border-box;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  font-family: "Inter", "Inter Display", system-ui, -apple-system, sans-serif;
  color: var(--sb-text);
  font-size: 16px;
  line-height: 1.5;
}
.sb *,
.sb *::before,
.sb *::after { box-sizing: inherit; }

/* ---------- stepper ---------- */

.sb-steps {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.sb-steps li {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--sb-line);
}
.sb-steps li[data-state="done"] { background: var(--sb-lav-deep); }
.sb-steps li[data-state="current"] { background: var(--sb-lav); }

.sb-h {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sb-ink);
}
.sb-sub {
  margin: 0 0 1.25rem;
  color: var(--sb-muted);
  font-size: 0.9375rem;
}

/* ---------- service cards ---------- */

.sb-services { display: grid; gap: 0.75rem; }

.sb-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.25rem 1rem;
  width: 100%;
  padding: 1rem 1.125rem;
  text-align: left;
  background: var(--sb-surface);
  border: 1.5px solid var(--sb-line);
  border-radius: var(--sb-radius);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.08s;
}
.sb-card:hover { border-color: var(--sb-lav); }
.sb-card:active { transform: translateY(1px); }
.sb-card[aria-pressed="true"] {
  border-color: var(--sb-lav-deep);
  background: color-mix(in srgb, var(--sb-lav) 14%, #fff);
}

/* All four cells are placed explicitly. With only grid-row set on the price,
   auto-placement put it in column 1 and pushed the name to the right. */
.sb-card-name { grid-area: 1 / 1; font-weight: 600; font-size: 1.0625rem; color: var(--sb-ink); }
.sb-card-price { grid-area: 1 / 2; text-align: right; font-weight: 600; white-space: nowrap; }
.sb-card-tag { grid-area: 2 / 1; color: var(--sb-muted); font-size: 0.9375rem; }
.sb-card-meta { grid-area: 2 / 2; text-align: right; font-size: 0.8125rem; color: var(--sb-muted); white-space: nowrap; }

/* ---------- calendar + slots ---------- */

.sb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sb-cal-month { font-weight: 600; text-transform: capitalize; }

/* Capped: across the full 46rem the cells become ~95px squares, which reads as
   a wall-planner rather than a date picker. */
.sb-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-width: 23rem;
  margin: 0 auto;
}
.sb-dow {
  text-align: center;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sb-muted);
  padding-bottom: 0.375rem;
}
.sb-day {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  color: inherit;
  cursor: pointer;
}
.sb-day:hover:not(:disabled) { background: color-mix(in srgb, var(--sb-lav) 25%, #fff); }
.sb-day:disabled { color: #c9c9c9; cursor: default; }
.sb-day[aria-pressed="true"] { background: var(--sb-ink); color: #fff; font-weight: 600; }
/* A dot marks days that actually have free slots, so the client can see
   availability without clicking through every day. An inset box-shadow was
   tried first and rendered as a full-width bar. */
.sb-day[data-free="1"]:not([aria-pressed="true"])::after {
  content: "";
  position: absolute;
  bottom: 0.3rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sb-lav-deep);
}

.sb-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.sb-slot {
  padding: 0.625rem 0.25rem;
  border: 1.5px solid var(--sb-line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.sb-slot:hover { border-color: var(--sb-lav); }
.sb-slot[aria-pressed="true"] { border-color: var(--sb-ink); background: var(--sb-ink); color: #fff; font-weight: 600; }

/* ---------- backdrop swatches ---------- */

.sb-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.75rem;
}
.sb-swatch {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  padding: 0.75rem 0.5rem;
  border: 1.5px solid var(--sb-line);
  border-radius: var(--sb-radius);
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}
.sb-swatch:hover { border-color: var(--sb-lav); }
.sb-swatch[aria-pressed="true"] {
  border-color: var(--sb-ink);
  /* Outside the swatch, not inset: an inset ring eats into the colour and on
     the black backdrop it was invisible. */
  box-shadow: 0 0 0 2px var(--sb-surface), 0 0 0 4px var(--sb-ink);
}
.sb-chip {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  /* A white backdrop needs a visible edge on a white card. */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

/* ---------- fields ---------- */

.sb-field { display: grid; gap: 0.375rem; margin-bottom: 1rem; }
.sb-label { font-weight: 500; font-size: 0.9375rem; }
.sb-help { color: var(--sb-muted); font-size: 0.8125rem; }
.sb-input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--sb-line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.sb-input:focus { outline: 2px solid var(--sb-orange); outline-offset: 1px; border-color: transparent; }
.sb-input[aria-invalid="true"] { border-color: var(--sb-orange); }

.sb-check { display: flex; gap: 0.625rem; align-items: flex-start; }
.sb-check input { margin-top: 0.2rem; width: 1.1rem; height: 1.1rem; accent-color: var(--sb-lav-deep); }

/* ---------- payment choice ---------- */

.sb-pay { display: grid; gap: 0.75rem; margin: 1rem 0; }
.sb-pay-opt {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  border: 1.5px solid var(--sb-line);
  border-radius: var(--sb-radius);
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
/* Hover says "you can click this"; the ring says "this is what you chose".
   The two must not look alike, or the choice reads as a hover that stuck. */
.sb-pay-opt:hover { border-color: var(--sb-lav); }
.sb-pay-opt[aria-pressed="true"] {
  border-color: var(--sb-lav-deep);
  box-shadow: 0 0 0 1.5px var(--sb-lav-deep);
  background: color-mix(in srgb, var(--sb-lav) 14%, #fff);
}
.sb-pay-amt { font-weight: 600; font-size: 1.125rem; color: var(--sb-ink); }
.sb-pay-note { color: var(--sb-muted); font-size: 0.875rem; }

/* ---------- code ---------- */

.sb-code-row { display: flex; gap: 0.5rem; }
.sb-code-row .sb-input { flex: 1; text-transform: none; }
.sb-note {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  font-size: 0.875rem;
}
.sb-note[data-tone="ok"] { background: color-mix(in srgb, var(--sb-lime) 45%, #fff); }
.sb-note[data-tone="bad"] { background: color-mix(in srgb, var(--sb-orange) 15%, #fff); }
.sb-note[data-tone="warn"] { background: color-mix(in srgb, var(--sb-orange) 10%, #fff); }

/* ---------- confirmation ---------- */

/* The end of the flow, so it stands on its own rather than under a step list. */
.sb-done-head { display: flex; align-items: center; gap: 0.625rem; }
.sb-tick {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 999px;
  background: var(--sb-lime);
  color: var(--sb-ink);
  font-weight: 700;
}
.sb-done .sb-h { margin: 0; }
.sb-done .sb-note { margin-top: 0.75rem; }
.sb-done .sb-sub { margin: 0.5rem 0 0; }
.sb-done .sb-btn { flex: 0 0 auto; }

/* Headings take focus so the step change is announced. They are not
   interactive, so the ring the browser draws around them is only noise. */
.sb-h:focus { outline: none; }

/* ---------- summary + buttons ---------- */

.sb-summary {
  margin: 1.25rem 0;
  padding: 1rem 1.125rem;
  border-radius: var(--sb-radius);
  background: #f7f6fb;
  font-size: 0.9375rem;
}
.sb-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 0.375rem 1rem; margin: 0; }
.sb-summary dt { color: var(--sb-muted); }
.sb-summary dd { margin: 0; text-align: right; }
.sb-summary .sb-total { font-weight: 600; font-size: 1.0625rem; color: var(--sb-ink); }

/* ---------- terms, consent, data ---------- */

.sb-terms {
  margin: 1.25rem 0 1rem;
  padding: 0.875rem 1.125rem;
  border-radius: var(--sb-radius);
  border: 1.5px solid var(--sb-line);
  font-size: 0.875rem;
}
.sb-terms-h { margin: 0 0 0.375rem; font-weight: 600; color: var(--sb-ink); }
.sb-terms ul { margin: 0; padding-left: 1.1rem; color: var(--sb-muted); }
.sb-terms li { margin: 0.125rem 0; }

.sb-consent { margin: 0 0 1rem; }
.sb-consent-intro { margin: 0 0 0.5rem; font-size: 0.9375rem; font-weight: 600; color: var(--sb-ink); }
.sb-consent-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.625rem;
  margin: 0.375rem 0;
}
.sb-check { width: 1.15rem; height: 1.15rem; margin: 0.1rem 0 0; accent-color: var(--sb-lav-deep); }
.sb-consent-text { font-size: 0.9375rem; line-height: 1.45; }
.sb-consent-label { cursor: pointer; }
.sb-consent-link { color: var(--sb-lav-deep); text-decoration: none; }
/* Lines up under the labels, not under the tickboxes. */
.sb-consent > .sb-help { display: block; margin-left: 1.775rem; }

.sb-legal { font-size: 0.8125rem; color: var(--sb-muted); }
.sb-legal strong { display: block; color: var(--sb-ink); font-size: 0.875rem; }
.sb-legal p { margin: 0.2rem 0 0; }

.sb-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.sb-btn {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sb-btn[data-kind="primary"] { background: var(--sb-lav); color: var(--sb-ink); }
.sb-btn[data-kind="primary"]:hover { background: var(--sb-lav-deep); color: #fff; }
.sb-btn[data-kind="ghost"] { flex: 0 0 auto; background: transparent; color: var(--sb-muted); }
.sb-btn:disabled { opacity: 0.45; cursor: default; }

.sb-error {
  margin: 1rem 0;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sb-orange) 15%, #fff);
  font-size: 0.9375rem;
}

.sb-skeleton {
  height: 4.5rem;
  border-radius: var(--sb-radius);
  background: linear-gradient(90deg, #f2f2f2 25%, #e9e9e9 37%, #f2f2f2 63%);
  background-size: 400% 100%;
  animation: sb-shimmer 1.2s ease-in-out infinite;
}
@keyframes sb-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .sb-skeleton { animation: none; }
  .sb-card, .sb-btn { transition: none; }
}

.sb-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
