/* The booking card of a class at a made-up studio, alone on white. The card is one element moved by GSAP (the 2px
   lift); its shadow is a child that only the CSS touches. Every element GSAP moves (the card, the seats, the button,
   the token, the pointer) has no transform in the CSS: the look lives in their children. */
:root {
  --page: #ffffff;            /* the page */
  --card: #ffffff;            /* the card */
  --card-low: #fbfaf8;        /* the bottom of the card, a warm white */
  --line: #ebe9ee;            /* the hairlines and the free seats' outline */
  --ink: #16151b;             /* the words and the button */
  --muted: #8d8a96;           /* the small words */
  --taken: #dddae2;           /* a seat somebody already has */
  --accent: #3d5afe;          /* your seat, the check, the loading arc */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(328px, calc(100vw - 32px));
}

.card__shadow {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  box-shadow:
    0 1px 1px rgba(22, 21, 27, 0.04),
    0 4px 10px -2px rgba(22, 21, 27, 0.06),
    0 18px 36px -18px rgba(22, 21, 27, 0.16);
  transition: box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card.is-hot .card__shadow {
  box-shadow:
    0 1px 1px rgba(22, 21, 27, 0.04),
    0 8px 18px -4px rgba(22, 21, 27, 0.09),
    0 30px 56px -22px rgba(22, 21, 27, 0.26);
}

.card__body {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-low) 100%);
  padding: clamp(16px, 5.4vmin, 22px) clamp(16px, 5.4vmin, 22px) clamp(16px, 5vmin, 20px);
  display: grid;
  gap: clamp(10px, 3.4vmin, 15px);
}

/* the 1px edge that catches the light on top */
.card__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(22, 21, 27, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* a very soft light that slides across the card when it lifts */
.card__sheen {
  position: absolute;
  inset: -40% -20%;
  pointer-events: none;
  background: radial-gradient(40% 30% at var(--sx, 30%) 0%, rgba(61, 90, 254, 0.07), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.card.is-hot .card__sheen { opacity: 1; }

/* ---- the top row ---- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.brand__mark { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.brand__room { font-weight: 450; color: var(--muted); padding-left: 6px; border-left: 1px solid var(--line); }

.level { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.level__bars { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 12px; }
.bar { width: 3.5px; border-radius: 1.5px; background: var(--taken); }
.bar.is-on { background: var(--ink); }

/* ---- the name ---- */
.name {
  font-size: clamp(23px, 7.6vmin, 28px);
  line-height: 1.04;
  font-weight: 640;
  font-variation-settings: "wdth" 96;
  letter-spacing: -0.022em;
  margin-top: 2px;
}

/* ---- the instructor and the time ---- */
.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.coach { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg, #e9e6ee, #ffffff, #d9d5df, #e9e6ee);
}
.avatar__in {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #f6f3ee 0%, #e4ddd3 70%, #d6cec2 100%);
  box-shadow: inset 0 -2px 4px rgba(22, 21, 27, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 660;
  letter-spacing: 0.04em;
  color: #4a4450;
}
.coach__text, .when { display: grid; gap: 1px; }
.coach__text b, .when b { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; }
.coach__text i, .when i { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.when { text-align: right; }
.when i { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.when svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* ---- the spots ---- */
.spots { display: grid; gap: 10px; padding-top: clamp(10px, 3.4vmin, 14px); border-top: 1px solid var(--line); }
.spots__head { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; }
.spots__total { color: var(--muted); }

.count {
  position: relative;
  display: inline-block;
  height: 1.3em;
  line-height: 1.3em;
  overflow: hidden;
  font-weight: 600;
  font-variation-settings: "wdth" 100;
  min-width: 7.5em;
}
.count__line { position: absolute; left: 0; top: 0; white-space: nowrap; }

.seats { display: flex; gap: clamp(4px, 1.6vmin, 6px); height: clamp(22px, 7vmin, 28px); }
.seat { position: relative; flex: 1 1 0; max-width: 22px; }
.seat__in {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1.2px #d3d0d9;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
/* the headrest of the reformer, a short line at the top */
.seat__in::before {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  top: 4px;
  height: 1.5px;
  border-radius: 1px;
  background: #d3d0d9;
  transition: background-color 0.35s ease;
}
.seat.is-taken .seat__in { background: var(--taken); box-shadow: inset 0 0 0 1px rgba(22, 21, 27, 0.04), inset 0 -2px 3px rgba(22, 21, 27, 0.05); }
.seat.is-taken .seat__in::before { background: rgba(255, 255, 255, 0.8); }
.seat.is-you .seat__in {
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px -3px var(--accent-soft, rgba(61, 90, 254, 0.5));
}
.seat.is-you .seat__in::before { background: rgba(255, 255, 255, 0.75); }
.seat__ring {
  position: absolute;
  inset: -4px;
  border-radius: 9px;
  border: 1.5px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}

/* the flying spot: same size as a seat, accent colour */
.token {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 6px;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 16px -6px var(--accent-soft, rgba(61, 90, 254, 0.6));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 3;
}

/* ---- the action row ---- */
.action { position: relative; height: 48px; margin-top: 2px; }

.book {
  position: absolute;
  top: 0;
  left: 50%;
  height: 48px;
  width: 100%;
  border-radius: 999px;
  color: #ffffff;
  overflow: hidden;
  display: grid;
  place-items: center;
  outline: none;
}
.book__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #2a2932 0%, var(--ink) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 14px -6px rgba(22, 21, 27, 0.5);
  transition: filter 0.3s ease;
}
.book__word {
  position: relative;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  font-variation-settings: "wdth" 100;
  transition: font-variation-settings 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
  white-space: nowrap;
}
.book__spin { position: absolute; width: 24px; height: 24px; opacity: 0; fill: none; stroke-width: 2.2; }
.book__track { stroke: rgba(255, 255, 255, 0.16); }
.book__arc { stroke: var(--accent-light, #8ea0ff); stroke-linecap: round; stroke-dasharray: 14 60; }
.book:focus-visible .book__fill, .wait:focus-visible, .cal:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

@media (hover: hover) {
  .book:hover .book__word { font-variation-settings: "wdth" 112; }
  .book:hover .book__fill { filter: brightness(1.18); }
  .wait:hover { background: #f5f4f7; }
  .cal:hover .cal__line { color: var(--ink); }
}

.wait {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid #d6d3dc;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: background-color 0.25s ease;
  outline: none;
}
.wait__bell { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

.done {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 2px;
  opacity: 0;
  visibility: hidden;
}
.done__ic {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px -6px var(--accent-soft, rgba(61, 90, 254, 0.6));
}
.done__ic svg { width: 22px; height: 22px; fill: none; stroke: #ffffff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.done__text { display: grid; gap: 2px; min-width: 0; }
.done__text b { font-size: 14.5px; font-weight: 620; letter-spacing: -0.005em; white-space: nowrap; }

.cal {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 560;
  color: var(--accent);
  padding: 1px 0;
  border-radius: 4px;
  outline: none;
}
.cal__ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cal__tick { opacity: 0; }
.cal__roll { position: relative; display: inline-block; height: 1.3em; line-height: 1.3em; overflow: hidden; min-width: 9.6em; }
.cal__line { position: absolute; left: 0; top: 0; white-space: nowrap; transition: color 0.25s ease; }

/* ---- the drawn pointer of the autopilot ---- */
.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #16151b;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-height: 460px) {
  .card__body { gap: 9px; }
  .avatar { width: 32px; height: 32px; }
}

/* the seat you would get, shown while the pointer is on Book spot */
.seat.is-next .seat__in { box-shadow: inset 0 0 0 1.5px var(--accent); }
.seat.is-next .seat__in::before { background: var(--accent); }

/* On the waitlist */
.wait.is-on { border-color: var(--accent); color: var(--accent); }
.wait.is-on .wait__bell { stroke: var(--accent); }
.wait__roll { position: relative; display: inline-block; height: 1.3em; line-height: 1.3em; overflow: hidden; }
.wait__line { display: block; white-space: nowrap; }
