@import url('./dashboard.css');

/* ================================================================
   FERPEDIA — TOP UP (Premium Fintech · Natural Navy & White)
   Palet: #102A43 #163B5C #28577A #1677E8 #EAF2F8 #F7F9FC #172B3A #647789 #DFE7EF
   ================================================================ */
body {
  padding-bottom: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F7F9FC;
}
button, input { font-family: inherit; }

/* ─── HEADER ──────────────────────────────────────────────────────────────── */
.page-header { background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.page-title { font-weight: 800; color: #102A43; letter-spacing: -.01em; }
.page-header-ic {
  margin-left: auto; width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; background: #EAF2F8; color: #163B5C;
}
.page-header-ic svg { width: 18px; height: 18px; display: block; }

/* ─── TOPUP WRAPPER ───────────────────────────────────────────────────────── */
.topup-wrapper {
  display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; width: 100%;
  padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
}

/* ─── KARTU PANDUAN VIDEO ─────────────────────────────────────────────────── */
.vguide-bar.topup-guide {
  max-width: 528px; margin: 14px 16px 0; padding: 12px 14px; gap: 12px;
  background: #fff; border: 1px solid #DFE7EF; border-radius: 16px;
  box-shadow: 0 6px 18px -12px rgba(16,42,67,.25);
}
@media (min-width: 592px) { .vguide-bar.topup-guide { margin-left: auto; margin-right: auto; width: calc(100% - 32px); } }
.topup-guide .vguide-bar-icon { width: 42px; height: 42px; border-radius: 12px; background: #EAF2F8; color: #163B5C; }
.topup-guide .vguide-bar-title { color: #102A43; font-weight: 800; font-size: .9rem; }
.topup-guide .vguide-bar-sub { display: block; color: #647789; font-size: .72rem; line-height: 1.35; }
.topup-guide .vguide-bar-btn {
  background: #163B5C; color: #fff; border-radius: 11px; padding: 10px 15px; font-weight: 700; font-size: .78rem;
  box-shadow: 0 6px 14px -6px rgba(22,59,92,.55); min-height: 40px;
}
.topup-guide .vguide-bar-btn:hover { background: #102A43; }
@media (max-width: 380px) { .topup-guide .vguide-bar-sub { display: none; } }

/* ─── MERCHANT TITLE ──────────────────────────────────────────────────────── */
.topup-merchant-title { padding: 20px 16px 0; text-align: center; }
.topup-merchant-title .label {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: #EAF2F8; color: #28577A;
  font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px;
}
.topup-merchant-title .name {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em;
  color: #102A43; background: none; -webkit-text-fill-color: #102A43;
}

/* ─── SEGMENTED CONTROL ───────────────────────────────────────────────────── */
.topup-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: #EAF2F8; border: 1px solid #DFE7EF; border-radius: 16px;
  padding: 4px; margin: 16px 16px 14px; isolation: isolate;
}
.tab-btn {
  position: relative; z-index: 1; min-height: 44px; padding: 10px 8px; border: none;
  background: transparent; color: #647789; font-size: .85rem; font-weight: 700;
  border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: color .25s ease, background-color .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn svg { width: 16px; height: 16px; flex-shrink: 0; display: block; }
.tab-btn.active { background: #163B5C; color: #fff; box-shadow: 0 6px 14px -6px rgba(22,59,92,.6); }
@supports selector(:has(a)) {
  /* indikator geser halus; tombol aktif tidak perlu latar sendiri */
  .topup-tabs::before {
    content: ''; position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px); border-radius: 12px; background: #163B5C;
    box-shadow: 0 6px 14px -6px rgba(22,59,92,.6);
    transition: transform .3s cubic-bezier(.22,.8,.24,1);
  }
  .topup-tabs:has(.tab-btn:nth-child(2).active)::before { transform: translateX(100%); }
  .tab-btn.active { background: transparent; box-shadow: none; }
}

/* ─── TAB CONTENT ─────────────────────────────────────────────────────────── */
.tab-content { display: none; padding: 0 16px 8px; }
.tab-content.active { display: block; animation: tu-in .3s ease both; }
@keyframes tu-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─── QRIS CARD ───────────────────────────────────────────────────────────── */
.qris-card {
  background: #fff; border: 1px solid #DFE7EF; border-radius: 24px;
  padding: 22px 20px 16px; text-align: center; margin-bottom: 14px;
  box-shadow: 0 18px 40px -22px rgba(16,42,67,.35);
}
.qris-header { margin-bottom: 14px; }
.qris-brand-name { font-size: 1.05rem; font-weight: 800; color: #102A43; letter-spacing: -.01em; margin-bottom: 2px; }
.qris-subtitle { font-size: .68rem; color: #647789; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.qris-img {
  width: min(100%, 280px); aspect-ratio: 1 / 1; height: auto; margin: 0 auto 14px;
  background: #fff; border: 1px solid #DFE7EF; border-radius: 16px; padding: 10px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* contain: QR tidak pernah terpotong */
.qris-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qris-footer { border-top: 1px solid #EAF2F8; padding-top: 12px; font-size: .72rem; color: #647789; font-weight: 500; }

/* ─── DOWNLOAD QRIS ───────────────────────────────────────────────────────── */
.btn-download-qris {
  width: 100%; min-height: 48px; padding: 12px 16px;
  background: #fff; border: 1.5px solid #163B5C; border-radius: 14px; color: #163B5C;
  font-size: .88rem; font-weight: 700; cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; margin-bottom: 14px; -webkit-tap-highlight-color: transparent;
}
.btn-download-qris svg { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.btn-download-qris:hover { background: #EAF2F8; }
.btn-download-qris:active { transform: scale(.98); }

/* ─── INFO CARD ───────────────────────────────────────────────────────────── */
.info-note { background: #EAF2F8; border: 1px solid #DFE7EF; border-radius: 16px; padding: 14px 16px; }
.info-note-form { margin-bottom: 16px; }
.info-note ul { padding: 0; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.info-note li { font-size: .78rem; color: #172B3A; display: flex; align-items: flex-start; gap: 9px; line-height: 1.5; }
.info-note li::before {
  content: ''; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%;
  background: #1677E8; margin-top: 7px;
}

/* ─── KONFIRMASI: SALDO & NOMINAL ─────────────────────────────────────────── */
.saldo-display {
  background: #102A43; background: linear-gradient(145deg, #163B5C 0%, #102A43 100%);
  border-radius: 20px; padding: 18px 20px; margin-bottom: 12px; text-align: left;
  box-shadow: 0 16px 32px -18px rgba(16,42,67,.7);
}
.saldo-display .label { font-size: .7rem; color: rgba(255,255,255,.72); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.saldo-display .value { font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }

.nominal-display {
  background: #fff; border: 1px solid #DFE7EF; border-radius: 20px;
  padding: 16px; text-align: center; margin-bottom: 12px;
  box-shadow: 0 8px 22px -16px rgba(16,42,67,.3);
}
.nominal-display .label { font-size: .7rem; color: #647789; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.nominal-display .amount {
  font-size: 2rem; font-weight: 800; color: #102A43; letter-spacing: -.02em; min-height: 48px;
  display: flex; align-items: center; justify-content: center; word-break: break-all;
}

/* ─── NUMPAD ──────────────────────────────────────────────────────────────── */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.num-btn {
  min-height: 56px; padding: 0 8px; background: #fff; border: 1px solid #DFE7EF; border-radius: 16px;
  color: #102A43; font-size: 1.2rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 0 #DFE7EF;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease, color .12s ease;
  -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation;
}
.num-btn:hover { background: #F4F8FC; }
.num-btn:active { transform: translateY(2px) scale(.97); background: #EAF2F8; box-shadow: 0 0 0 #DFE7EF; color: #163B5C; }
.num-btn.del { background: #EAF2F8; color: #28577A; }
.num-btn svg { width: 22px; height: 22px; display: block; }

/* ─── UPLOAD ──────────────────────────────────────────────────────────────── */
.upload-label { font-size: .72rem; font-weight: 800; color: #172B3A; display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }
.upload-area {
  position: relative; border: 2px dashed #9DB7CE; border-radius: 18px; background: #EAF2F8;
  padding: 24px 16px; text-align: center; cursor: pointer; margin-bottom: 14px;
  transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
}
.upload-area:hover { border-color: #28577A; background: #E3EDF6; }
.upload-area:active { transform: scale(.99); }
.upload-area.has-file { border-style: solid; border-color: #1F8A55; background: #F0FAF4; }
.upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px; background: #fff;
  color: #163B5C; display: grid; place-items: center; box-shadow: 0 6px 14px -8px rgba(16,42,67,.4);
}
.upload-icon svg { width: 26px; height: 26px; display: block; }
.upload-text { font-size: .8rem; color: #647789; line-height: 1.5; }
.upload-text strong { color: #102A43; font-weight: 800; font-size: .88rem; }
.upload-hint { font-size: .7rem; color: #647789; margin-top: 6px; }
.upload-preview { margin-top: 12px; }
.upload-preview img { width: 100%; max-height: 180px; object-fit: contain; border-radius: 10px; display: block; background: #fff; }

/* ─── TOMBOL KONFIRMASI ───────────────────────────────────────────────────── */
.btn-konfirmasi {
  width: 100%; min-height: 54px; padding: 14px;
  background: #163B5C; background: linear-gradient(180deg, #1B4768 0%, #163B5C 100%);
  color: #fff; border: none; border-radius: 16px;
  font-size: .95rem; font-weight: 800; letter-spacing: .01em; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 14px 26px -12px rgba(16,42,67,.65);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-konfirmasi:hover:not(:disabled) { box-shadow: 0 18px 30px -12px rgba(16,42,67,.7); }
.btn-konfirmasi:active:not(:disabled) { transform: scale(.98); }
.btn-konfirmasi:disabled { opacity: .75; cursor: progress; }
.btn-konfirmasi svg { width: 19px; height: 19px; flex-shrink: 0; display: block; }

@media (max-width: 360px) {
  .num-btn { min-height: 52px; font-size: 1.05rem; }
  .nominal-display .amount { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-content.active { animation: none; }
  .topup-tabs::before, .num-btn, .btn-konfirmasi { transition: none; }
}
