.mpesa-modal {
  background: #020617;
  border-radius: 16px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.9);
}

.mpesa-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mpesa-title {
  font-size: 24px;
  font-weight: 700;
  color: #e5e7eb;
  margin: 0;
}

.mpesa-subtitle {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: #9ca3af;
}

.mpesa-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mpesa-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mpesa-label {
  font-size: 13px;
  font-weight: 500;
  color: #d1d5db;
}

.mpesa-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
  font-size: 14px;
}

.mpesa-input::placeholder {
  color: #6b7280;
}

.mpesa-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5);
}

.mpesa-input[readonly] {
  color: #9ca3af;
}

.mpesa-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.mpesa-pay-button {
  margin-top: 8px;
  width: 100%;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #6366f1 100%);
  color: #f9fafb;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mpesa-pay-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 48px rgba(79, 70, 229, 0.9);
}

.mpesa-pay-button:active {
  transform: translateY(0);
  box-shadow: 0 14px 32px rgba(79, 70, 229, 0.7);
}

/* —— Payment step cards: one stage, processing OR success (instant swap) —— */
.mpesa-paystep-stage {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 8px;
  box-sizing: border-box;
}

.mpesa-paystep-stage.mpesa-paystep-stage--open {
  display: flex !important;
}

/* Both panels sit in the same slot; only .mpesa-paystep-root--on is shown */
#depositPaystepStage .mpesa-paystep-root {
  display: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

#depositPaystepStage .mpesa-paystep-root.mpesa-paystep-root--on {
  display: flex !important;
}

.mpesa-paystep-card {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 36px 28px 28px;
  border-radius: 22px;
  background: linear-gradient(165deg, #0b1224 0%, #111827 48%, #0f172a 100%);
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 28px 56px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.mpesa-paystep-card--process {
  border-color: rgba(45, 212, 191, 0.25);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 28px 56px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(45, 212, 191, 0.08);
}

.mpesa-paystep-card--done {
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 28px 56px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(34, 197, 94, 0.1);
}

.mpesa-success-card {
  max-width: 360px;
  padding-top: 32px;
}

.mpesa-success-icon {
  margin: 0 auto 20px;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 10px 28px rgba(22, 163, 74, 0.35));
}

.mpesa-success-headline {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.03em;
}

.mpesa-success-sub {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8;
}

.mpesa-success-usd {
  margin: 0 0 10px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #4ade80;
  line-height: 1.1;
}

.mpesa-success-kesline {
  margin: 0 0 20px;
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.45;
}

.mpesa-success-balancebox {
  width: 100%;
  text-align: left;
  padding: 14px 16px 16px;
  margin: 0 0 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.65) 100%);
  border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(129, 140, 248, 0.75);
}

.mpesa-success-balance-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.mpesa-success-balance-val {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.02em;
}

.mpesa-success-ref {
  margin: 0 0 12px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  word-break: break-all;
}

.mpesa-success-brand {
  margin: 0 0 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #475569;
}

.mpesa-success-cta {
  margin-bottom: 10px;
}

.mpesa-success-dismiss {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  opacity: 0.92;
}

.mpesa-paystep-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
}

/* !important: app.css ends with * { animation: none !important } for layout stability */
.mpesa-paystep-spinner-svg {
  display: block;
  animation: mpesa-spin 0.9s linear infinite !important;
  transform-origin: 50% 50%;
}

.mpesa-paystep-spinner-track {
  stroke: rgba(45, 212, 191, 0.14);
}

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

.mpesa-paystep-check {
  margin: 0 auto 18px;
  display: flex;
  justify-content: center;
}

.mpesa-paystep-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.mpesa-paystep-text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #94a3b8;
}

.mpesa-paystep-text--muted {
  margin-bottom: 20px;
  font-size: 13px;
  color: #64748b;
}

.mpesa-paystep-meta {
  margin: 0 0 14px;
  min-height: 1.2em;
  font-size: 13px;
  font-weight: 500;
  color: #a5b4fc;
  line-height: 1.45;
}

.mpesa-paystep-brand {
  margin: 0 0 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #475569;
}

.mpesa-paystep-amount {
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.03em;
}

.mpesa-paystep-btn-outline {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: transparent;
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mpesa-paystep-btn-outline:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(148, 163, 184, 0.85);
  color: #f8fafc;
}

.mpesa-paystep-btn-primary {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #f8fafc;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mpesa-paystep-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.5);
}

.mpesa-paystep-btn-spaced {
  margin-top: 0;
}

