/* Stripe Payment Form Styles */

.stripe-payment-container {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.stripe-payment-header {
  padding: 24px 24px 0;
  text-align: center;
}

.stripe-payment-header h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.stripe-payment-header p {
  color: #6b7280;
  margin-bottom: 0;
  font-size: 0.875rem;
}

.stripe-payment-form {
  padding: 24px;
  min-height: 400px;
  position: relative;
}

.payment-amount-display {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.payment-amount-display h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.amount-row span:first-child {
  color: #6b7280;
}

.amount-row .amount {
  font-weight: 600;
  color: #ef7310;
  font-size: 1.125rem;
}

.payment-element-container {
  margin-bottom: 40px;
  min-height: 250px;
  position: relative;
}

/* Fix Stripe Elements spacing and overlapping */
#payment-element {
  margin-bottom: 40px !important;
  min-height: 250px;
  position: static;
  display: block;
  width: 100%;
}

.p-Element {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

/* Ensure Stripe Elements container has proper spacing */
.__PrivateStripeElement {
  margin-bottom: 24px !important;
}

.stripe-error-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #dc2626;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 16px;
}

.stripe-error-message svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.stripe-form-actions {
  margin-top: 48px;
  margin-bottom: 20px;
  position: static;
  clear: both;
  width: 100%;
  display: block;
}

.stripe-pay-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: #ef7310;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 52px;
}

.stripe-pay-button:hover:not(:disabled) {
  background: #d66b0e;
  transform: translateY(-1px);
}

.stripe-pay-button:active:not(:disabled) {
  transform: translateY(0);
}

.stripe-pay-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.stripe-pay-button .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: stripe-spin 0.8s linear infinite;
}

.stripe-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.stripe-cancel-action {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.stripe-cancel-button {
  background: none;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stripe-cancel-button:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.stripe-powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.75rem;
  color: #9ca3af;
}

.stripe-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.stripe-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #ef7310;
  border-radius: 50%;
  animation: stripe-spin 1s linear infinite;
  margin-bottom: 16px;
}

.stripe-loading p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

@keyframes stripe-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 640px) {
  .stripe-payment-container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid #e5e7eb;
  }

  .stripe-payment-header {
    padding: 20px 16px 0;
  }

  .stripe-payment-form {
    padding: 20px 16px;
  }

  .payment-amount-display {
    padding: 12px;
  }

  .stripe-pay-button {
    font-size: 0.9375rem;
    padding: 12px 20px;
    min-height: 48px;
  }

  .stripe-cancel-action,
  .stripe-powered-by {
    padding: 12px 16px;
  }
}

/* Override Stripe Elements default styles */
.StripeElement {
  height: auto;
  padding: 10px 12px;
  border-radius: 6px;
  background-color: white;
  transition: box-shadow 150ms ease;
}

.StripeElement--focus {
  box-shadow: 0 1px 3px 0 rgba(239, 115, 16, 0.1), 0 0 0 3px rgba(239, 115, 16, 0.1);
  border-color: #ef7310;
}

.StripeElement--invalid {
  border-color: #dc2626;
}

.StripeElement--webkit-autofill {
  background-color: #fefefe !important;
}

/* Payment Element container styling */
#payment-element {
  margin-bottom: 20px;
}

/* Custom styling for Stripe Payment Element */
.p-Element {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.p-Element--focus {
  border-color: #ef7310;
  box-shadow: 0 0 0 2px rgba(239, 115, 16, 0.1);
}