@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --phonepe: #5f259f;
  --gpay: #1a73e8;
  --paytm: #00baf2;
  --success: #10b981;
  --danger: #ef4444;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --card-bg: rgba(255, 255, 255, 0.98);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--text-main);
}

.checkout-wrapper {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.checkout-header {
  background: #f8fafc;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Order Summary Box */
.order-summary {
  padding: 1.25rem 1.5rem 0.75rem;
  text-align: center;
}

.amount-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.amount-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.order-meta-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.meta-chip {
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
}

/* Timer Section */
.timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
  padding: 0.4rem 0.75rem;
  margin: 0.75rem 1.5rem 0;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.timer-dot {
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* QR Code Display */
.qr-container {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-card {
  background: #ffffff;
  padding: 0.75rem;
  border-radius: 16px;
  border: 2px dashed #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image {
  width: 190px;
  height: 190px;
  display: block;
  border-radius: 8px;
}

.qr-center-icon {
  position: absolute;
  width: 42px;
  height: 42px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 6px;
}

.qr-center-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scan-prompt {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 1-Click UPI Intent Buttons */
.intent-section {
  padding: 0 1.5rem 1.5rem;
}

.section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.75rem 0 1rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.section-divider span {
  padding: 0 0.75rem;
}

.intent-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.btn-intent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-intent:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.btn-phonepe {
  background: #fbf7ff;
  border-color: #d8b4fe;
  color: var(--phonepe);
}

.btn-phonepe:hover {
  background: var(--phonepe);
  color: #ffffff;
}

.btn-gpay {
  background: #f0f7ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.btn-gpay:hover {
  background: var(--gpay);
  color: #ffffff;
}

.btn-paytm {
  background: #f0faff;
  border-color: #bae6fd;
  color: #0369a1;
}

.btn-paytm:hover {
  background: var(--paytm);
  color: #ffffff;
}

.btn-universal {
  grid-column: span 2;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
}

.btn-universal:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

/* Footer status indicator */
.checkout-footer {
  padding: 0.9rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.polling-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #059669;
  font-weight: 500;
}

.spin-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulseDot 1.2s infinite;
}

/* Success Overlay */
.status-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 50;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.status-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

.success-icon-wrap {
  width: 80px;
  height: 80px;
  background: #ecfdf5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 0 12px #f0fdf4;
}

.success-icon-wrap svg {
  width: 44px;
  height: 44px;
  stroke: #10b981;
  stroke-width: 3;
}

.success-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.success-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.utr-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 1.5rem;
}

.redirect-notice {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* =========================================
   CHECKOUT RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .checkout-wrapper {
    max-width: 100%;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  }

  .checkout-header {
    padding: 1rem 1.15rem;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .brand-title {
    font-size: 0.9rem;
  }

  .order-summary {
    padding: 1rem 1.15rem 0.5rem;
  }

  .amount-value {
    font-size: 1.9rem;
  }

  .qr-container {
    padding: 0.75rem 1rem;
  }

  .qr-card {
    padding: 0.6rem;
    max-width: 220px;
  }

  .intent-section {
    padding: 1rem 1.15rem;
  }

  .intent-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .btn-intent {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
  }

  .btn-universal {
    grid-column: span 2;
  }

  .checkout-footer {
    padding: 0.85rem 1.15rem;
    font-size: 0.72rem;
  }

  .status-overlay {
    padding: 1.5rem 1.25rem;
  }

  .success-title {
    font-size: 1.25rem;
  }
}

/* ===================================================
   DEVICE SPECIFIC DISPLAY RULES:
   Windows / Mac / PC: Show Dynamic QR Code
   Mobile (Phones): Hide QR Code, Show 1-Click UPI App Buttons
   =================================================== */
.device-desktop-only {
  display: block;
}
.device-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .device-desktop-only {
    display: none !important;
  }
  .device-mobile-only {
    display: block !important;
  }
}

.btn-mobile-app {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-mobile-app:active {
  transform: scale(0.98);
}
.btn-mobile-app:hover {
  filter: brightness(0.97);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
