/* Exit popup overlay and modal */
.sq-exit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

.sq-exit-overlay[hidden] {
  display: none;
}

.sq-exit-overlay.sq-exit-open {
  opacity: 1;
  pointer-events: auto;
}

.sq-exit-modal {
  position: relative;
  z-index: 0;
  max-width: 320px;
  width: 100%;
  background: linear-gradient(336.67deg, #0a0a0a 25%, #c71585 96.96%);
  color: var(--queenWhite);
  border: 1px solid var(--queenPurple);
  border-radius: 10px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateX(-120%);
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.sq-exit-modal:where(:hover, :focus-visible) {
  outline: none;
}
.sq-exit-modal::before {
  background-image: var(--sq-popup-bg);
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  content: '';
  position: absolute;
  inset: 0;
  top: -25px;
  left: -40px;
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
  width: 360px;
  height: 500px;
  transform: rotate(-15deg);
}

.sq-exit-overlay.sq-exit-open .sq-exit-modal {
  transform: translateX(0);
}

.sq-exit-overlay.sq-exit-closing .sq-exit-modal {
  transform: translateX(-120%);
}

.sq-exit-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--queenWhite);
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  transition: 0.25s;
}

.sq-exit-close:where(:hover, :focus-visible) {
  color: var(--queenBlack);
}

.sq-exit-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sq-exit-line1,
.sq-exit-line2,
.sq-exit-line3,
.sq-exit-line4 {
  margin: 0;
}

.sq-exit-line1,
.sq-exit-line3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--queenYellow);
}
.sq-exit-line2,
.sq-exit-line4 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--queenWhite);
}

.sq-exit-image-wrap {
  margin: 8px 0;
}

.sq-exit-image {
  max-width: 240px;
  height: auto;
  border-radius: 10px;
  width: 100%;
}

.sq-exit-link-container {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 16px;
  border-radius: 10px;
  background-color: var(--queenWhite);
  color: var(--queenPurple);
  font-size: 1.25rem;
  font-weight: 700;
  perspective: 1500px;
  transition: transform 120ms ease, background-color 0.6s, color 0.6s,
    box-shadow 0.15s, text-shadow 0.15s;
  text-shadow: 0 0 0 currentColor;
}
.sq-exit-link {
  display: inline-block;
  transform-style: preserve-3d;
}

.sq-exit-overlay.sq-exit-open .sq-exit-link-container {
  animation: sq-text-pulse 900ms ease-in-out 2 both;
}

.sq-exit-link-container:where(:hover, :focus-visible) {
  text-shadow: none;
  background-color: var(--queenPurple);
  color: var(--queenWhite);
}

.sq-exit-link-container:active {
  transform: translateY(1px) scale(0.98);
}

.sq-exit-link-container:focus-visible {
  outline: 2px solid var(--queenYellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(253, 221, 11, 0.14);
}

.sq-exit-link-container:where(:hover, :focus-visible) .sq-exit-link {
  animation: rotate-x 0.5s ease forwards;
}

@keyframes sq-text-pulse {
  0%,
  100% {
    text-shadow: 0 0 0 currentColor;
  }
  50% {
    text-shadow: 0 0 4px currentColor;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sq-exit-link-container {
    animation: none !important;
  }
  .sq-exit-link {
    animation: none;
  }
  .sq-exit-link-container:where(:hover, :focus-visible) .sq-exit-link {
    animation: none;
  }
}

@keyframes rotate-x {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(360deg);
  }
}
