/**
 * Drupal Commerce / SynPay: hide the standard offsite payment redirect screen
 * without hiding the POST form or preventing its automatic submission.
 * This stylesheet is attached only to commerce_checkout.form / payment.
 */
body::before,
body::after {
  pointer-events: none;
  position: fixed;
  z-index: 2147483000;
  animation: vesta-payment-overlay-fallback 0s linear 5s forwards;
}

/* Opaque cover hides the site header, navigation and Commerce placeholder. */
body::before {
  content: "";
  inset: 0;
  background: #fff;
}

/* Simple spinner, no extra intermediate page branding or text. */
body::after {
  content: "";
  box-sizing: border-box;
  top: calc(50% - 20px);
  left: calc(50% - 20px);
  width: 40px;
  height: 40px;
  border: 3px solid #e4e9ef;
  border-top-color: #176da6;
  border-radius: 50%;
  z-index: 2147483001;
  animation:
    vesta-payment-spinner 0.7s linear infinite,
    vesta-payment-overlay-fallback 0s linear 5s forwards;
}

/* If redirect fails, reveal the existing manual form after 5 seconds. */
@keyframes vesta-payment-overlay-fallback {
  to { visibility: hidden; }
}
@keyframes vesta-payment-spinner {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: vesta-payment-overlay-fallback 0s linear 5s forwards;
  }
}
