/* ===== ROOT VARIABLES ===== */
:root {
  --bg-primary: #070a14;
  --bg-secondary: #0c1022;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(22, 33, 62, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-emerald: #10d981;
  --accent-cyan: #00b9f1;
  --accent-purple: #7b2cbf;
  --accent-amber: #f59e0b;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --gradient-main: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  --gradient-paytm: linear-gradient(135deg, #00b9f1, #0070ba, #002b6e);
  --gradient-phonepe: linear-gradient(135deg, #5f259f, #7b2cbf, #3d0066);

  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 70px rgba(99, 102, 241, 0.2);
  --radius-card: 20px;
  --radius-sm: 12px;
  --radius-pill: 50px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* ===== ANIMATED BACKGROUND ===== */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 14s ease-in-out infinite alternate;
}
.blob-1 { width: 500px; height: 500px; background: #6366f1; top: -180px; left: -140px; }
.blob-2 { width: 450px; height: 450px; background: #7b2cbf; bottom: -120px; right: -80px; animation-delay: 4s; }
.blob-3 { width: 350px; height: 350px; background: #00b9f1; top: 35%; left: 35%; animation-delay: 8s; }

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(35px, 25px) scale(1.06); }
}

.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  animation: particleRise linear infinite;
}
@keyframes particleRise {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== APP WRAPPER ===== */
.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 24px 24px;
  max-width: 1240px;
  margin: 0 auto;
}

/* ===== TOP HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-main);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}
.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}
.logo-accent {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 217, 129, 0.1);
  border: 1px solid rgba(16, 217, 129, 0.25);
  color: #34d399;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.3px;
}
.badge-dot {
  width: 7px;
  height: 7px;
  background: #10d981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 217, 129, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(16, 217, 129, 0); }
}

/* ===== MAIN CONTENT GRID ===== */
.main-content {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 36px;
  flex: 1;
  align-items: start;
  padding-bottom: 24px;
}

/* ===== LEFT PANEL ===== */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  font-weight: 800;
  line-height: 1.18;
  color: var(--text-primary);
  letter-spacing: -0.6px;
}
.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 520px;
}
.hero-sub strong {
  color: #fff;
}

/* ===== LOAN TYPE SELECTOR (MODERN PILLS) ===== */
.loan-selector-wrap {
  margin-top: 6px;
}
.selector-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.loan-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.loan-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-family: inherit;
  position: relative;
  text-align: left;
}
.loan-tab:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}
.loan-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.08));
  border-color: var(--accent-primary);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.22);
  color: var(--text-primary);
}

.tab-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}
.tab-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tab-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}
.tab-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.tab-check {
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s;
}
.loan-tab.active .tab-check {
  opacity: 1;
}

/* ===== UNIFIED BORROWER INVOICE CARD ===== */
.borrower-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: var(--transition);
}
.borrower-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.bc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.bc-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.bc-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.bc-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.bc-sub strong {
  color: var(--text-secondary);
}

.bc-status-pill {
  background: rgba(16, 217, 129, 0.12);
  border: 1px solid rgba(16, 217, 129, 0.3);
  color: #34d399;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* 4-Grid Metrics inside Borrower Card */
.bc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.bc-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bc-item.highlight-item {
  background: linear-gradient(135deg, rgba(16, 217, 129, 0.09), rgba(5, 150, 105, 0.03));
  border-color: rgba(16, 217, 129, 0.22);
}
.bc-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bc-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.bc-val.amount-val {
  font-size: 1.2rem;
  color: #34d399;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.3px;
}

/* Integrated Repayment Progress */
.bc-progress-wrap {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.bcp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.bcp-title {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.bcp-pct {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-primary);
}
.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar {
  height: 100%;
  background: var(--gradient-main);
  border-radius: var(--radius-pill);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.bcp-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Security Pillars */
.security-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pillar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.pillar-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.pillar-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pillar-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* ===== RIGHT PANEL: PAYMENT GATEWAY CARD ===== */
.right-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.qr-card {
  background: linear-gradient(160deg, rgba(20, 28, 48, 0.88), rgba(10, 15, 30, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  backdrop-filter: blur(24px);
  transition: var(--transition);
}

.card-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 185, 241, 0.22), transparent 70%);
  pointer-events: none;
}

/* Gateway Card Header */
.qr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gateway-branding {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gateway-logos {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gw-badge-paytm {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: #00B9F1;
  letter-spacing: -0.3px;
}
.gw-divider {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.gw-badge-phonepe {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #9d4edd;
  letter-spacing: -0.3px;
}
.gateway-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.secure-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 217, 129, 0.1);
  border: 1px solid rgba(16, 217, 129, 0.25);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* Total Payable Callout Bar */
.total-payable-bar {
  background: linear-gradient(135deg, rgba(16, 217, 129, 0.12), rgba(5, 150, 105, 0.05));
  border: 1px solid rgba(16, 217, 129, 0.22);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.tpb-left {
  display: flex;
  flex-direction: column;
}
.tpb-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tpb-sub {
  font-size: 0.68rem;
  color: #34d399;
}
.tpb-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: #10d981;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.5px;
}

/* Method Tabs */
.pay-method-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.pay-method-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pay-method-tab:hover {
  color: var(--text-primary);
}
.pay-method-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(0, 185, 241, 0.2));
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.pmt-icon {
  font-size: 0.95rem;
}

/* Pay Panel Fade */
.pay-panel {
  animation: panelFadeIn 0.25s ease-out;
}
@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Receiver UPI Box */
.upi-info-box {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.upi-meta-left {
  display: flex;
  flex-direction: column;
}
.upi-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}
.upi-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  word-break: break-all;
}
.copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}
.sub-row {
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
}
.upi-sub-lbl {
  color: var(--text-muted);
}
.upi-sub-lbl strong {
  color: var(--text-secondary);
}
.upi-sub-amt {
  font-weight: 700;
  color: #34d399;
}

/* Pay Action Buttons */
.pay-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.pay-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
}
.pay-action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: translateX(-100%);
  animation: shimmerBtn 2.8s infinite;
}
@keyframes shimmerBtn {
  100% { transform: translateX(100%); }
}

.pab-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pab-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pab-content {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.pab-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.2;
}
.pab-sub {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 2px;
  font-weight: 500;
}
.pab-arrow {
  font-size: 1.25rem;
  font-weight: 700;
  opacity: 0.8;
  transition: transform 0.25s;
}
.pay-action-btn:hover .pab-arrow {
  transform: translateX(4px);
}
.pay-action-btn:active {
  transform: scale(0.985);
}

/* Paytm Button */
.paytm-btn {
  background: var(--gradient-paytm);
  box-shadow: 0 6px 20px rgba(0, 185, 241, 0.35);
}
.paytm-btn:hover {
  box-shadow: 0 10px 28px rgba(0, 185, 241, 0.55);
}
.paytm-icon-box {
  background: rgba(0, 38, 58, 0.4);
  border: 1px solid rgba(0, 185, 241, 0.3);
}

/* PhonePe Button */
.phonepe-btn {
  background: var(--gradient-phonepe);
  box-shadow: 0 6px 20px rgba(123, 44, 191, 0.35);
}
.phonepe-btn:hover {
  box-shadow: 0 10px 28px rgba(123, 44, 191, 0.55);
}
.phonepe-icon-box {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.phonepe-symbol {
  font-family: -apple-system, sans-serif;
  font-weight: 900;
  font-size: 1.45rem;
  color: #fff;
  line-height: 1;
}

/* Other UPI Apps Button */
.pay-any-upi-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}
.pay-any-upi-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
}
.pau-icon {
  font-size: 0.88rem;
}

/* Helpful Notice */
.desktop-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.72rem;
  color: #fbbf24;
  line-height: 1.4;
}
.desktop-notice svg {
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

/* QR Code Section */
.qr-image-wrapper {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.qr-image {
  width: 100%;
  display: block;
  border-radius: 6px;
}
.qr-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-primary);
  border-style: solid;
  z-index: 2;
}
.qr-corner-tl { top: 6px; left: 6px; border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.qr-corner-tr { top: 6px; right: 6px; border-width: 3px 3px 0 0; border-radius: 0 3px 0 0; }
.qr-corner-bl { bottom: 6px; left: 6px; border-width: 0 0 3px 3px; border-radius: 0 0 0 3px; }
.qr-corner-br { bottom: 6px; right: 6px; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }

.qr-scan-line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  z-index: 3;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.9);
  animation: scanLine 2.5s ease-in-out infinite;
}
@keyframes scanLine {
  0% { top: 12px; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: calc(100% - 14px); opacity: 0; }
}

.qr-overlay-text {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.qr-verify-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.verify-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.verify-step strong {
  color: #fff;
}
.vs-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.66rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  margin-bottom: 12px;
}
.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* Card Bottom Micro Bar */
.card-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.qr-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.qr-timer svg {
  color: var(--accent-amber);
}
#timer-count {
  font-weight: 700;
  color: var(--accent-amber);
}
.trust-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ===== FOOTER ===== */
.footer-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
  padding: 18px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-notice strong {
  color: var(--text-secondary);
}

/* ===== EDIT FAB & PANEL ===== */
.edit-fab {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.28;
  box-shadow: none;
  z-index: 100;
  transition: all 0.25s ease;
}
.edit-fab svg {
  width: 12px;
  height: 12px;
}
.edit-fab:hover, .edit-fab:active {
  opacity: 0.95;
  color: #fff;
  background: rgba(99, 102, 241, 0.35);
  border-color: rgba(99, 102, 241, 0.6);
  transform: scale(1.15);
}

.edit-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  height: 100vh;
  height: 100dvh;
  background: #0d1222;
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.7);
  padding: 24px;
  z-index: 200;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.edit-panel.open {
  right: 0;
}
.edit-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.edit-panel-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.edit-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.edit-field {
  margin-bottom: 14px;
}
.edit-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.edit-field input, .edit-field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}
.edit-field select option {
  background: #0d1222;
  color: #fff;
}
.edit-save-btn {
  width: 100%;
  background: var(--gradient-main);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  font-family: inherit;
}
.simulate-btn {
  width: 100%;
  background: rgba(16, 217, 129, 0.12);
  border: 1px solid rgba(16, 217, 129, 0.3);
  color: #34d399;
  border-radius: 8px;
  padding: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
}

/* Success Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 300;
  place-items: center;
  padding: 16px;
}
.modal-box {
  background: #0d1224;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}
.modal-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
}
.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.modal-ref {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--accent-emerald);
  font-family: monospace;
  margin-bottom: 20px;
}
.modal-close-btn {
  width: 100%;
  background: var(--gradient-main);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(12px);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ========================================================
   RESPONSIVE DESIGN (MOBILE-FIRST OPTIMIZATIONS)
   ======================================================== */

/* Tablets & Small Laptops */
@media (max-width: 960px) {
  .app-wrapper {
    padding: 0 18px 20px;
  }
  .main-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .right-panel {
    max-width: 520px;
    margin: 0 auto;
  }
}

/* Smartphones & Mobile Devices (Device Width / Height Adaptations) */
@media (max-width: 768px) {
  .app-wrapper {
    padding: 0 14px 16px;
  }
  .header {
    padding: 14px 0 18px;
  }
  .logo-icon {
    width: 36px;
    height: 36px;
  }
  .logo-text {
    font-size: 1.25rem;
  }
  .header-badge {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  /* ORDER FLIP ON MOBILE: User immediately sees the payment card! */
  .main-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  .left-panel {
    order: 2;
    gap: 16px;
  }
  .right-panel {
    order: 1;
    max-width: 100%;
    margin: 0;
  }

  /* Compact hero on mobile */
  .hero-title {
    font-size: 1.75rem;
    letter-spacing: -0.4px;
  }
  .hero-sub {
    font-size: 0.84rem;
  }

  /* Borrower Card on Mobile */
  .borrower-card {
    padding: 16px;
    gap: 14px;
    border-radius: 16px;
  }
  .bc-avatar {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }
  .bc-name {
    font-size: 0.95rem;
  }
  .bc-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .bc-item {
    padding: 10px 12px;
  }
  .bc-val.amount-val {
    font-size: 1.05rem;
  }

  /* Payment Card on Mobile: Front and center! */
  .qr-card {
    padding: 18px 16px;
    border-radius: 18px;
  }
  .total-payable-bar {
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .tpb-amount {
    font-size: 1.35rem;
  }

  /* Action Buttons on Mobile: Large thumb targets */
  .pay-action-btn {
    padding: 13px 15px;
  }
  .pab-icon {
    width: 38px;
    height: 38px;
  }
  .pab-title {
    font-size: 0.92rem;
  }
  .pab-sub {
    font-size: 0.68rem;
  }

  .security-pillars {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .edit-panel {
    width: 100%;
    right: -105%;
  }

  .footer-notice {
    font-size: 0.68rem;
    padding: 14px 0;
  }
}

/* Very Small Screens (<= 380px) */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.5rem;
  }
  .loan-type-tabs {
    grid-template-columns: 1fr;
  }
  .bc-grid {
    grid-template-columns: 1fr;
  }
  .tpb-amount {
    font-size: 1.25rem;
  }
}


/* Header Actions & Share Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-share-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.32;
  transition: all 0.25s ease;
  padding: 0;
  margin: 0;
}
.header-share-btn svg {
  width: 11px;
  height: 11px;
}
.header-share-btn:hover, .header-share-btn:active {
  opacity: 0.95;
  color: var(--accent-cyan);
  background: rgba(0, 185, 241, 0.22);
  border-color: rgba(0, 185, 241, 0.45);
  transform: scale(1.15);
}
.share-link-btn {
  width: 100%;
  background: linear-gradient(135deg, #00b9f1, #0070ba);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: var(--transition);
}
.share-link-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.reset-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  font-family: inherit;
  transition: var(--transition);
}
.reset-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}



