:root {
  --bg-primary: #07090e;
  --bg-card: rgba(15, 20, 32, 0.85);
  --bg-card-hover: rgba(22, 29, 46, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 240, 255, 0.4);
  --accent-cyan: #00f0ff;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 45%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  line-height: 1.5;
}

.checkout-wrapper {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px -10px rgba(99, 102, 241, 0.1);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(0, 240, 255, 0.2));
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.brand-logo img, .brand-logo svg {
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  display: block;
}

.security-tag {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-weight: 500;
}

/* Summary Card */
.order-summary {
  padding: 1.5rem 1.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.order-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.order-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

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

.price-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: #ffffff;
  letter-spacing: -0.03em;
}

.price-currency {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-left: 0.25rem;
}

/* Body / Provider Selector */
.checkout-body {
  padding: 1.5rem 1.75rem 2rem;
}

.provider-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(10, 14, 23, 0.7);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.provider-tab {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
}

.provider-tab svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.provider-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.provider-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.provider-tab.active.crypto-tab {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

/* Tab Panels */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

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

/* General Button Styles */
.btn-pay {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: all 0.2s ease;
}

.btn-razorpay {
  background: linear-gradient(135deg, #0c2340 0%, #002970 100%);
  color: #528ff0;
  border: 1px solid rgba(82, 143, 240, 0.35);
  box-shadow: 0 8px 20px -4px rgba(82, 143, 240, 0.2);
}

.btn-razorpay:hover {
  background: linear-gradient(135deg, #0e2a4d 0%, #00338d 100%);
  color: #ffffff;
  border-color: rgba(82, 143, 240, 0.6);
  transform: translateY(-1px);
}

.btn-crypto {
  background: linear-gradient(135deg, #00f0ff 0%, #6366f1 100%);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 8px 25px -5px rgba(0, 240, 255, 0.3);
}

.btn-crypto:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-pay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Crypto View */
.crypto-selector {
  margin-bottom: 1.25rem;
}

.crypto-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  display: block;
  font-weight: 500;
}

.select-wrapper {
  position: relative;
}

.select-crypto {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.2s;
}

.select-crypto:focus {
  border-color: var(--border-focus);
}

.crypto-estimate-badge {
  margin-top: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 240, 255, 0.05);
  border: 1px dashed rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.crypto-deposit-box {
  display: none;
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(10, 14, 23, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.qr-code {
  padding: 0.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-row {
  margin-bottom: 0.75rem;
  text-align: left;
}

.copy-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.copy-input-group {
  display: flex;
  gap: 0.4rem;
}

.copy-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.15);
}

.crypto-status-indicator {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent-amber);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-amber);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Success View */
.success-screen {
  display: none;
  text-align: center;
  padding: 2.5rem 1.75rem;
  animation: fadeIn 0.4s ease;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--accent-emerald);
}

.success-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* Footer */
.checkout-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.checkout-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.checkout-footer a:hover {
  color: var(--accent-cyan);
}

/* Loading & Toast States */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  body {
    padding: 0.75rem;
  }
  .checkout-wrapper {
    border-radius: var(--radius-md);
  }
  .checkout-header, .order-summary, .checkout-body {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .price-val {
    font-size: 1.5rem;
  }
}
