/* ═══════════════════════════════════════════
   RAZORTEST — Premium Dark Theme
   ═══════════════════════════════════════════ */

:root {
  /* Core palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(23, 33, 54, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-input: rgba(255, 255, 255, 0.06);

  /* Accent — Razorpay blue */
  --accent: #528FF0;
  --accent-hover: #3a7de8;
  --accent-glow: rgba(82, 143, 240, 0.25);
  --accent-soft: rgba(82, 143, 240, 0.1);

  /* Razorpay brand */
  --razorpay: #072654;
  --razorpay-hover: #0a3578;

  /* Semantic colors */
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --error: #ef4444;
  --error-soft: rgba(239, 68, 68, 0.12);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  /* Dimensions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle animated background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(82, 143, 240, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(99, 102, 241, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }

input, button { font-family: inherit; }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon { color: var(--accent); display: flex; }

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge-test {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-link.active { color: var(--accent); }

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8125rem; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-razorpay {
  background: var(--razorpay);
  color: #fff;
  font-size: 1rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(7, 38, 84, 0.4);
}
.btn-razorpay:hover {
  background: var(--razorpay-hover);
  box-shadow: 0 6px 28px rgba(7, 38, 84, 0.5);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-glass);
}

.btn-loader {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════════ */
.page { position: relative; z-index: 1; }

.page-auth { min-height: 100vh; display: flex; }

.auth-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background:
    linear-gradient(135deg, rgba(82, 143, 240, 0.06) 0%, transparent 60%),
    var(--bg-secondary);
  border-right: 1px solid var(--border);
}

.auth-hero-content { max-width: 420px; }
.auth-hero-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 1rem 0 0.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo { animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.auth-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-features { display: flex; flex-direction: column; gap: 0.75rem; }
.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.auth-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.auth-card-subtitle {
  color: var(--text-secondary);
  margin: 0.25rem 0 1.75rem;
  font-size: 0.9375rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.2px;
}

.form-group input,
.input-with-prefix input {
  width: 100%;
  padding: 0.7rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.input-with-prefix input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder { color: var(--text-muted); }

.input-with-prefix {
  position: relative;
}
.input-prefix {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
}
.input-with-prefix input {
  padding-left: 2rem;
}

/* ═══════════════════════════════════════════
   CONTAINER & PAGE HEADER
   ═══════════════════════════════════════════ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
  white-space: nowrap;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}
.status-live { background: var(--success); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ═══════════════════════════════════════════
   STATS GRID
   ═══════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.stat-icon-blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon-green { background: var(--success-soft); color: var(--success); }
.stat-icon-amber { background: var(--warning-soft); color: var(--warning); }

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  display: block;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ═══════════════════════════════════════════
   CHECKOUT SECTION
   ═══════════════════════════════════════════ */
.checkout-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.checkout-card, .activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.checkout-header {
  padding: 1.5rem 1.5rem 0;
}
.checkout-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.checkout-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.checkout-body {
  padding: 1.5rem;
}

/* Amount selector chips */
.amount-selector { margin-bottom: 1.25rem; }
.amount-selector > label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chip {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.custom-amount label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.checkout-summary {
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.875rem;
}
.summary-row span:first-child { color: var(--text-secondary); }
.summary-row span:last-child { font-weight: 600; }

.text-amber { color: var(--warning); }

/* ═══════════════════════════════════════════
   ACTIVITY CARD
   ═══════════════════════════════════════════ */
.activity-card {
  padding: 1.5rem;
}
.activity-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.activity-status {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-status.paid { background: var(--success); }
.activity-status.created { background: var(--warning); }
.activity-status.failed, .activity-status.signature_failed { background: var(--error); }

.activity-info { flex: 1; min-width: 0; }
.activity-info strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-info small {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.activity-amount {
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.activity-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.activity-empty p { margin-top: 0.75rem; font-size: 0.875rem; }

/* ═══════════════════════════════════════════
   PAYMENTS TABLE
   ═══════════════════════════════════════════ */
.payments-table-wrapper {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.payments-table th {
  text-align: left;
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-glass);
}

.payments-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.payments-table tr:last-child td { border-bottom: none; }

.payments-table tbody tr:hover td {
  background: var(--bg-glass);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge.paid {
  background: var(--success-soft);
  color: var(--success);
}
.status-badge.created {
  background: var(--warning-soft);
  color: var(--warning);
}
.status-badge.failed, .status-badge.signature_failed {
  background: var(--error-soft);
  color: var(--error);
}

.table-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.3s ease-out;
}

.toast.removing { animation: toastOut 0.3s ease-in forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--accent); }

/* ═══════════════════════════════════════════
   SUCCESS MODAL
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card h2 { font-size: 1.375rem; font-weight: 700; margin-top: 1rem; }
.modal-subtitle { color: var(--text-secondary); margin: 0.25rem 0 1.25rem; }

.modal-details {
  text-align: left;
  padding: 1rem;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}

.modal-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  gap: 0.5rem;
}
.modal-details .detail-row span:first-child { color: var(--text-muted); }
.modal-details .detail-row span:last-child {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

/* Checkmark animation */
.success-animation { width: 56px; height: 56px; margin: 0 auto; }

.checkmark {
  width: 56px; height: 56px;
  border-radius: 50%;
  stroke-width: 2;
  stroke: var(--success);
  stroke-miterlimit: 10;
  animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--success);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}
@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
  100% { box-shadow: inset 0 0 0 30px var(--success-soft); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .auth-container { flex-direction: column; }
  .auth-hero {
    padding: 2rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .auth-hero-content h1 { font-size: 2rem; }
  .checkout-section { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .container { padding: 1rem; }
  .nav-link span { display: none; }
  .page-header { flex-direction: column; gap: 0.75rem; }
  .auth-form-section { padding: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .amount-chips { gap: 0.375rem; }
  .chip { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
}
