/* ============================================================
   TopupKu – Main Stylesheet (Light Theme)
   ============================================================ */

:root {
  --primary: #5b3df5;
  --primary-dark: #4528d4;
  --primary-light: #ede9ff;
  --secondary: #00b884;
  --accent: #ff6b35;
  --bg: #f5f6fa;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f8ff;
  --border: #e4e6ef;
  --border-light: #f0f1f8;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(91,61,245,0.15);
}

* { 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.2rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-muted); }

.text-gradient {
  background: linear-gradient(135deg, #5b3df5, #00b884);
  -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;
  box-shadow: 0 4px 14px rgba(91,61,245,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-outline {
  border: 2px solid var(--border);
  color: var(--text);
  background: var(--bg-white);
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }

.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(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 0;
  box-shadow: var(--shadow-sm);
}
.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(--primary); }
@media (max-width: 768px) { .nav-links { display: none; } }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #f0ecff 0%, #e8f8f3 50%, #fef3ec 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(91,61,245,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.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: linear-gradient(135deg, #ede9ff, #ddf5ef);
  border: 1px solid #c4b5fd;
  color: var(--primary);
  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; color: var(--text); }
.hero-text p { font-size: 1.1rem; 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 card */
.hero-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.card-header {
  background: var(--bg);
  padding: 0.75rem 1rem;
  display: flex; gap: 0.4rem; align-items: center;
  border-bottom: 1px solid var(--border);
}
.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: 0.75rem; }
.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);
  transition: box-shadow 0.2s;
}
.wallet-row:hover { box-shadow: var(--shadow-sm); }
.wallet-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: #fff; padding: 3px; object-fit: contain;
  border: 1px solid var(--border);
}
.wallet-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.wallet-price { color: var(--text-muted); font-size: 0.8rem; }
.tag-instant {
  margin-left: auto;
  background: rgba(5,150,105,0.1);
  color: var(--success);
  border: 1px solid rgba(5,150,105,0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}

/* ── Products ───────────────────────────────────────────── */
.section-products { padding: 5rem 0; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: 0.5rem; color: var(--text); }

.category-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 2rem;
  flex-wrap: wrap; justify-content: center;
}
.tab-btn {
  padding: 0.55rem 1.4rem;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--text-muted);
  border-radius: 50px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; box-shadow: 0 4px 12px rgba(91,61,245,0.3);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.product-card {
  background: var(--bg-white);
  border: 1.5px 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;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.product-logo-wrap {
  width: 52px; height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.875rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.product-logo-wrap img {
  width: 40px; height: 40px;
  object-fit: contain;
}
.product-logo-wrap .emoji-fallback {
  font-size: 1.6rem; line-height: 1;
}
.product-brand { font-size: 0.75rem; color: var(--text-faint); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.product-nominal { font-size: 1.1rem; font-weight: 700; margin: 0.2rem 0; color: var(--text); }
.product-desc { font-size: 0.78rem; color: var(--text-faint); margin-bottom: 0.75rem; }
.product-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; }
.product-price { font-size: 1rem; font-weight: 700; color: var(--primary); }

/* Loading */
.loading-spinner {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem; gap: 1rem;
}
.spinner {
  width: 38px; height: 38px;
  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: 4rem 0; background: var(--bg); }
.order-card {
  max-width: 540px; margin: 0 auto;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.order-card h2 { margin-bottom: 1.5rem; color: var(--text); }
.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;
}
.opi-name { font-weight: 700; color: var(--text); }
.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); font-size: 0.95rem; }
.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, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,61,245,0.1); }
.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;
  background: var(--bg);
}
.payment-option input[type="radio"] { display: none; }
.payment-option.active { border-color: var(--primary); background: var(--primary-light); }
.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; color: var(--text); }
.payment-option small { color: var(--text-muted); font-size: 0.8rem; }

.crypto-options {
  background: var(--primary-light);
  border: 1px solid #c4b5fd;
  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: 1.5px 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-light); }
.summary-row span:first-child { color: var(--text-muted); }
.summary-row span:last-child { font-weight: 600; color: var(--text); }
.summary-row.total span { 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.35); backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: var(--bg-white);
  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;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.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 */
.qris-modal h3 { margin-bottom: 0.5rem; color: var(--text); }
.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: 240px; text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.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-light); }
.pib-row span:first-child { color: var(--text-muted); }
.pib-row span:last-child { font-weight: 600; color: var(--text); }
.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(217,119,6,0.1); color: var(--warning); }
.status-badge.paid    { background: rgba(5,150,105,0.1);  color: var(--success); }
.status-badge.expired { background: rgba(220,38,38,0.1);  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: 700; }

.modal-note {
  font-size: 0.8rem; color: var(--text-faint);
  text-align: center; line-height: 1.5;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 0.75rem; margin-top: 1rem;
}

.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 */
.crypto-address-box {
  background: var(--bg); border: 1.5px 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; color: var(--text);
}
.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-steps {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f0ecff 0%, #e8f8f3 100%);
}
.steps-grid {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; flex-wrap: wrap;
}
.step-card {
  background: var(--bg-white); 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; box-shadow: var(--shadow);
}
.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; color: var(--text); }
.step-arrow { font-size: 1.5rem; color: var(--text-faint); }
@media (max-width: 600px) { .step-arrow { display: none; } }

/* ── Features ───────────────────────────────────────────── */
.section-features { padding: 5rem 0; background: var(--bg-white); }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; color: var(--text); }

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--text); color: #e5e7eb;
  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; color: #fff; }
.footer-brand p { max-width: 280px; font-size: 0.9rem; color: #9ca3af; }
.footer-links h4, .footer-contact h4 { margin-bottom: 1rem; color: #fff; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 0.1rem; }
.footer-links a, .footer-contact a {
  color: #9ca3af; text-decoration: none;
  font-size: 0.9rem; padding: 0.35rem 0; transition: color 0.2s;
}
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #374151;
  padding: 1.5rem 0; text-align: center;
}
.footer-bottom p { font-size: 0.85rem; color: #9ca3af; }
.footer-bottom a { color: #a78bfa; text-decoration: none; }

/* 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); }

/* ── Logo mark ──────────────────────────────────────────── */
.logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; flex-shrink: 0;
}

/* ── Logo wrap fallback ─────────────────────────────────── */
.logo-text-fallback {
  font-size: 0.85rem; font-weight: 800;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}

/* ── Voucher ────────────────────────────────────────────── */
.voucher-input-wrap { display: flex; gap: 0.5rem; }
.voucher-input-wrap input { flex: 1; }
.btn-apply-voucher {
  background: var(--primary); color: #fff; border: none;
  padding: 0.75rem 1rem; border-radius: var(--radius);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: opacity 0.2s; font-size: 0.9rem;
}
.btn-apply-voucher:hover { opacity: 0.85; }
.voucher-success { color: var(--success) !important; font-weight: 600; }
.voucher-error   { color: var(--error)   !important; }
.summary-row.discount span:last-child { color: var(--success); }

/* ── Payment method info (QRIS only) ────────────────────── */
.payment-method-info {
  display: flex; align-items: center; gap: 1rem;
  background: var(--primary-light);
  border: 1.5px solid #c4b5fd;
  border-radius: var(--radius);
  padding: 1rem; margin-bottom: 1.5rem;
}
.pmi-icon {
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: 0.8rem;
  padding: 0.4rem 0.6rem; border-radius: 6px;
  flex-shrink: 0;
}
.payment-method-info strong { display: block; color: var(--text); font-size: 0.95rem; }
.payment-method-info small  { color: var(--text-muted); font-size: 0.8rem; }

/* ── Feature label ──────────────────────────────────────── */
.feature-label {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.65rem; border-radius: 50px;
  margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
}
