@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Poppins:wght@500;600;700;800&display=swap');

:root {
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-ui: 'Poppins', sans-serif;

  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: #1a1f2e;
  min-height: 100vh;
  padding: 1.5rem 1rem;
  color: var(--text-primary);
  position: relative;
}

/* Stable premium background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Global Container (Restored for Admin/Login/Success) */
.container {
  max-width: 560px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 40px 80px -20px rgba(0, 0, 0, 0.4),
    0 20px 40px -20px rgba(99, 102, 241, 0.5);
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Payment Page Specific Container */
.payment-container {
  max-width: 480px;
  margin: 2rem auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  border: none;
  z-index: 1;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Global Header (Restored for Admin/Success) */
.header {
  background: var(--gradient-primary);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Payment Page Specific Header */
.payment-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  padding: 2.5rem 2rem 3rem;
  text-align: center;
  color: white;
  clip-path: ellipse(150% 100% at 50% 0%);
  position: relative;
  overflow: hidden;
}

/* Subtle shine effect */
.header::before,
.payment-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shine 8s ease-in-out infinite;
}

@keyframes shine {

  0%,
  100% {
    transform: translateX(-100%) translateY(-100%);
  }

  50% {
    transform: translateX(100%) translateY(100%);
  }
}

.header h1 {
  font-family: 'Sora', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  color: white;
  margin: 0 0 0.75rem 0;
  position: relative;
  z-index: 10;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.2),
    0 4px 20px rgba(0, 0, 0, 0.15);
}

.payment-header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 10;
}

.header p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.0625rem;
  font-weight: 600;
  position: relative;
  z-index: 10;
  letter-spacing: 0.3px;
}

.payment-header p {
  font-family: var(--font-body);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  position: relative;
  z-index: 10;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 1rem;
  color: white;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
}

/* Payment Badge override handled by specific class if needed, or reuses .badge */

/* Content Area */
.content {
  padding: 2rem 1.5rem;
}

.payment-content {
  padding: 0 1.5rem 2rem;
  margin-top: -2rem;
  /* Overlap header */
  position: relative;
  z-index: 10;
}

/* Amount Card - The Hero Section */
.amount-display {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  /* Soft shadow */
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.amount-label {
  font-family: var(--font-ui);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.amount-value {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  color: #111827;
  /* Near black */
  font-weight: 800;
  letter-spacing: -1px;
}

/* Customer Info - Clean list style */
.customer-info {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.info-label {
  font-family: var(--font-body);
  color: var(--text-secondary);
  /* Grey */
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  /* Normal case */
  letter-spacing: 0;
  margin: 0;
}

.info-value {
  font-family: var(--font-heading);
  color: #1e293b;
  /* Dark Slate */
  font-size: 1.1rem;
  font-weight: 600;
  text-align: right;
}

/* QR Code Section */
.qr-section {
  background: #f8fafc;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
  border: 1px dashed #cbd5e1;
}

.qr-title {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

#qrCode {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

/* Form Styles */
.submit-section {
  background: #ffffff;
  border: none;
  padding: 0;
  margin-top: 2rem;
}

.form-label {
  /* For Admin/Login, keep uppercase/bold. For Payment, override if needed or use specific class */
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.payment-form-label {
  text-transform: none;
  font-size: 0.9rem;
  color: #475569;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 14px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.payment-input {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  height: 50px;
  border-radius: 10px;
  font-size: 1rem;
  color: #0f172a;
  padding-left: 1rem;
}

.form-input:hover,
.payment-input:hover {
  background: #f1f5f9;
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.payment-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 600;
  line-height: 1.5;
}

/* Button Styling (Global for Admin/Login) */
.btn {
  width: 100%;
  padding: 1.125rem 2rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 10px 30px rgba(99, 102, 241, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 400px;
  height: 400px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 20px 40px rgba(99, 102, 241, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Payment Button Specifics */
.payment-btn {
  background: #2563eb;
  /* Strong Blue */
  height: 56px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  text-transform: none;
  /* Look friendlier */
}

.payment-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn:active,
.payment-btn:active {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  padding: 1rem 1.125rem;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  display: none;
  font-weight: 700;
  border-left: 4px solid #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  font-size: 0.9375rem;
}

/* Success Page Styles (restored) */
.success-container {
  max-width: 520px;
}

.result-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid var(--success);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  margin-top: 1.5rem;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.success-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: white;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.35);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.link-display {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-direction: column;
}

.link-input {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  background: white;
  font-weight: 700;
  border-color: rgba(16, 185, 129, 0.3);
}

.copy-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--gradient-success);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.4);
  font-size: 0.9375rem;
}

.copy-btn:hover {
  box-shadow: 0 20px 50px rgba(16, 185, 129, 0.5);
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 100px;
  margin: 0.375rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.3s ease;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0.5rem 0;
}

.toggle-btn:hover {
  color: var(--primary-dark);
  transform: translateX(-4px);
}

.advanced-options {
  display: none;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Step Indicators */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-heading);
}

.step-dot.active {
  background: #2563eb;
  color: white;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.step-line {
  width: 40px;
  height: 2px;
  background: #e2e8f0;
}

.step-line.active {
  background: #2563eb;
}

/* Updated Submit Section */
.submit-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.submit-header h3 {
  font-family: var(--font-heading);
  color: #0f172a;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.submit-header p {
  color: #64748b;
  font-size: 0.9rem;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem;
    /* Restore padding for general pages */
  }

  /* Payment Page Body Override */
  body.payment-page {
    padding: 0;
  }

  .container {
    border-radius: 20px;
    max-width: 100%;
  }

  .payment-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .payment-content {
    padding: 0 1.25rem 2rem;
  }

  .amount-display {
    padding: 1.5rem;
  }

  .amount-value {
    font-size: 2.25rem;
  }

  .payment-header {
    border-radius: 0;
  }

  .header {
    padding: 2.5rem 1.5rem 2rem;
  }

  .header h1 {
    font-size: 1.875rem;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .detail-value {
    text-align: left;
    font-size: 1rem;
  }
}

/* Small mobile devices */
@media (max-width: 375px) {
  .header h1 {
    font-size: 1.625rem;
  }
}