* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

.payment-page-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.checkout-wrapper {
  position: relative;
  width: 100%;
  max-width: 940px;
}

/* Primary GetPay Container */
#checkout {
  width: 100%;
  max-width: 940px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  padding: 24px;
  min-height: 540px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Ensure GetPay internal elements and iframes expand responsively */
#checkout iframe {
  width: 100% !important;
  border: none !important;
  background: transparent !important;
}

/* Custom Loader displayed as an overlay before bundle mounts */
#checkout-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 16px;
  min-height: 480px;
  color: #64748b;
  gap: 16px;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#checkout-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.checkout-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: #5662FF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.checkout-loader-text {
  font-size: 15px;
  font-weight: 500;
  color: #475569;
}

#error-box {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
  width: 100%;
  max-width: 940px;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  body {
    padding: 12px 8px;
    background: #ffffff;
  }

  .payment-page-container {
    padding: 0;
  }

  #checkout {
    padding: 16px 12px;
    border-radius: 12px;
    border: none;
    box-shadow: none;
    min-height: 480px;
  }
}
