/* ============================================================
   TopupKu – Main Stylesheet
   ============================================================ */

:root {
  --primary: #6c47ff;
  --primary-dark: #5335e0;
  --primary-light: #ede9ff;
  --secondary: #00c896;
  --accent: #ff6b35;
  --bg: #0a0a0f;
  --bg-card: #13131a;
  --bg-card-hover: #1a1a25;
  --border: #2a2a3a;
  --text: #f0f0f5;
  --text-muted: #8888a8;
  --text-faint: #555570;
  --success: #00c896;
  --warning: #ffb800;
  --error: #ff4757;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(108, 71, 255, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ─────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { color: var(--text-muted); }

.text-gradient {
  background: linear-gradient(135deg, #6c47ff, #00c896);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108, 71, 255, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.875rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-outline {
  border: 2px solid var(--border);
  color: var(--text);
  background: transparent;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-back {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: opacity 0.2s;
}
.btn-back:hover { opacity: 0.7; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  background: radial-gradient(ellipse at 60% 0%, rgba(108, 71, 255, 0.15) 0%, transparent 60%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { display: none; }
}

.badge {
  display: inline-block;
  background: rgba(108, 71, 255, 0.2);
  border: 1px solid rgba(108, 71, 255, 0.4);
  color: #a688ff;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-text h1 { margin-bottom: 1.25rem; }
.hero-text p { font-size: 1.125rem; margin-bottom: 2rem; max-width: 480px; }

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Hero visual card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.card-header {
  background: var(--bg-card-hover);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.green  { background: #2ecc71; }
.dot.yellow { background: #f1c40f; }
.dot.red    { background: #e74c3c; }

.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.wallet-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wallet-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  object-fit: contain;
}

.wallet-name { font-weight: 600; font-size: 0.9rem; }
.wallet-price { color: var(--text-muted); font-size: 0.8rem; }

.tag-instant {
  margin-left: auto;
  background: rgba(0, 200, 150, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 200, 150, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Products Section ───────────────────────────────────── */
.section-products {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 { margin-bottom: 0.5rem; }

.category-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tab-btn {
  padding: 0.6rem 1.5rem;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108,71,255,0.05), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(108, 71, 255, 0.2);
}

.product-card:hover::before { opacity: 1; }

.product-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.product-logo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.product-brand { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.product-nominal { font-size: 1.25rem; font-weight: 700; margin: 0.2rem 0; }
.product-desc { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 0.75rem; }
.product-price { font-size: 1rem; font-weight: 700; color: var(--primary); }
.product-original { font-size: 0.8rem; color: var(--text-faint); }

.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 0.75rem;
}

/* Loading */
.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Order Section ──────────────────────────────────────── */
.section-order { padding: 5rem 0; }

.order-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.order-card h2 { margin-bottom: 1.5rem; }

.order-product-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.order-product-info .product-logo {
  margin-bottom: 0;
  width: 44px;
  height: 44px;
}

.opi-name { font-weight: 700; }
.opi-nominal { color: var(--text-muted); font-size: 0.875rem; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
}

.form-group input::placeholder { color: var(--text-faint); }

.form-hint {
  display: block;
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.required { color: var(--error); }

/* Payment options */
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.payment-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.payment-option input[type="radio"] { display: none; }

.payment-option.active {
  border-color: var(--primary);
  background: rgba(108, 71, 255, 0.08);
}

.payment-option-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
}

.payment-icon { font-size: 1.5rem; }
.payment-option strong { display: block; font-size: 0.95rem; }
.payment-option small { color: var(--text-muted); font-size: 0.8rem; }

.crypto-options {
  background: rgba(108, 71, 255, 0.05);
  border: 1px solid rgba(108, 71, 255, 0.2);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.crypto-options .form-group:last-child { margin-bottom: 0; }

/* Order summary */
.order-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.summary-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.summary-row span:first-child { color: var(--text-muted); }
.summary-row span:last-child { font-weight: 600; }

.summary-row.total span { color: var(--text); font-weight: 700; }
.summary-row.total span:last-child { color: var(--primary); font-size: 1.1rem; }

/* ── Modal ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

/* QRIS modal content */
.qris-modal h3 { margin-bottom: 0.5rem; }
.qris-modal p  { margin-bottom: 1.5rem; }

.qris-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0 auto 1.5rem;
  max-width: 260px;
  text-align: center;
}

.qris-container svg { width: 100%; height: auto; }

.payment-info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.pib-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.pib-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.pib-row span:first-child { color: var(--text-muted); }
.pib-row span:last-child { font-weight: 600; }
.pib-row .amount-total { color: var(--primary); font-size: 1.05rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.pending { background: rgba(255, 184, 0, 0.15); color: var(--warning); }
.status-badge.paid    { background: rgba(0, 200, 150, 0.15); color: var(--success); }
.status-badge.expired { background: rgba(255, 71, 87, 0.15); color: var(--error); }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.expire-timer {
  font-size: 0.85rem;
  color: var(--warning);
  font-weight: 600;
}

.modal-note {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.5;
}

.paid-success {
  text-align: center;
  padding: 1.5rem 0;
}

.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.paid-success h3 { color: var(--success); margin-bottom: 0.5rem; }

/* Crypto modal */
.crypto-modal h3 { margin-bottom: 0.5rem; }

.crypto-address-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.875rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.copy-btn {
  flex-shrink: 0;
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.copy-btn:hover { opacity: 0.85; }

/* ── Steps Section ──────────────────────────────────────── */
.section-steps {
  padding: 5rem 0;
  background: radial-gradient(ellipse at center, rgba(108, 71, 255, 0.05) 0%, transparent 70%);
}

.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  flex: 1;
  min-width: 200px;
  max-width: 260px;
  position: relative;
}

.step-number {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.step-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.step-card h3 { margin-bottom: 0.5rem; }
.step-arrow { font-size: 1.5rem; color: var(--text-faint); }

@media (max-width: 600px) { .step-arrow { display: none; } }

/* ── Features ───────────────────────────────────────────── */
.section-features {
  padding: 5rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 4rem 0 0;
  margin-top: 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { max-width: 280px; font-size: 0.9rem; }

.footer-links h4,
.footer-contact h4 {
  margin-bottom: 1rem;
  color: var(--text);
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.footer-links a,
.footer-contact a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.35rem 0;
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-contact a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

.footer-bottom p { font-size: 0.85rem; }
.footer-bottom a { color: var(--primary); text-decoration: none; }

/* ── Misc ───────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
