/* ============================================================
   M-PESA STK PUSH PAYMENT MODAL STYLES
   Dark theme — matches PDF417 Gen site design
   ============================================================ */

/* ── Overlay ─────────────────────────────────────────────── */
.mpesa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: mpesaFadeIn 0.25s ease;
}

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

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

/* ── Modal Container ─────────────────────────────────────── */
.mpesa-modal {
  background: var(--bg-card, #111827);
  border: 1px solid var(--border-card, rgba(255,255,255,0.08));
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,229,255,0.06);
  animation: mpesaSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mpesaSlideUp {
  from { transform: translateY(40px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Close Button ────────────────────────────────────────── */
.mpesa-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary, #9ca3af);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
}
.mpesa-close:hover {
  background: rgba(255,60,60,0.15);
  border-color: rgba(255,60,60,0.3);
  color: #ff6b6b;
}

/* ── Header ──────────────────────────────────────────────── */
.mpesa-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-right: 2.5rem;
}

.mpesa-plan-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.mpesa-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary, #f9fafb);
  margin: 0 0 0.2rem;
}

.mpesa-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
}

/* ── Price Box ───────────────────────────────────────────── */
.mpesa-price-box {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(0,229,255,0.06), rgba(138,43,226,0.06));
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.75rem;
}

.mpesa-currency {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted, #6b7280);
  letter-spacing: 0.05em;
}

.mpesa-amount {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #00e5ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.mpesa-period {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
  align-self: flex-end;
  margin-bottom: 0.2rem;
}

/* ── Step ────────────────────────────────────────────────── */
.mpesa-step-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

.mpesa-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary, #00e5ff);
  color: #000;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.mpesa-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #f9fafb);
  margin-bottom: 0.2rem;
}

.mpesa-step-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
}

/* ── Phone Input ─────────────────────────────────────────── */
.mpesa-phone-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input, #1f2937);
  border: 1.5px solid var(--border-card, rgba(255,255,255,0.08));
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
  margin-bottom: 0.5rem;
}

.mpesa-phone-wrap:focus-within {
  border-color: var(--accent-primary, #00e5ff);
  box-shadow: 0 0 0 3px rgba(0,229,255,0.1);
}

.mpesa-phone-prefix {
  padding: 0.875rem 1rem;
  background: rgba(0,229,255,0.06);
  border-right: 1px solid var(--border-card, rgba(255,255,255,0.08));
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-primary, #00e5ff);
  white-space: nowrap;
  font-family: var(--font-mono, monospace);
}

.mpesa-phone-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #f9fafb);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.08em;
}

.mpesa-phone-input::placeholder {
  color: var(--text-muted, #6b7280);
  font-weight: 400;
  letter-spacing: normal;
}

.mpesa-phone-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  margin: 0 0 1.25rem;
}

.mpesa-phone-error {
  font-size: 0.8rem;
  color: #ff6b6b;
  margin: 0.25rem 0 0.75rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.mpesa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  width: 100%;
  font-family: var(--font-main, 'Inter', sans-serif);
}

.mpesa-btn-primary {
  background: linear-gradient(135deg, #00e5ff, #0099cc);
  color: #000;
  box-shadow: 0 4px 20px rgba(0,229,255,0.3);
}

.mpesa-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,229,255,0.4);
}

.mpesa-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.mpesa-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary, #9ca3af);
  border: 1px solid rgba(255,255,255,0.1);
  flex: 0 0 auto;
  width: auto;
}

.mpesa-btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary, #f9fafb);
}

/* ── Spinner ─────────────────────────────────────────────── */
.mpesa-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: mpesaSpin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Waiting Box ─────────────────────────────────────────── */
.mpesa-waiting-box {
  text-align: center;
  padding: 1rem 0;
}

.mpesa-pulse-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0,229,255,0.08);
  border: 2px solid rgba(0,229,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  animation: mpesaPulse 2s ease-in-out infinite;
}

@keyframes mpesaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,255,0.3); }
  50% { box-shadow: 0 0 0 16px rgba(0,229,255,0); }
}

.mpesa-pulse-icon {
  font-size: 2rem;
}

.mpesa-waiting-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary, #f9fafb);
  margin: 0 0 0.75rem;
}

.mpesa-waiting-sub {
  font-size: 0.85rem;
  color: var(--text-secondary, #9ca3af);
  margin: 0 0 0.5rem;
  line-height: 1.6;
}

/* ── Timer ───────────────────────────────────────────────── */
.mpesa-timer-wrap {
  margin: 1.25rem 0;
}

.mpesa-timer-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.mpesa-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #a855f7);
  border-radius: 2px;
  width: 0%;
  transition: width 1s linear;
}

.mpesa-timer-text {
  font-size: 0.78rem;
  color: var(--text-muted, #6b7280);
}

/* ── Ref Box ─────────────────────────────────────────────── */
.mpesa-ref-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
}

.mpesa-ref-label {
  color: var(--text-muted, #6b7280);
}

.mpesa-ref-val {
  font-family: var(--font-mono, monospace);
  color: var(--accent-primary, #00e5ff);
  font-weight: 700;
}

/* ── Success Box ─────────────────────────────────────────── */
.mpesa-success-box {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.mpesa-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0,255,136,0.12);
  border: 2px solid rgba(0,255,136,0.3);
  color: #00ff88;
  font-size: 1.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  animation: mpesaSuccessPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mpesaSuccessPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.mpesa-success-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #00ff88;
  margin: 0 0 0.5rem;
}

.mpesa-success-sub {
  font-size: 0.88rem;
  color: var(--text-secondary, #9ca3af);
  margin: 0 0 1.5rem;
}

.mpesa-success-details {
  background: var(--bg-secondary, #1f2937);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.mpesa-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
  font-size: 0.85rem;
}

.mpesa-detail-row:last-child {
  border-bottom: none;
}

.mpesa-detail-row span:first-child {
  color: var(--text-muted, #6b7280);
}

.mpesa-detail-row span:last-child {
  color: var(--text-primary, #f9fafb);
  font-weight: 600;
}

/* ── Error Box ───────────────────────────────────────────── */
.mpesa-error-box {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.mpesa-error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,60,60,0.1);
  border: 2px solid rgba(255,60,60,0.3);
  color: #ff6b6b;
  font-size: 1.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.mpesa-error-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ff6b6b;
  margin: 0 0 0.5rem;
}

.mpesa-error-sub {
  font-size: 0.85rem;
  color: var(--text-secondary, #9ca3af);
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

/* ── Footer ──────────────────────────────────────────────── */
.mpesa-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}

.mpesa-logo {
  height: 22px;
  width: auto;
  filter: brightness(0.9);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .mpesa-modal {
    padding: 1.5rem;
    border-radius: 16px;
  }
  .mpesa-amount {
    font-size: 1.8rem;
  }
}

/* ── Pricing Page Plan CTA Buttons ───────────────────────── */
.plan-cta-mpesa {
  cursor: pointer;
  text-align: center;
  display: block;
  width: 100%;
}

/* ── Nav Plan Badge (shared) ─────────────────────────────── */
.nav-plan-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.25rem;
}
.nav-plan-starter { background: rgba(0,229,255,0.15); color: #00e5ff; border: 1px solid rgba(0,229,255,0.3); }
.nav-plan-pro { background: rgba(138,43,226,0.15); color: #a855f7; border: 1px solid rgba(138,43,226,0.3); }
.nav-plan-elite { background: rgba(255,170,0,0.15); color: #ffaa00; border: 1px solid rgba(255,170,0,0.3); }
