/* Live-site help tour chrome (overlay cutout + tip). */

.help-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.help-tour-overlay.is-on {
  opacity: 1;
}

.help-tour-overlay.is-full-dim {
  background: rgba(15, 10, 30, 0.45);
}

.help-tour-overlay.is-full-dim .help-tour-hole {
  display: none;
}

/* Transparent hole over the focus target; shadow dims the rest. */
.help-tour-hole {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 10, 30, 0.45);
  pointer-events: none;
  transition: top 0.15s ease, left 0.15s ease, width 0.15s ease, height 0.15s ease;
}

.help-tour-spotlight {
  position: relative;
  z-index: 20005 !important;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #a855f7;
  border-radius: 10px;
  animation: help-tour-pulse 1.4s ease-in-out infinite;
  /* Keep the focused control at true page brightness */
  isolation: isolate;
}

.help-tour-typing {
  outline: 2px solid #a855f7;
  outline-offset: 2px;
}

/* Date picker opens on the volunteer demo. Keep it under the info box. */
body:has(.help-tour-overlay.is-on) .flatpickr-calendar {
  z-index: 20010 !important;
}

.help-tour-tip {
  position: absolute;
  z-index: 20020;
  width: min(22rem, calc(100vw - 1.5rem));
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: 1.05rem 1.2rem;
  border-radius: 14px;
  background: #1e1b4b;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  text-align: left;
}

.help-tour-tip.is-interactive {
  pointer-events: auto;
}

.help-tour-tip.is-centered {
  position: fixed;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(28rem, calc(100vw - 2rem));
  max-width: min(28rem, calc(100vw - 2rem));
  text-align: center;
  padding: 1.4rem 1.5rem;
  font-size: 1.1rem;
}

.help-tour-tip.is-centered .help-tour-tip-next,
.help-tour-tip.is-centered .help-tour-tip-actions {
  margin-top: 0.85rem;
}

.help-tour-tip-text {
  display: block;
}

.help-tour-tip-close {
  display: none;
}

@media (min-width: 992px) {
  .help-tour-tip.has-close {
    pointer-events: auto;
    padding-right: 2.4rem;
  }

  .help-tour-tip-close {
    display: flex;
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
  }

  .help-tour-tip-close:hover,
  .help-tour-tip-close:focus {
    background: rgba(255, 255, 255, 0.16);
    outline: none;
    color: #fff;
  }
}

.help-tour-tip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.help-tour-tip-next,
.help-tour-tip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.55rem 1.15rem;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #1e1b4b;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.help-tour-tip-actions .help-tour-tip-action {
  margin-top: 0;
}

.help-tour-tip-action--primary {
  background: #fff;
  color: #1e1b4b;
}

.help-tour-tip-action--secondary {
  background: transparent;
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.help-tour-tip-next:hover,
.help-tour-tip-next:focus,
.help-tour-tip-action--primary:hover,
.help-tour-tip-action--primary:focus {
  background: #f3e8ff;
  outline: none;
  color: #1e1b4b;
}

.help-tour-tip-action--secondary:hover,
.help-tour-tip-action--secondary:focus {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  color: #fff;
}

.help-tour-tip--done {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  top: auto;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6b21a8, #be185d);
  width: min(26rem, calc(100vw - 2rem));
  max-width: min(26rem, calc(100vw - 2rem));
  text-align: center;
  pointer-events: none;
}

@keyframes help-tour-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px #a855f7;
  }
  50% {
    box-shadow: 0 0 0 3px #fff, 0 0 0 10px rgba(168, 85, 247, 0.55);
  }
}

@media (max-width: 991.98px) {
  .help-tour-tip.is-mobile-sheet {
    position: fixed;
    left: 0.5rem;
    right: 0.5rem;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    top: auto;
    width: auto;
    max-width: none;
    max-height: 42vh;
    overflow: auto;
    padding: 0.9rem 1rem;
    font-size: 0.98rem;
  }

  .help-tour-tip.is-mobile-sheet.has-close,
  .help-tour-tip.is-centered.has-close {
    pointer-events: auto;
    padding-right: 2.75rem;
  }

  .help-tour-tip.is-mobile-sheet .help-tour-tip-close,
  .help-tour-tip.is-centered .help-tour-tip-close {
    display: flex;
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
  }

  .help-tour-tip.is-mobile-sheet .help-tour-tip-close:hover,
  .help-tour-tip.is-mobile-sheet .help-tour-tip-close:focus,
  .help-tour-tip.is-centered .help-tour-tip-close:hover,
  .help-tour-tip.is-centered .help-tour-tip-close:focus {
    background: rgba(255, 255, 255, 0.16);
    outline: none;
    color: #fff;
  }

  .help-tour-tip.is-mobile-sheet .help-tour-tip-next {
    display: flex;
    width: 100%;
    min-height: 44px;
    margin-top: 0.7rem;
  }

  .help-tour-tip.is-centered {
    width: min(22rem, calc(100vw - 1.25rem));
    max-width: min(22rem, calc(100vw - 1.25rem));
    padding: 1.1rem 1rem;
    font-size: 1rem;
  }

  .help-tour-tip.is-centered .help-tour-tip-next,
  .help-tour-tip.is-centered .help-tour-tip-action {
    min-height: 44px;
  }

  .help-tour-spotlight {
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px #a855f7;
    animation-name: help-tour-pulse-mobile;
  }
}

@keyframes help-tour-pulse-mobile {
  0%,
  100% {
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px #a855f7;
  }
  50% {
    box-shadow: 0 0 0 1px #fff, 0 0 0 5px rgba(168, 85, 247, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-tour-spotlight {
    animation: none;
  }

  .help-tour-hole {
    transition: none;
  }
}
