:root {
  --bg-color: #0b0f19;
  --card-bg: rgba(18, 24, 38, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --primary: #f59e0b; /* FamPay warm amber */
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --accent: #10b981; /* Emerald green for success */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --input-bg: rgba(15, 23, 42, 0.7);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-x: hidden;
  position: relative;
}

/* Background glows */
.glow-bg {
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
.glow-1 {
  top: 10%;
  left: 20%;
  background: rgba(245, 158, 11, 0.12);
}
.glow-2 {
  bottom: 10%;
  right: 20%;
  background: rgba(16, 185, 129, 0.1);
}

.container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.gateway-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.secure-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.3rem 0.6rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Notice Banner */
.notice-card {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.75rem;
  display: flex;
  gap: 0.5rem;
  color: #fbbf24;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}
.notice-card code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

/* Views */
.view-section {
  animation: fadeIn 0.25s ease forwards;
}
.hidden {
  display: none !important;
}

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

/* Amount Selection */
.section-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.label-hint {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
}

/* 3 Selectable Plans Styling */
.plans-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.plan-option {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}
.plan-option:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.6);
  transform: translateY(-1px);
}
.plan-option.active {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 4px 20px var(--primary-glow);
}
.plan-badge-popular {
  position: absolute;
  top: -9px;
  right: 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f19;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.plan-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s;
}
.plan-option.active .plan-radio {
  border-color: var(--primary);
}
.radio-inner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}
.plan-option.active .radio-inner {
  opacity: 1;
  transform: scale(1);
}

.plan-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.plan-head-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.plan-opt-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}
.plan-badge-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.tag-starter { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.tag-popular { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-lifetime { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.plan-opt-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.plan-price-wrap {
  display: flex;
  align-items: baseline;
  margin-left: 0.75rem;
  flex-shrink: 0;
}
.plan-price-wrap .currency {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-right: 0.1rem;
}
.plan-price-wrap .price-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

/* QR and UPI ID bar positioning */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}
.qr-box {
  position: relative;
  background: #ffffff;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  margin-bottom: 0.6rem;
}
.qr-box img {
  display: block;
  width: 175px;
  height: 175px;
  border-radius: 4px;
}

/* UPI ID Bar (Placed just under the QR code) */
.upi-id-bar {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.upi-label {
  color: var(--text-muted);
  font-size: 0.75rem;
}
.upi-text {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.82rem;
}
.copy-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  padding: 0.2rem;
  border-radius: 4px;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Supported Real Brand UPI App Chips */
.supported-apps {
  width: 100%;
  margin-bottom: 0.85rem;
  text-align: center;
}
.apps-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}
.app-badges {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.7);
  color: #f1f5f9;
  transition: all 0.2s ease;
}
.app-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.app-chip svg {
  display: block;
  flex-shrink: 0;
}

/* Primary Button */
.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b0f19;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all 0.2s;
}
.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.secondary-btn {
  width: 100%;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
  font-family: inherit;
  transition: color 0.2s;
}
.secondary-btn:hover {
  color: var(--text-main);
}

/* View 2: Payment Top Bar & Back Button */
.payment-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  gap: 0.6rem;
}
.icon-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}
.icon-back-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateX(-2px);
}
.icon-back-btn svg {
  display: block;
  flex-shrink: 0;
}
.back-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.order-summary-compact {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.order-summary-compact .summary-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.order-summary-compact .summary-amount {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.timer-badge {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Supported Apps Chips */
.supported-apps {
  width: 100%;
  margin-bottom: 0.75rem;
  text-align: center;
}
.apps-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.app-badges {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
}
.chip-gpay { border-color: rgba(66, 133, 244, 0.3); color: #93c5fd; }
.chip-phonepe { border-color: rgba(103, 58, 183, 0.4); color: #c4b5fd; }
.chip-paytm { border-color: rgba(0, 186, 242, 0.4); color: #7dd3fc; }
.chip-fam { border-color: rgba(245, 158, 11, 0.4); color: #fcd34d; }

.order-summary-bar {
  display: none;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}
.qr-box {
  position: relative;
  background: #ffffff;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.75rem;
}
.qr-box img {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 4px;
}
.qr-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--primary);
  border-style: solid;
}
.qr-corner.top-left { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.qr-corner.top-right { top: -2px; right: -2px; border-width: 3px 3px 0 0; }
.qr-corner.bottom-left { bottom: -2px; left: -2px; border-width: 0 0 3px 3px; }
.qr-corner.bottom-right { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }

.qr-instruction {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Mobile Intent Button */
.intent-btn {
  width: 100%;
  background: rgba(245, 158, 11, 0.12);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}
.intent-btn:hover {
  background: rgba(245, 158, 11, 0.2);
}

.upi-id-bar {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  gap: 0.4rem;
}
.upi-label {
  color: var(--text-muted);
}
.upi-text {
  font-weight: 600;
  color: var(--text-main);
}
.copy-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  padding: 0.2rem;
  border-radius: 4px;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.divider span {
  padding: 0 0.75rem;
}

/* UTR input */
.utr-input-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}
.utr-input-wrapper input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 3.5rem 0.85rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.2s;
}
.utr-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.utr-counter {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* View 3: Success */
.success-card {
  text-align: center;
  padding: 1rem 0;
}
.success-icon-wrap {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
}
.checkmark {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: #10b981;
  stroke-miterlimit: 10;
  box-shadow: inset 0 0 0 #10b981;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: #10b981;
  fill: rgba(16, 185, 129, 0.15);
  animation: stroke .6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke .3s cubic-bezier(0.65, 0, 0.45, 1) .8s forwards;
}
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }

.success-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.success-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.receipt-box {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.receipt-row:last-child {
  border-bottom: none;
}
.receipt-row span {
  color: var(--text-muted);
}
.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Footer */
.footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.7rem;
  color: #64748b;
}
