/* The team seats slider with the price tiers that fuse together: the seats picker of a team plan checkout, alone on
   white. The track is three tiles with a notch between them; script.js closes a notch when the fill crosses it,
   sends a light along the join and rolls the numbers. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the body of the card */
  --edge: rgba(16, 20, 34, 0.08); /* the hairline edge */
  --ink: #0e1118;           /* the words */
  --muted: #7a808c;         /* the small words */
  --base: #eceef3;          /* the empty track */
  --tick: #d3d6de;          /* the ticks */
  --accent: #4a4ff0;        /* the fill and the discount */
  --accent-2: #8a7bff;      /* the light end of the fill */
  --warn: #c86a12;          /* the limit: more than 50 seats */
}

* { box-sizing: border-box; }

html { touch-action: manipulation; }

html,
body { margin: 0; overflow-x: clip; }

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vh, 40px) 4vw;
  overflow: hidden;
}

/* ---------- the card ---------- */
.seats {
  position: relative;
  width: min(400px, 92vw);
  padding: clamp(16px, 3.6vh, 24px) clamp(18px, 5vw, 26px) clamp(14px, 3vh, 20px);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--edge),
    0 1px 1px rgba(16, 20, 34, 0.04),
    0 6px 14px -6px rgba(16, 20, 34, 0.08),
    0 26px 48px -22px rgba(40, 44, 120, 0.18);
}

.seats__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 245, 250, 0.6) 60%, rgba(255, 255, 255, 0));
  opacity: 0.6;
}

.seats__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seats__plan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
}

.seats__mark { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.6; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 26px;
  line-height: 1.1;
  white-space: nowrap;
  padding: 0 10px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f3f4f7;
  box-shadow: inset 0 0 0 1px rgba(16, 20, 34, 0.06);
  transition: color 0.35s, background-color 0.35s, box-shadow 0.35s;
}

.chip.is-on {
  color: var(--accent);
  background: #eef0ff;
  box-shadow: inset 0 0 0 1px rgba(74, 79, 240, 0.18);
}

.chip__sheen {
  position: absolute;
  inset: -4px auto -4px 0;
  width: 18px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  transform: translateX(-30px) skewX(-18deg);
  pointer-events: none;
}

/* ---------- the numbers ---------- */
.count {
  position: relative;
  margin: clamp(10px, 2.6vh, 18px) 0 2px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(38px, min(12vw, 9vh), 52px);
  line-height: 1;
  font-weight: 640;
  letter-spacing: -0.035em;
}

.count__word {
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
  font-stretch: 100%;
}

.price {
  position: relative;
  margin: 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  line-height: 1.1;
  font-size: 14px;
  font-weight: 600;
}

.price__soft { color: var(--muted); font-weight: 450; }
.price__total { font-size: 15px; }

.roll {
  display: inline-flex;
  vertical-align: top;
}

.roll__col {
  position: relative;
  display: inline-block;
  height: 1.1em;
  line-height: 1.1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.roll__strip { display: flex; flex-direction: column; }
.roll__strip > span { height: 1.1em; text-align: center; }
.roll__fixed { display: inline-block; height: 1.1em; line-height: 1.1; }

/* ---------- the slider ---------- */
.slider {
  position: relative;
  margin-top: clamp(16px, 3.6vh, 24px);
  padding: 10px 0 0;
  outline: none;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.slider.is-held { cursor: grabbing; }

.track {
  position: relative;
  height: 28px;
}

.track__base,
.track__fill {
  position: absolute;
  left: 0;
  top: 8px;
  height: 12px;
  border-radius: 6px;
}

.track__base {
  right: 0;
  background: var(--base);
  box-shadow: inset 0 1px 1.5px rgba(16, 20, 34, 0.08);
}

.track__fill {
  width: 0;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 2px 8px -2px rgba(74, 79, 240, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.track__seal {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0;
  width: 46px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: translateX(-60px) skewX(-20deg);
}

/* the notch between two tiles: a white cut through the track */
.notch {
  position: absolute;
  top: 5px;
  width: 5px;
  height: 18px;
  margin-left: -2.5px;
  border-radius: 2px;
  background: var(--card);
  transform-origin: 50% 50%;
}

.track__end {
  position: absolute;
  right: -4px;
  top: 4px;
  width: 30px;
  height: 20px;
  border-radius: 10px;
  background: radial-gradient(closest-side, rgba(200, 106, 18, 0.32), transparent);
  opacity: 0;
  pointer-events: none;
}

.thumb {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  margin-left: -14px;
}

.thumb__knob {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #f3f4f8);
  box-shadow:
    0 0 0 1px rgba(16, 20, 34, 0.1),
    0 1px 2px rgba(16, 20, 34, 0.12),
    0 6px 14px -4px rgba(40, 44, 120, 0.3);
  transition: box-shadow 0.25s;
}

.thumb__grip {
  width: 8px;
  height: 8px;
  border-left: 1.5px solid #c4c8d2;
  border-right: 1.5px solid #c4c8d2;
}

.slider:focus-visible .thumb__knob {
  box-shadow:
    0 0 0 1px rgba(16, 20, 34, 0.1),
    0 0 0 4px #fff,
    0 0 0 6px var(--accent),
    0 6px 14px -4px rgba(40, 44, 120, 0.3);
}

.slider.is-limit .thumb__knob {
  box-shadow:
    0 0 0 1.5px var(--warn),
    0 1px 2px rgba(16, 20, 34, 0.12),
    0 6px 14px -4px rgba(200, 106, 18, 0.35);
}

@media (hover: hover) {
  .slider:hover .thumb__knob {
    box-shadow:
      0 0 0 1px rgba(16, 20, 34, 0.14),
      0 2px 3px rgba(16, 20, 34, 0.12),
      0 10px 20px -6px rgba(40, 44, 120, 0.36);
  }
}

.ticks {
  position: relative;
  height: 12px;
  margin-top: 2px;
}

.ticks > span {
  position: absolute;
  top: 0;
  width: 1px;
  height: 10px;
  margin-left: -0.5px;
  background: var(--tick);
  transform-origin: 50% 0;
  transform: scaleY(0.4);
}

.ticks > span.is-major { background: #b8bcc7; }

.scale {
  position: relative;
  height: 14px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.scale > span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

/* ---------- the line below ---------- */
.hint {
  position: relative;
  margin: clamp(10px, 2.4vh, 16px) 0 0;
  height: 20px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.hint__line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.hint__line svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hint__line b { font-weight: 640; color: var(--ink); }
.hint__line.is-save { color: var(--accent); }
.hint__line.is-save b { color: var(--accent); }
.hint__line.is-warn { color: var(--warn); }
.hint__line.is-warn b { color: var(--warn); }

/* ---------- the pilot's pointer ---------- */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  fill: #0e1118;
  stroke: #fff;
  stroke-width: 1.4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .ghost { display: none; }
  .chip, .thumb__knob { transition: none; }
}
