@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --navy-deep: #0c1b3a;      /* app bar / bank navy */
  --navy: #16244d;
  --navy-soft: #1f3568;
  --accent: #2f6bff;          /* primary action blue */
  --accent-soft: #e8f0ff;
  --gold: #f0a83c;            /* highlight / balance chip */
  --gold-soft: #fdecd2;
  --success: #17a672;
  --success-soft: #e2f6ee;
  --danger: #e5484d;
  --danger-soft: #fde7e7;
  --bg: #f2f4fa;
  --surface: #ffffff;
  --ink: #10162c;
  --ink-soft: #6b7290;
  --line: #e7e9f2;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 8px 24px rgba(16, 22, 60, 0.08);
  --shadow-pop: 0 16px 40px rgba(16, 22, 60, 0.16);
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .3em; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; }
p { line-height: 1.55; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px calc(var(--nav-h) + 28px);
  min-height: 100vh;
}
.device-frame { background: var(--bg); }
.device-scroll { min-height: 100vh; }


/* =========================================================
   TOP APP BAR (gaya home screen bank)
   ========================================================= */
.topbar {
  background: linear-gradient(160deg, var(--navy-deep), var(--navy-soft) 120%);
  color: #fff;
  padding: 20px 16px 54px;
  border-radius: 0 0 28px 28px;
  position: relative;
  overflow: hidden;
}
.topbar::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(240,168,60,.25), transparent 70%);
}
.topbar .topbar-row {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}
.topbar .topbar-row + .topbar-row { margin-top: 18px; }
.topbar .greet-eyebrow {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--gold); font-weight: 700;
}
.topbar h1 { color: #fff; font-size: 1.3rem; margin-top: 4px; }
.topbar p.subtitle { color: #c7cff2; font-size: .84rem; max-width: 34ch; margin: 6px 0 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: #fff; border: none; cursor: pointer; flex-shrink: 0;
}
.icon-btn.back { background: rgba(255,255,255,.14); }
.topbar-back-row { display:flex; align-items:center; gap:12px; max-width:480px; margin:0 auto; position:relative; z-index:1; }
.topbar-back-row h1 { font-size: 1.08rem; margin: 0; }
.topbar-back-row .eyebrow-mini { font-size: .68rem; color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }

/* Kartu ringkasan "saldo" yang menjorok ke atas menutupi topbar */
.summary-card {
  max-width: 480px; margin: -40px auto 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 20px;
  position: relative; z-index: 2;
}
.summary-card .label { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.summary-card .judul { font-size: .92rem; font-style: italic; color: var(--ink); margin: 8px 0 12px; line-height: 1.5; }
.summary-card .chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.chip.gold { background: var(--gold-soft); color: #9a611c; }
.chip.success { background: var(--success-soft); color: var(--success); }

/* =========================================================
   SECTION HEADINGS
   ========================================================= */
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 4px 12px;
}
.section-heading h2 { font-size: 1rem; }
.section-heading .see-all { font-size: .8rem; font-weight: 600; color: var(--accent); }

/* =========================================================
   MENU GRID (gaya ikon layanan bank: Transfer/Bayar/dst.)
   ========================================================= */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
}
@media (max-width: 380px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }
.menu-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; text-decoration: none;
}
.menu-tile .tile-icon {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: transform .15s ease, box-shadow .15s ease;
}
.menu-tile:active .tile-icon,
.menu-tile:hover .tile-icon { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.menu-tile .tile-label {
  font-size: .74rem; font-weight: 600; color: var(--ink);
  line-height: 1.25;
}
.menu-tile .tile-badge {
  font-size: .6rem; font-weight: 700; color: var(--accent);
}

/* =========================================================
   LIST TILE (gaya baris "riwayat transaksi")
   ========================================================= */
.list-tile {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
}
.list-tile .tile-avatar {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700;
}
.list-tile .tile-body { flex: 1; min-width: 0; }
.list-tile .tile-title { font-weight: 700; font-size: .9rem; }
.list-tile .tile-sub { font-size: .78rem; color: var(--ink-soft); margin-top: 2px; }
.list-tile .tile-meta { font-size: .72rem; color: var(--ink-soft); text-align: right; flex-shrink: 0; }
.list-tile .chevron { color: var(--ink-soft); flex-shrink: 0; }

/* =========================================================
   CARD generik
   ========================================================= */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-top: 16px;
}

/* =========================================================
   FORM (gaya input transaksi bank)
   ========================================================= */
.field-group { margin-top: 14px; }
label {
  display: block; font-weight: 600; font-size: .8rem;
  margin: 0 0 6px; color: var(--ink);
}
.hint { font-weight: 400; color: var(--ink-soft); font-size: .74rem; }
input[type=text], input[type=tel], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: .92rem; font-family: inherit;
  background: #fafbff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; } }

.question-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-top: 12px;
}
.question-card .q-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .76rem; font-weight: 800; margin-right: 8px; flex-shrink: 0;
}
.question-card .q-text { font-weight: 600; font-size: .88rem; display: inline; }

.consent-box {
  margin-top: 16px; padding: 16px;
  background: var(--gold-soft);
  border-radius: var(--radius-md);
  font-size: .84rem; line-height: 1.55; color: #6b4c15;
}
.consent-box label {
  display: flex; gap: 10px; align-items: flex-start;
  font-weight: 600; margin-top: 12px; color: #6b4c15;
}
.consent-box input[type=checkbox] { width: 19px; height: 19px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 14px;
  padding: 14px 22px; font-size: .92rem; font-weight: 700;
  font-family: inherit; cursor: pointer; text-decoration: none;
  transition: filter .15s ease, transform .05s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(47,107,255,.35); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: #eef0f8; color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .78rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Sticky bottom action bar (mirip tombol "Bayar Sekarang") */
.sticky-cta {
  position: sticky; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(16,22,60,.08);
}
.sticky-cta .inner { max-width: 480px; margin: 0 auto; }

/* =========================================================
   BOTTOM NAVIGATION BAR
   ========================================================= */
.bottomnav {
  position: sticky; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  height: var(--nav-h);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-soft); font-size: .68rem; font-weight: 600;
}
.bottomnav a.active { color: var(--accent); }
.bottomnav a .nav-icon-wrap {
  width: 34px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.bottomnav a.active .nav-icon-wrap { background: var(--accent-soft); }

/* =========================================================
   PROGRESS
   ========================================================= */
.progress-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; }
.progress-label { display:flex; justify-content:space-between; font-size:.72rem; color:var(--ink-soft); margin-top:6px; font-weight:600; }

/* =========================================================
   RECEIPT (halaman sukses gaya struk transaksi)
   ========================================================= */
.receipt-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 30px 22px;
  text-align: center;
  margin-top: -40px;
  position: relative; z-index: 2;
}
.receipt-check {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--success-soft); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.receipt-code {
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 1.3rem; font-weight: 800; letter-spacing: .04em;
  color: var(--ink); background: #f5f6fb; border-radius: 12px;
  padding: 12px; margin: 14px 0; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.receipt-divider {
  border: none; border-top: 2px dashed var(--line); margin: 18px 0;
}

/* =========================================================
   ALERTS
   ========================================================= */
.alert { padding: 13px 14px; border-radius: var(--radius-sm); font-size: .84rem; margin-top: 14px; font-weight: 600; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

/* =========================================================
   ADMIN LOGIN (kartu tengah gaya "masuk akun")
   ========================================================= */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 30px 26px; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--navy-deep); color: var(--gold); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }

/* =========================================================
   TABLE / DETAIL (admin, tetap dipertahankan)
   ========================================================= */
table.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data-table th, table.data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data-table th { background: #f5f6fb; color: var(--ink-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
table.data-table tr:hover { background: #fafbff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.badge-teal { background: var(--accent-soft); color: var(--accent); }
.badge-gold { background: var(--gold-soft); color: #9a611c; }

.site-footer { text-align: center; color: var(--ink-soft); font-size: .74rem; margin-top: 30px; padding-top: 16px; }
.back-link { font-size: .84rem; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.back-link:hover { color: var(--accent); }

.answer-block { margin-top: 12px; }
.answer-block .answer-text { margin: 6px 0 0; white-space: pre-wrap; color: var(--ink-soft); font-size: .86rem; background:#fafbff; border-radius: var(--radius-sm); padding: 12px; }

/* =========================================================
   ANIMASI & INTERAKSI (agar tampilan terasa hidup/dinamis)
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .device-scroll { scroll-behavior: smooth; }

  @keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .topbar, .summary-card, .card, .section-heading, .receipt-card, .auth-card {
    animation: fadeSlideIn .5s cubic-bezier(.2,.7,.3,1) both;
  }
  .menu-tile, .list-tile {
    animation: fadeSlideIn .45s cubic-bezier(.2,.7,.3,1) both;
  }
  /* Stagger ringan untuk grid/list agar muncul berurutan, bukan serentak */
  .menu-grid .menu-tile:nth-child(1) { animation-delay: .02s; }
  .menu-grid .menu-tile:nth-child(2) { animation-delay: .06s; }
  .menu-grid .menu-tile:nth-child(3) { animation-delay: .10s; }
  .menu-grid .menu-tile:nth-child(4) { animation-delay: .14s; }
  .menu-grid .menu-tile:nth-child(5) { animation-delay: .18s; }
  .menu-grid .menu-tile:nth-child(6) { animation-delay: .22s; }
  .menu-grid .menu-tile:nth-child(7) { animation-delay: .26s; }
  .list-tile:nth-of-type(1) { animation-delay: .04s; }
  .list-tile:nth-of-type(2) { animation-delay: .08s; }
  .list-tile:nth-of-type(3) { animation-delay: .12s; }
  .list-tile:nth-of-type(4) { animation-delay: .16s; }
  .list-tile:nth-of-type(5) { animation-delay: .20s; }
}

/* Hover/interaksi halus untuk perangkat dengan mouse (desktop) */
@media (hover: hover) {
  .list-tile { transition: transform .15s ease, box-shadow .15s ease; cursor: pointer; }
  .list-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
  .bottomnav a { transition: color .15s ease; }
  .bottomnav a .nav-icon-wrap { transition: background-color .15s ease, transform .15s ease; }
  .bottomnav a:hover .nav-icon-wrap { background: var(--accent-soft); transform: translateY(-1px); }
  .icon-btn { transition: background-color .15s ease, transform .15s ease; }
  .icon-btn:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
  .btn-secondary:hover { background: #e4e7f5; }
  .chip { transition: transform .15s ease; }
}

/* Transisi lembut untuk progress bar & elemen yang berubah nilai */
.progress-fill { transition: width .35s ease; }
.receipt-check svg { animation: popIn .4s cubic-bezier(.34,1.56,.64,1) .1s both; }
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* =========================================================
   LAYOUT RESPONSIF UNTUK LAYAR LEBAR (tablet/desktop)
   Di layar sempit (HP/Android): tampil penuh layar, gaya app mobile
   (tidak terpengaruh blok ini karena semuanya di dalam media query).
   Di layar lebar: TIDAK dibungkus bingkai ponsel — konten melebar
   proporsional mengikuti lebar layar (layout website biasa), sementara
   elemen (topbar, kartu, menu, bottom nav) tetap sama persis dengan
   versi Android, hanya lebih lega. Ditaruh PALING BAWAH file supaya
   selalu menang atas aturan dasar komponen di atas.
   ========================================================= */
@media (min-width: 640px)  { .app-shell { max-width: 640px; } }
@media (min-width: 900px)  { .app-shell { max-width: 760px; } }
@media (min-width: 1200px) { .app-shell { max-width: 900px; } }

@media (min-width: 640px) {
  .topbar .topbar-row, .topbar-back-row { max-width: 640px; }
  .summary-card { max-width: 640px; }
  .sticky-cta .inner { max-width: 640px; }
}
@media (min-width: 900px) {
  .topbar .topbar-row, .topbar-back-row { max-width: 760px; }
  .summary-card { max-width: 760px; }
  .sticky-cta .inner { max-width: 760px; }
  .menu-grid { grid-template-columns: repeat(7, 1fr); }
}
@media (min-width: 1200px) {
  .topbar .topbar-row, .topbar-back-row { max-width: 900px; }
  .summary-card { max-width: 900px; }
  .sticky-cta .inner { max-width: 900px; }
}
