:root {
  --primary: #007fff;
  --primary-hover: #0066cc;
  --primary-soft: #eef6ff;
  --primary-border: #bfdbfe;
  --navy: #0f172a;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-alt: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --amber: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 12px 35px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-btn: 0 6px 18px rgba(0, 127, 255, 0.28);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--surface-soft);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.checkout-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  transition: all 0.2s ease;
}

.back-link:hover {
  background: #dfeeff;
  color: var(--primary-hover);
}

.back-arrow {
  font-size: 1.15rem;
  line-height: 1;
}

.checkout-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--navy);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.checkout-brand b {
  color: var(--primary);
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* ==========================================================================
   STEP INDICATOR
   ========================================================================== */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 16px 0;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-item.active {
  color: var(--primary);
  font-weight: 800;
}

.step-item.done {
  color: #10b981;
  font-weight: 700;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-item.active .step-num {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 127, 255, 0.4);
}

.step-item.done .step-num {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.step-line.active {
  background: var(--primary);
}

/* ==========================================================================
   MAIN CARD & GRID (FULL-PAGE DESKTOP & MOBILE)
   ========================================================================== */
.checkout-main {
  flex: 1;
  padding-bottom: 50px;
}

.checkout-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 600px;
}

/* Sisi Kiri: Ringkasan Paket */
.plan-summary-col {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
}

.summary-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 6px;
  border: 1px solid var(--primary-border);
  margin-bottom: 12px;
}

.plan-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.plan-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 24px;
}

.plan-price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.price-currency {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.price-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.price-period {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-benefits-box {
  flex: 1;
}

.benefits-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 14px;
}

.benefits-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.benefit-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.benefits-list strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
}

.benefits-list p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.benefits-list code {
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--navy);
}

.plan-guarantee {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px dashed var(--line-strong);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.guarantee-icon {
  font-size: 1.25rem;
}

/* Sisi Kanan: Formulir Registrasi */
.form-content-col {
  padding: 40px 44px;
}

.form-header {
  margin-bottom: 28px;
}

.form-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}

.required-star {
  color: var(--danger);
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--navy);
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 127, 255, 0.15);
}

.slug-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.slug-val {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--primary-border);
  font-family: monospace;
  font-size: 0.85rem;
}

.slug-val b {
  font-weight: 700;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-hint code {
  background: var(--surface-alt);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* Kotak Ringkasan Paket & Harga (Diatas Tombol Bayar) */
.order-summary-box-form {
  background: var(--surface-soft);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 4px 0;
  box-shadow: 0 2px 8px rgba(0, 127, 255, 0.06);
}

.summary-box-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-box-plan {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.summary-box-days {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.summary-box-right {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.summary-box-cur {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.summary-box-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* Tombol Submit */
.btn-checkout-primary {
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-checkout-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  cursor: pointer;
}

.btn-checkout-secondary:hover {
  background: #e0e7ff;
}

.btn-checkout-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 127, 255, 0.35);
}

.btn-checkout-primary:active {
  transform: translateY(0);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* Alert Boxes */
.alert-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.alert-success {
  background: var(--success-soft);
  border: 1px solid #a7f3d0;
  color: #047857;
}

/* ==========================================================================
   VIEW 2: HALAMAN PEMBAYARAN QRIS COMPACT (LANGSUNG TAMPIL TANPA SCROLL)
   ========================================================================== */
.payment-compact-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 22px 20px 20px 20px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}

.payment-compact-header {
  text-align: center;
  margin-bottom: 12px;
}

.payment-compact-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.payment-compact-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.payment-compact-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Frame QRIS Compact */
.qr-compact-wrapper {
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.qr-code-img {
  width: 175px;
  height: 175px;
  display: block;
  object-fit: contain;
}

/* Tombol Buka Halaman QR */
.btn-open-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  height: 38px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 127, 255, 0.25);
  transition: all 0.2s ease;
}

.btn-open-qr:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Box Rincian Pembayaran (Teks Hitam Tebal & Langsung Terlihat) */
.compact-info-box {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compact-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.compact-info-row.total-row {
  padding-bottom: 8px;
}

.c-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.c-val-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.c-rp {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

/* Teks Hitam Tebal */
.c-total-bold {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.c-invoice-bold {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  font-family: monospace;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-copy-small {
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: 4px;
  cursor: pointer;
}

.btn-copy-small:hover {
  background: var(--primary);
  color: #ffffff;
}

.c-timer-bold {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  font-family: monospace;
}

.compact-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse-dot 1.8s infinite;
}

.compact-status-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Extra Actions */
.compact-extra-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.link-download-qr {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.link-download-qr:hover {
  text-decoration: underline;
}

.extra-dot {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.btn-manual-check-small {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-manual-check-small:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* ==========================================================================
   VIEW 3: SUKSES
   ========================================================================== */
.success-card {
  padding: 60px 40px;
  text-align: center;
  max-width: 650px;
  margin: 0 auto;
}

.success-icon-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 20px auto;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.success-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
}

.success-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  line-height: 1.5;
}

.success-loading-bar {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 30px;
}

.loading-progress {
  width: 100%;
  height: 100%;
  background: var(--primary);
  animation: progress-slide 2s ease infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.checkout-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 20px 0;
  margin-top: auto;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-content a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

/* ==========================================================================
   RESPONSIVE (HP / MOBILE FRIENDLY)
   ========================================================================== */
@media (max-width: 860px) {
  .checkout-header {
    padding: 10px 0;
  }

  .header-container {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .back-link {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .checkout-main {
    padding-bottom: 20px;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .plan-summary-col {
    display: none !important;
  }

  .form-content-col {
    padding: 24px 16px;
  }

  .payment-compact-card {
    padding: 16px 14px 16px 14px;
    border-radius: var(--radius-md);
    margin: 8px auto;
  }

  .qr-code-img {
    width: 160px;
    height: 160px;
  }

  .secure-badge {
    display: none;
  }

  .step-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .checkout-main { padding-bottom: 12px; }
  .checkout-card { border-radius: 14px; }
  .form-content-col { padding: 18px 14px; }
  .form-header { margin-bottom: 18px; }
  .form-title { font-size: 1.35rem; margin-bottom: 4px; }
  .form-subtitle { font-size: 0.82rem; line-height: 1.35; }
  .order-form { gap: 14px; }
  .form-group { gap: 4px; }
  .form-label { font-size: 0.82rem; }
  .form-input { height: 44px; padding: 0 11px; font-size: 0.88rem; }
  .form-hint { font-size: 0.7rem; line-height: 1.3; }
  .slug-preview-bar { font-size: 0.72rem; gap: 5px; }
  .slug-val { padding: 2px 6px; font-size: 0.75rem; }
  .order-summary-box-form { padding: 10px 12px; }
  .summary-box-plan { font-size: 0.92rem; }
  .summary-box-days, .summary-box-cur { font-size: 0.72rem; }
  .summary-box-price { font-size: 1.2rem; }
  .btn-checkout-primary { height: 48px; font-size: 0.9rem; border-radius: 10px; }
  .btn-checkout-secondary { min-height: 44px; margin-top: 7px; font-size: 0.82rem; }
  .alert-box { padding: 10px 12px; font-size: 0.78rem; }
}

.verification-input-wrap { width: 100%; }
.verification-resend { align-self: flex-end; margin-top: 6px; margin-bottom: 8px; border: 0; background: transparent; color: #007FFF; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer; padding: 2px 0; }
.verification-resend:disabled { color: #007FFF; opacity: 0.7; cursor: not-allowed; }
.verification-resend:not(:disabled) { text-decoration: underline; text-underline-offset: 2px; }
