/* Design tokens — klon toko akun premium (rebuild NontonYuk).
   Sumber: replica/design/tokens.json. Komponen memakai var(--...) dan
   TIDAK PERNAH memakai hex mentah. Stack klon ini CSS polos (tanpa
   Tailwind), jadi file ini adalah pemetaan token-nya.
   Mode gelap: <html data-theme="dark">. */

:root {
  /* warna */
  --bg: #ffffff;
  --surface: #f7f7f7;
  --border: #dee2e6;
  --border-input: #6b7280;
  --text: #212529;
  --text-muted: #5b6470;
  --accent: #2f5bea; /* PLACEHOLDER netral; /replica-brand menetapkan warna merek */
  --on-accent: #ffffff;
  --danger: #c62f2f;
  --success: #1f7a4d;
  --warning: #92400e;
  /* tipografi */
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-xs: 12px; --leading-xs: 16px;
  --text-sm: 14px; --leading-sm: 20px;
  --text-base: 16px; --leading-base: 24px;
  --text-lg: 20px; --leading-lg: 28px;
  --text-xl: 28px; --leading-xl: 34px;
  --text-display: 40px; --leading-display: 44px;
  /* spasi (basis 8px; jarak antar kartu 32px) */
  --space-0: 0; --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  /* radius (tombol & kartu varian 4px; kartu produk 16px) */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 16px; --radius-pill: 999px;
  /* bayangan (kartu asli tanpa bayangan, hanya border) */
  --shadow-card: none;
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .16);
  /* gerak */
  --motion-fast: 120ms; --motion-base: 200ms;
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
  /* layout */
  --max-width: 1170px;
  --header-height: 80px;
  --grid-gap: 32px;
}

[data-theme="dark"] {
  --bg: #111111;
  --surface: #1e1e1e;
  --border: #333333;
  --border-input: #8a8a8a;
  --text: #eeeeee;
  --text-muted: #a8a8a8;
  --accent: #2f5bea;
  --on-accent: #ffffff;
  --danger: #e5484d;
  --success: #34c77b;
  --warning: #f5a623;
}

/* Token tambahan komponen — masih bagian blok token. Semua ukuran
   komponen di bawah memakai var(--...) dari blok ini atau blok di atas. */
:root {
  --thumb-size: 170px;
  --thumb-size-sm: 64px;
  --wa-fab: 56px;
  --wa-bg: #25d366;
  --qris-size: 240px;
  --code-size: 40px;
  --btn-height-sm: 32px;
  --btn-height-md: 40px;
  --btn-height-lg: 48px;
  --input-height: 40px;
  --tab-height: 35px;
  --slide-height: 300px;
  --grid-min: 200px;
  --icon-size: 24px;
  --border-width: 1px;
  --border-width-thick: 2px;
  --ring-width: 2px;
  /* Token tambahan untuk panel admin (blok <style> admin/index.html). */
  --space-05: 2px;
  --space-15: 6px;
  --space-25: 10px;
  --space-35: 14px;
  --space-45: 28px;
  --admin-wrap-w: 720px;
  --select-height: 36px;
  --thumb-admin: 56px;
  --thumb-preview-w: 220px;
  --variant-price-w: 110px;
  --variant-duration-w: 100px;
}

/* ===== Aturan komponen — hanya var(--...), tanpa nilai mentah ===== */
* { box-sizing: border-box; }

body {
  margin: var(--space-0);
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

a { color: var(--accent); }

.hidden { display: none !important; }

.container {
  max-width: var(--max-width);
  margin: var(--space-0) auto;
  padding: var(--space-0) var(--space-4);
}

/* Header sticky */
.site-header {
  position: sticky;
  top: var(--space-0);
  z-index: 20;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: var(--border-width) solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
  max-width: var(--max-width);
  margin: var(--space-0) auto;
  padding: var(--space-0) var(--space-4);
}

.logo {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  gap: var(--space-4);
  margin-left: auto;
  align-items: center;
}

.header-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 600;
}

.header-nav a:hover { color: var(--accent); }

.theme-toggle {
  width: var(--btn-height-md);
  height: var(--btn-height-md);
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

/* Tombol */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--btn-height-md);
  padding: var(--space-0) var(--space-4);
  border-radius: var(--radius-sm);
  border: var(--border-width) solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--motion-base) var(--motion-ease);
}

.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: var(--ring-width) solid var(--accent); outline-offset: var(--space-1); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-danger { background: var(--danger); color: var(--on-accent); }
.btn-sm { min-height: var(--btn-height-sm); padding: var(--space-0) var(--space-3); }
.btn-lg { min-height: var(--btn-height-lg); padding: var(--space-0) var(--space-5); font-size: var(--text-base); line-height: var(--leading-base); }
.btn-block { width: 100%; }

/* Slider beranda — manual, tanpa autoplay */
.slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--border);
  background: var(--surface);
  margin: var(--space-5) var(--space-0);
}

.slide { display: none; padding: var(--space-7) var(--space-5); min-height: var(--slide-height); }
.slide.active { display: block; }

.slide h2 {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  margin: var(--space-0) var(--space-0) var(--space-3);
}

.slide p {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  color: var(--text-muted);
  margin: var(--space-0) var(--space-0) var(--space-4);
  max-width: var(--max-width);
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--btn-height-md);
  height: var(--btn-height-md);
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  line-height: var(--leading-base);
}

.slider-prev { left: var(--space-3); }
.slider-next { right: var(--space-3); }

/* 4 kotak keunggulan */
.benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
  margin: var(--space-5) var(--space-0);
}

.benefit {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.benefit-icon { font-size: var(--icon-size); line-height: var(--leading-lg); color: var(--accent); }

.benefit h3 {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 600;
  margin: var(--space-2) var(--space-0);
}

.benefit p {
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  color: var(--text-muted);
  margin: var(--space-0);
}

/* Judul utama */
.page-title {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: 700;
  margin: var(--space-5) var(--space-0) var(--space-2);
}

.title-tight { margin-top: var(--space-0); }
.section-title { font-size: var(--text-lg); line-height: var(--leading-lg); }
.center { text-align: center; }

.page-subtitle {
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--text-muted);
  margin: var(--space-0) var(--space-0) var(--space-4);
}

/* Tab kategori */
.tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: var(--space-4) var(--space-0);
}

.tab {
  height: var(--tab-height);
  padding: var(--space-0) var(--space-4);
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}

.tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab:focus-visible { outline: var(--ring-width) solid var(--accent); outline-offset: var(--space-1); }

/* Grid + kartu produk */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr));
  gap: var(--grid-gap);
  margin: var(--space-4) var(--space-0) var(--space-7);
}

.product-card {
  display: block;
  background: var(--bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.product-card:hover { border-color: var(--accent); }

.product-card.disabled { opacity: .6; cursor: not-allowed; }

.product-thumb {
  height: var(--thumb-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  font-size: var(--text-display);
  line-height: var(--leading-display);
  overflow: hidden;
}

.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-body { padding: var(--space-4); }

.product-name {
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-weight: 600;
  margin: var(--space-0) var(--space-0) var(--space-2);
}

.product-status {
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--text-muted);
  margin: var(--space-0);
}

.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
}

.badge.soldout { background: var(--danger); color: var(--on-accent); }
.badge.manual { background: var(--accent); color: var(--on-accent); }
.badge.ok { background: var(--surface); color: var(--success); border: var(--border-width) solid var(--success); }
.badge.wait { background: var(--surface); color: var(--warning); border: var(--border-width) solid var(--warning); }
.badge.bad { background: var(--surface); color: var(--danger); border: var(--border-width) solid var(--danger); }

/* Form / input */
.form-card {
  background: var(--bg);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-4) var(--space-0);
}

.field-label {
  display: block;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  font-weight: 600;
  margin: var(--space-0) var(--space-0) var(--space-2);
}

.field-input {
  width: 100%;
  height: var(--input-height);
  padding: var(--space-0) var(--space-3);
  border: var(--border-width) solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-family: var(--font-sans);
  margin: var(--space-0) var(--space-0) var(--space-4);
}

.field-input:focus { border-color: var(--accent); outline: var(--ring-width) solid var(--accent); outline-offset: var(--space-0); }
.field-input.error { border-color: var(--danger); }

.check-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin: var(--space-0) var(--space-0) var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.check-row input { width: var(--space-4); height: var(--space-4); margin: var(--space-0); flex-shrink: 0; }

.msg { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--text-muted); }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

/* Pemilih nominal (varian) */
.variant-list { display: grid; gap: var(--space-3); margin: var(--space-0) var(--space-0) var(--space-4); }

.variant-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-sans);
}

.variant-card.selected { border: var(--border-width-thick) solid var(--accent); }
.variant-name { font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 600; }
.variant-price { font-size: var(--text-base); line-height: var(--leading-base); font-weight: 700; color: var(--accent); white-space: nowrap; }

/* Detail produk */
.product-detail {
  display: grid;
  grid-template-columns: var(--thumb-size) 1fr;
  gap: var(--space-5);
  align-items: start;
  margin: var(--space-4) var(--space-0);
}

.detail-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  font-size: var(--text-display);
  line-height: var(--leading-display);
  overflow: hidden;
}

.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.back-link {
  display: inline-block;
  margin: var(--space-4) var(--space-0) var(--space-0);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

/* Panel QRIS */
.qris-panel {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  margin: var(--space-4) var(--space-0);
}

.qris-panel img {
  width: var(--qris-size);
  max-width: 100%;
  height: auto;
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: var(--space-2);
}

.qris-total {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
  font-weight: 700;
  margin: var(--space-4) var(--space-0);
}

.qris-code {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: 700;
}

/* Layar sukses — kode invoice besar */
.order-code {
  font-size: var(--code-size);
  line-height: var(--leading-display);
  font-weight: 700;
  letter-spacing: var(--space-1);
  text-align: center;
  margin: var(--space-4) var(--space-0);
  font-family: var(--font-mono);
}

/* Hasil cek invoice */
.result-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-0);
  border-bottom: var(--border-width) solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.result-row:last-child { border-bottom-width: var(--space-0); }
.result-row dt { color: var(--text-muted); margin: var(--space-0); }
.result-row dd { margin: var(--space-0); font-weight: 600; text-align: right; }

/* Tombol WA mengambang */
.wa-fab {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  width: var(--wa-fab);
  height: var(--wa-fab);
  border-radius: var(--radius-pill);
  background: var(--wa-bg);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  text-decoration: none;
  box-shadow: var(--shadow-pop);
  z-index: 30;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: var(--border-width) solid var(--border);
  padding: var(--space-6) var(--space-0);
  margin-top: var(--space-7);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

.pay-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin: var(--space-0) var(--space-0) var(--space-4);
}

.pay-chip {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  font-weight: 600;
}

/* Responsif: tablet lalu HP (1 kolom) */
@media (max-width: 48em) {
  .benefits { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .slide h2 { font-size: var(--text-xl); line-height: var(--leading-xl); }
  .slide { min-height: var(--space-8); padding: var(--space-5) var(--space-4); }
}

@media (max-width: 32em) {
  .benefits { grid-template-columns: 1fr; }
  .header-nav a { display: none; }
  .order-code { font-size: var(--text-xl); line-height: var(--leading-xl); }
}
