/* ==========================================================
   WIZPINZ – CHECKOUT MODAL & ORDER SUCCESS STYLES
========================================================== */

/* ----------------------------------------------------------
   MODAL BACKDROP
---------------------------------------------------------- */
.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.checkout-modal[hidden] { display: none; }

.checkout-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ----------------------------------------------------------
   DIALOG
---------------------------------------------------------- */
.checkout-modal__dialog {
  position: relative;
  z-index: 1;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border2);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ----------------------------------------------------------
   HEADER
---------------------------------------------------------- */
.checkout-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0;
}

.checkout-modal__subtitle {
  font-size: 0.75rem;
  color: var(--clr-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 4px;
  font-family: var(--font-ui);
  font-weight: 600;
}

.checkout-modal__title {
  font-size: 1.25rem;
  margin: 0;
  color: var(--clr-white);
}

.checkout-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 50%;
  color: var(--clr-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.checkout-modal__close:hover {
  background: var(--clr-accent2);
  color: #fff;
  border-color: var(--clr-accent2);
}

/* ----------------------------------------------------------
   ORDER SUMMARY
---------------------------------------------------------- */
.checkout-summary {
  margin: 1.25rem 1.5rem;
  background: var(--clr-bg2);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--clr-border);
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  border-bottom: 1px solid var(--clr-border);
}

.checkout-summary__row:last-child { border-bottom: none; }

.checkout-summary__row--total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--clr-white);
  background: rgba(124, 58, 237, 0.08);
}

.checkout-summary__row--total span:last-child {
  color: var(--clr-accent);
  font-family: var(--font-heading);
}

/* ----------------------------------------------------------
   STEPS
---------------------------------------------------------- */
.checkout-step {
  padding: 0 1.5rem 1.5rem;
}

.checkout-step--center {
  text-align: center;
  padding-bottom: 2rem;
}

/* ----------------------------------------------------------
   FORM FIELDS
---------------------------------------------------------- */
.checkout-field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.checkout-input {
  display: block;
  width: 100%;
  background: var(--clr-bg2);
  border: 1px solid var(--clr-border2);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  padding: 0.875rem 1rem;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
  outline: none;
}

.checkout-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.checkout-input::placeholder { color: var(--clr-text-dim); }

/* ----------------------------------------------------------
   ERROR
---------------------------------------------------------- */
.checkout-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ff8a8a;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* ----------------------------------------------------------
   BACK + EMAIL DISPLAY
---------------------------------------------------------- */
.checkout-back-btn {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
}

.checkout-back-btn:hover { color: var(--clr-text); }

.checkout-email-display {
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  margin-bottom: 1rem;
  background: var(--clr-bg2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

/* ----------------------------------------------------------
   STRIPE ELEMENT WRAPPER
---------------------------------------------------------- */
.stripe-element-label {
  display: block;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.stripe-element-wrap {
  background: var(--clr-bg2);
  border: 1px solid var(--clr-border2);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.2s;
}

.stripe-element-wrap:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

#stripe-payment-element {
  min-height: 44px;
}

/* ----------------------------------------------------------
   PAY BUTTON SPINNER
---------------------------------------------------------- */
.checkout-pay-btn {
  position: relative;
}

.checkout-spinner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.checkout-spinner svg {
  animation: spin 0.8s linear infinite;
}

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

/* ----------------------------------------------------------
   SECURE NOTE
---------------------------------------------------------- */
.checkout-secure-note {
  font-size: 0.75rem;
  color: var(--clr-text-dim);
  text-align: center;
  margin: 0.75rem 0 0;
}

/* ----------------------------------------------------------
   PROCESSING STEP
---------------------------------------------------------- */
.checkout-processing-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: pulse-icon 1.2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.15); opacity: 0.7; }
}

.checkout-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--clr-surface2);
  border-radius: 2px;
  margin-top: 1.5rem;
  overflow: hidden;
}

.checkout-progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  border-radius: 2px;
  animation: progress-fill 4s ease-in-out forwards;
}

@keyframes progress-fill {
  0%   { width: 0%; }
  60%  { width: 80%; }
  90%  { width: 92%; }
  100% { width: 95%; }
}

/* ----------------------------------------------------------
   ORDER SUCCESS PAGE
---------------------------------------------------------- */
.order-success-hero {
  padding: 5rem 0 3rem;
  text-align: center;
}

.order-success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.order-success-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--clr-white);
  margin-bottom: 0.5rem;
}

.order-success-subtitle {
  color: var(--clr-text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

.order-success-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border2);
  border-radius: var(--radius-xl);
  max-width: 580px;
  margin: 2rem auto;
  overflow: hidden;
}

.order-success-card__header {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-d));
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-success-card__header h3 {
  margin: 0;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-ui);
  font-weight: 500;
}

.order-success-card__header .ref {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #fff;
  letter-spacing: 1px;
}

.order-code-box {
  background: var(--clr-bg2);
  border: 2px solid var(--clr-primary);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin: 1.5rem;
  text-align: center;
}

.order-code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--clr-text-dim);
  margin-bottom: 0.75rem;
}

.order-code-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.5rem;
  letter-spacing: 4px;
  color: var(--clr-accent);
  font-weight: 700;
  word-break: break-all;
}

.order-code-pending {
  font-size: 1rem;
  color: var(--clr-text-muted);
  padding: 0.5rem 0;
}

.order-details-table {
  margin: 0 1.5rem 1.5rem;
}

.order-details-table table {
  width: 100%;
  border-collapse: collapse;
}

.order-details-table td {
  padding: 0.65rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
}

.order-details-table td:last-child {
  text-align: right;
  color: var(--clr-text);
  font-weight: 500;
}

.order-details-table tr:last-child td { border-bottom: none; }

/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 640px) {
  .checkout-modal__dialog {
    border-radius: var(--radius-lg);
    max-height: 95vh;
  }

  .checkout-modal__header { padding: 1.25rem 1.25rem 0; }
  .checkout-step          { padding: 0 1.25rem 1.25rem; }
  .checkout-summary       { margin: 1rem 1.25rem; }

  .order-code-value  { font-size: 1.15rem; letter-spacing: 2px; }
  .order-code-box    { margin: 1rem; padding: 1.25rem 1rem; }
  .order-details-table { margin: 0 1rem 1rem; }

  .order-success-card__header { padding: 1.25rem; }
}
