/* ================================
   STRIPE MODAL — MIAROS DARK THEME
   Matches ActimefyBlazor exact layout
   ================================ */

@keyframes scaleIn {
  from {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes scaleOut {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.stripe-slide-up-close {
  animation: scaleOut 0.25s cubic-bezier(0.2, 0.9, 0.3, 1) forwards !important;
}

/* -------- Overlay (theme glass scrim) -------- */
#stripe-overlay {
  display: none;
  position: fixed;
  z-index: 2147483099 !important;
  inset: 0;
  background: radial-gradient(120% 140% at 50% 10%, rgba(8, 11, 18, 0.88) 0%, rgba(8, 11, 18, 0.78) 55%, rgba(6, 9, 14, 0.72) 100%), rgba(8, 11, 18, 0.75);
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
  transition: opacity 0.25s ease, visibility 0.25s ease;
  animation: fadeIn 0.25s ease forwards;
}

/* -------- Modal root (container) -------- */
#stripe-stripe-modal {
  display: none;
  position: fixed;
  z-index: 2147483100 !important;
  inset: 0;
  overflow: hidden;
  background: transparent;
  transition: opacity 0.25s ease;
  animation: fadeIn 0.25s ease forwards;
}

/* -------- Modal surface -------- */
#stripe-stripe-modal > div {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: min(94vw, 680px);
  max-width: min(65vw, 94vw);
  height: auto;
  max-height: min(92vh, 840px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: #0d131c;
  color: #edf2f7;
  border: 1px solid #1e2430;
  border-radius: 14px;
  padding: 20px 26px 24px 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  animation: scaleIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* -------- Header -------- */
.stripe-modal-header {
  background: transparent;
  padding: 0 0 14px 0;
  margin: 0 0 12px 0;
  border-bottom: 1px solid #1e2430;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stripe-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
}

/* -------- Close -------- */
.stripe-close {
  color: #8a99ad;
  font-size: 26px;
  font-weight: 400;
  cursor: pointer;
  line-height: 1;
  background: transparent;
  border: none;
  padding: 0 4px;
  border-radius: 6px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.stripe-close:hover,
.stripe-close:focus {
  color: #ffffff;
  transform: scale(1.1);
  text-decoration: none;
  outline: none;
}

/* -------- Body -------- */
.stripe-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 6px 4px 12px 4px;
  color: #8a99ad;
  scrollbar-width: thin !important;
  scrollbar-color: #2563eb transparent !important;
}

#stripe-stripe-modal .stripe-modal-body::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

#stripe-stripe-modal .stripe-modal-body::-webkit-scrollbar-track {
  background: transparent !important;
}

#stripe-stripe-modal .stripe-modal-body::-webkit-scrollbar-thumb {
  background: #2563eb !important;
  border-radius: 6px !important;
}

#stripe-checkout {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: block;
  overflow-x: hidden !important;
}

#stripe-checkout form {
  width: 100%;
  box-sizing: border-box;
}

#payment-element {
  width: 100% !important;
  box-sizing: border-box;
}

/* Submit Button */
.btn-payment-submit {
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}

.btn-payment-submit:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-payment-submit:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-payment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: stripe-spin 0.8s linear infinite;
  display: inline-block;
}

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

/* Local Simulation Form */
.stripe-sim-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stripe-sim-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #8a99ad;
  margin-bottom: 5px;
}

.stripe-sim-input {
  width: 100%;
  box-sizing: border-box;
  background: #080b11;
  border: 1px solid #1e2430;
  border-radius: 7px;
  padding: 10px 12px;
  color: #edf2f7;
  font-size: 13.5px;
  outline: none;
}

.stripe-sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Prevent scrolling behind modal */
html.stripe-modal-open,
body.stripe-modal-open {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  #stripe-stripe-modal > div {
    width: 94vw;
    max-width: 94vw;
    padding: 16px;
    border-radius: 12px;
  }
}
