/* ==========================================================================
   RYDE FITNESS — BOOK A TOUR MULTI-STEP MODAL
   Shared component. Opened by any element carrying [data-tour-open].
   ========================================================================== */

@property --tour-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes tourBorderRun {
  to {
    --tour-angle: 360deg;
  }
}

@keyframes tourPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tourShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(7px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

body.tour-open {
  overflow: hidden;
}

button.btn {
  font-family: inherit;
  cursor: pointer;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 3, 5, 0.74);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tour-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.tour-modal {
  position: relative;
  width: min(720px, 100%);
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(
      circle at 14% -12%,
      rgba(244, 2, 16, 0.2),
      transparent 46%
    ),
    linear-gradient(158deg, #15151a 0%, #0a0a0d 62%);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65);
  transform: scale(0.94) translateY(26px);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-backdrop.is-open .tour-modal {
  transform: scale(1) translateY(0);
}

.tour-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1.6px;
  pointer-events: none;
  background: conic-gradient(
    from var(--tour-angle),
    rgba(244, 2, 16, 0.3) 0deg,
    rgba(244, 2, 16, 0.3) 200deg,
    rgba(244, 2, 16, 0.7) 285deg,
    #f40210 330deg,
    #ff7b82 350deg,
    #f40210 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: tourBorderRun 4.5s linear infinite;
}

.tour-modal__body {
  position: relative;
  z-index: 1;
  max-height: 92vh;
  overflow-y: auto;
  padding: 34px 34px 28px;
}

.tour-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease,
    transform 0.25s ease;
}

.tour-modal__close:hover {
  background: #f40210;
  border-color: #f40210;
  transform: rotate(90deg);
}

.tour-modal__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f40210;
  margin-bottom: 8px;
}

.tour-modal__title {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.tour-modal__desc {
  margin: 0;
  max-width: 46ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
}

/* Stepper / indication bar */
.tour-steps {
  display: flex;
  align-items: center;
  margin: 26px 0;
}

.tour-steps__item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.tour-steps__dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.3s ease;
}

.tour-steps__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

.tour-steps__item.is-active .tour-steps__dot {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #f40210, #8a0109);
  box-shadow: 0 0 20px rgba(244, 2, 16, 0.6);
}

.tour-steps__item.is-active .tour-steps__label {
  color: #fff;
}

.tour-steps__item.is-done .tour-steps__dot {
  color: #fff;
  border-color: rgba(244, 2, 16, 0.6);
  background: rgba(244, 2, 16, 0.2);
}

.tour-steps__bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 40px;
  height: 2px;
  margin: 0 14px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.tour-steps__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #f40210, #ff7b82);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-steps__bar.is-filled::after {
  width: 100%;
}

/* Panels */
.tour-panel {
  display: none;
}

.tour-panel.is-active {
  display: block;
  animation: tourPanelIn 0.45s ease;
}

.tour-panel__lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

/* Branch cards (step 1) */
.tour-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tour-branch {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #101014;
  transition: transform 0.35s ease, border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.tour-branch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tour-branch__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.tour-branch__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.3) brightness(0.82);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.4s ease;
}

.tour-branch__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(6, 6, 9, 0.94),
    rgba(6, 6, 9, 0.25) 55%,
    rgba(6, 6, 9, 0) 100%
  );
}

.tour-branch__check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #f40210, #8a0109);
  box-shadow: 0 6px 18px rgba(244, 2, 16, 0.5);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tour-branch__info {
  display: block;
  padding: 14px 16px 18px;
}

.tour-branch__name {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.tour-branch__addr {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
}

.tour-branch:hover,
.tour-branch:focus-within {
  border-color: rgba(244, 2, 16, 0.55);
}

.tour-branch:hover .tour-branch__img {
  transform: scale(1.07);
}

.tour-branch.is-selected {
  border-color: #f40210;
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(244, 2, 16, 0.55),
    0 20px 44px rgba(244, 2, 16, 0.28);
}

.tour-branch.is-selected .tour-branch__img {
  filter: grayscale(0) brightness(0.95);
}

.tour-branch.is-selected .tour-branch__check {
  opacity: 1;
  transform: scale(1);
}

.tour-branches.shake {
  animation: tourShake 0.4s ease;
}

.tour-error {
  display: none;
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #ff6b72;
}

.tour-error.is-visible {
  display: block;
}

/* Selected club strip (step 2) */
.tour-selected-club {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(244, 2, 16, 0.35);
  background: linear-gradient(
    120deg,
    rgba(244, 2, 16, 0.14),
    rgba(244, 2, 16, 0.02)
  );
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.75);
}

.tour-selected-club svg {
  flex: 0 0 auto;
  color: #f40210;
}

.tour-selected-club strong {
  color: #fff;
}

/* Material fields */
.tour-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tour-field {
  position: relative;
}

.tour-field__input {
  width: 100%;
  padding: 22px 16px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease;
}

.tour-field__input:focus {
  outline: none;
  border-color: #f40210;
  background: rgba(244, 2, 16, 0.06);
  box-shadow: 0 0 0 3px rgba(244, 2, 16, 0.14);
}

.tour-field__label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease,
    letter-spacing 0.2s ease;
}

.tour-field__input:focus + .tour-field__label,
.tour-field__input:not(:placeholder-shown) + .tour-field__label,
.tour-field--date .tour-field__label {
  top: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #ff5b64;
}

.tour-field--date .tour-field__input {
  color-scheme: dark;
}

/* Chip groups */
.tour-group {
  margin-top: 22px;
}

.tour-group-label {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.tour-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tour-chip {
  position: relative;
}

.tour-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tour-chip > span {
  display: inline-flex;
  align-items: center;
  padding: 11px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.25s ease;
}

.tour-chip:hover > span,
.tour-chip:focus-within > span {
  border-color: rgba(244, 2, 16, 0.6);
  color: #fff;
}

.tour-chip.is-selected > span {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #f40210, #8a0109);
  box-shadow: 0 10px 24px rgba(244, 2, 16, 0.32);
}

/* Footer actions */
.tour-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-foot [hidden] {
  display: none !important;
}

.tour-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.tour-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.tour-btn--ghost:hover {
  border-color: #f40210;
  color: #ff6b72;
}

.tour-btn--primary {
  flex: 1 1 auto;
  color: #fff;
  background: linear-gradient(135deg, #f40210, #a8010b);
  box-shadow: 0 14px 34px rgba(244, 2, 16, 0.38);
}

.tour-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(244, 2, 16, 0.52);
}

@media (prefers-reduced-motion: reduce) {
  .tour-modal::before,
  .tour-panel.is-active,
  .tour-branches.shake {
    animation: none;
  }
}

@media (max-width: 640px) {
  .tour-backdrop {
    padding: 12px;
  }

  .tour-modal__body {
    padding: 26px 20px 22px;
  }

  .tour-branches,
  .tour-form-grid {
    grid-template-columns: 1fr;
  }

  .tour-steps__label {
    display: none;
  }

  .tour-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .tour-btn {
    width: 100%;
  }
}
