@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --ink: #122019;
  --ink-soft: #1B2E24;
  --paper: #F1F3EC;
  --surface: #FCFBF6;
  --line: #DDE3D8;
  --muted: #5B6B63;
  --gold: #C89B3C;
  --gold-deep: #A87E2A;
  --good: #2F6F52;
  --bad: #B33A3A;
  --radius: 3px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
a { color: var(--ink); text-decoration: none; transition: color 0.15s ease, opacity 0.15s ease; }
p { margin: 0 0 12px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 0 24px; }

/* Motif "sudut pemindai QR" — dipakai di logomark & sebagai aksen dekoratif ringan,
   tema yang relevan buat payment gateway tanpa jadi ikon gradient generik. */
.logomark { flex-shrink: 0; }
.logomark rect, .logomark path { transition: none; }

/* ---------- Nav ---------- */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 21px;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark .dot { color: var(--gold); }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--ink-soft); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(18,32,25,0.18); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--surface); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-deep); box-shadow: 0 4px 10px rgba(200,155,60,0.35); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero (landing) ---------- */
.hero {
  padding: 88px 0 72px;
  position: relative;
  background-image: radial-gradient(circle, rgba(18,32,25,0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -6px -6px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  position: relative;
}
.eyebrow-line {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: -0.3px;
  max-width: 12ch;
}
.hero-sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 42ch;
  margin: 18px 0 28px;
}
.hero-actions { display: flex; gap: 12px; }

/* Receipt visual */
.receipt {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 28px 26px;
  max-width: 320px;
  margin-left: auto;
  position: relative;
}
.receipt::before, .receipt::after {
  content: '';
  position: absolute;
  left: 0; right: 0; height: 10px;
  background: repeating-linear-gradient(45deg, var(--paper) 0 6px, transparent 6px 12px), var(--surface);
}
.receipt::before { top: -5px; }
.receipt::after { bottom: -5px; }
.receipt-row { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.receipt-row:last-child { border-bottom: none; }
.receipt-row b { color: var(--ink); font-weight: 600; }
.receipt-qr {
  margin: 18px auto 6px;
  width: 128px; height: 128px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 3px;
}
.receipt-qr span { background: var(--ink); opacity: 0; animation: dotIn 0.4s ease forwards; }
.receipt-status { text-align: center; font-size: 12px; color: var(--good); margin-top: 10px; letter-spacing: 0.3px; }

@keyframes dotIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .receipt-qr span { animation: none; opacity: 1; }
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 28px; margin-bottom: 8px; }
.section-lead { color: var(--muted); max-width: 46ch; margin-bottom: 40px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step-num { font-family: 'Fraunces', serif; font-size: 30px; color: var(--gold); margin-bottom: 10px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

.code-preview {
  background: var(--ink);
  color: #E9EFE6;
  padding: 24px;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', monospace;
  font-size: 13px;
  overflow-x: auto;
  line-height: 1.7;
}
.code-preview .k { color: #C89B3C; }
.code-preview .s { color: #9AC4A6; }
.code-preview .c { color: #6B8577; }

.footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

/* ---------- Auth forms ---------- */
.auth-wrap { padding: 64px 0 80px; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 40px 36px;
}
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,155,60,0.18);
}
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-msg { padding: 12px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px; }
.form-msg.error { background: #F6E7E5; color: var(--bad); border: 1px solid #E3C4C0; }
.form-msg.notice { background: #E9F1EA; color: var(--good); border: 1px solid #C9DFCB; }
.auth-foot { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.g-recaptcha { margin-bottom: 18px; }

/* ---------- Dashboard ---------- */
.dash-header {
  background: var(--ink);
  color: var(--surface);
  padding: 32px 0;
}
.dash-header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px;
}
.balance-label { font-size: 12px; letter-spacing: 0.4px; color: #9BB2A3; margin-bottom: 6px; }
.balance-amount { font-family: 'Fraunces', serif; font-size: 40px; }
.apikey-box { font-size: 13px; color: #9BB2A3; }
.apikey-box code { color: var(--surface); background: rgba(255,255,255,0.08); padding: 4px 8px; border-radius: var(--radius); }

.dash-body { padding: 40px 0 80px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 40px; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 26px; transition: box-shadow 0.15s ease; }
.panel:hover { box-shadow: 0 6px 18px rgba(18,32,25,0.06); }
.panel h3 { font-size: 16px; margin-bottom: 4px; }
.panel .panel-hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.statement { background: var(--surface); border: 1px solid var(--line); }
.statement-head { padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ledger th {
  text-align: left; padding: 10px 24px; color: var(--muted); font-weight: 500;
  font-size: 12px; border-bottom: 1px solid var(--line);
}
table.ledger td { padding: 12px 24px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.ledger tr:last-child td { border-bottom: none; }
.amt-in { color: var(--good); font-weight: 600; }
.amt-out { color: var(--bad); font-weight: 600; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.3px; }
.pill-success { background: #E9F1EA; color: var(--good); }
.pill-pending { background: #FBF2E1; color: #96701E; }
.pill-failed, .pill-expired, .pill-canceled { background: #F6E7E5; color: var(--bad); }
.empty-state { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 13px; }

.qris-panel { text-align: center; }
.qris-panel img { width: 220px; height: 220px; border: 1px solid var(--line); padding: 10px; background: #fff; }
.qris-total { font-family: 'Fraunces', serif; font-size: 26px; margin: 14px 0 4px; }
.qris-timer { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.qris-status-tag { font-size: 12px; letter-spacing: 0.3px; }

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 48px; padding: 48px 0 96px; align-items: start; }
.docs-nav { position: sticky; top: 24px; font-size: 13px; }
.docs-nav a { display: block; padding: 6px 0; color: var(--muted); }
.docs-nav a:hover, .docs-nav a.active { color: var(--ink); }
.docs-nav .grp { font-size: 11px; color: var(--gold-deep); letter-spacing: 0.4px; margin: 18px 0 4px; }
.endpoint { margin-bottom: 56px; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.endpoint:last-child { border-bottom: none; }
.endpoint h2 { font-size: 21px; margin-bottom: 6px; }
.endpoint .desc { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.ep-line { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-family: 'Space Grotesk', monospace; font-size: 13px; }
.method { padding: 3px 9px; border-radius: var(--radius); font-weight: 600; font-size: 11px; color: #fff; }
.method-post { background: var(--gold-deep); }
.method-get { background: var(--good); }
table.param { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
table.param th { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
table.param td { padding: 9px 0; border-bottom: 1px solid var(--line); }
table.param code { background: var(--paper); padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.subhead { font-size: 12px; letter-spacing: 0.3px; color: var(--gold-deep); margin: 20px 0 8px; }

/* ---------- misc ---------- */
.center { text-align: center; }
.mt-24 { margin-top: 24px; }
.copy-btn { background: none; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; padding: 4px 9px; cursor: pointer; color: var(--muted); }
.copy-btn:hover { color: var(--ink); border-color: var(--ink); }

@media (max-width: 860px) {
  .hero-grid, .dash-grid, .docs-layout { grid-template-columns: 1fr; }
  .receipt { margin: 0 auto; }
  .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
}

/* ---------- Admin ---------- */
.admin-nav {
  background: var(--ink);
  border-bottom: 1px solid var(--ink-soft);
}
.admin-nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-nav .wordmark { color: var(--surface); }
.admin-links { display: flex; gap: 24px; font-size: 13px; }
.admin-links a { color: #9BB2A3; }
.admin-links a:hover, .admin-links a.active { color: var(--surface); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 40px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); padding: 20px; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.stat-card:hover { box-shadow: 0 6px 18px rgba(18,32,25,0.07); transform: translateY(-2px); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.stat-card .stat-value { font-family: 'Fraunces', serif; font-size: 26px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select {
  padding: 8px 10px; border: 1px solid var(--line); background: var(--surface);
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; border-radius: var(--radius);
}
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; }
.inline-form input[name="reason"] { width: 160px; }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #EFE3C6; color: var(--gold-deep); }
.role-badge.admin { background: var(--ink); color: var(--surface); }

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

