/* Turnstile stays out of layout until Managed mode requires user interaction. */
.turnstile-slot {
  grid-column: 1 / -1;
  width: 100%;
  height: 0;
  min-height: 0;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

.turnstile-slot--interactive {
  height: auto;
  min-height: 65px;
  margin-top: 10px;
  opacity: 1;
  pointer-events: auto;
}

.turnstile-error {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.5;
}

.sunwayman-footer-subscribe .turnstile-error {
  color: #ffe0dc;
}

.turnstile-error[hidden], .turnstile-status[hidden] { display: none !important; }
.turnstile-status.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 淡出期间也保留定位，防止恢复按钮时圆环偏移。 */
button:has(> .sunwayman-button-spinner) { position: relative; }

/* Reusable loading state for submit buttons; it never replaces the button label. */
.sunwayman-button-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.sunwayman-button-spinner__ring {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sunwayman-button-spin 0.72s linear infinite;
}

.sunwayman-button-spinner[hidden] {
  display: none;
}

.sunwayman-button-spinner--visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.sunwayman-button-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: inherit;
  opacity: 1;
  transform: scale(1);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sunwayman-button--loading,
.sunwayman-button--loading:hover,
.sunwayman-button--loading:focus-visible {
  position: relative !important;
  border-color: #8f2024 !important;
  background: #8f2024 !important;
  color: #fff !important;
  opacity: 1 !important;
  cursor: wait !important;
  transform: none !important;
  box-shadow: none !important;
}

.sunwayman-button--loading .sunwayman-button-label {
  opacity: 0;
  transform: scale(0.96);
}

.sunwayman-button--loading::after {
  opacity: 0 !important;
  animation: none !important;
}

@keyframes sunwayman-button-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sunwayman-button-spinner,
  .sunwayman-button-label {
    transition: none;
  }

  .sunwayman-button-spinner__ring {
    animation: none;
  }
}

