/* ── KrezPe App CSS ── */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --secondary: #64748B;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #D97706;
  --bg: #F0F4FF;
  --white: #FFFFFF;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-muted: #64748B;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(37,99,235,0.10);
  --shadow-lg: 0 8px 32px rgba(37,99,235,0.16);
  --gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 60%, #1E40AF 100%);
  --gradient-light: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── Page Wrapper ── */
.page { padding-bottom: 80px; min-height: 100vh; }
.page-no-nav { padding-bottom: 0; }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  border-radius: 20px 20px 0 0;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 4px 12px;
  color: var(--secondary);
  font-size: 11px; font-weight: 500;
  cursor: pointer; transition: color 0.2s;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item svg, .nav-item i { font-size: 22px; margin-bottom: 3px; }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%;
  height: 3px; background: var(--primary); border-radius: 0 0 4px 4px;
}

/* ── Top Header ── */
.top-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  background: var(--white);
}
.top-header-logo { font-weight: 800; font-size: 20px; color: var(--text); }
.top-header-logo span { color: var(--primary); }
.top-header-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 16px; cursor: pointer;
  position: relative; border: none;
}
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: white;
  font-size: 9px; font-weight: 700;
  border-radius: 50px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid white;
}

/* ── Page Header (inner pages) ── */
.page-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px 14px;
  background: var(--white);
  position: sticky; top: 0; z-index: 100;
}
.back-btn {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--bg); border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text); cursor: pointer;
  flex-shrink: 0;
}
.page-title { font-size: 17px; font-weight: 700; }

/* ── Auth Pages ── */
.auth-page { background: var(--white); min-height: 100vh; padding-bottom: 24px; }
.auth-hero {
  background: var(--gradient);
  padding: 48px 28px 60px;
  position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.auth-hero::after {
  content: ''; position: absolute; bottom: -60px; left: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.auth-hero-title { font-size: 28px; font-weight: 800; color: white; margin-bottom: 6px; }
.auth-hero-sub { font-size: 14px; color: rgba(255,255,255,0.82); margin-bottom: 20px; }
.auth-tags { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-tag {
  background: rgba(255,255,255,0.18); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  color: white; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 50px;
  display: flex; align-items: center; gap: 5px;
}
.auth-card {
  background: var(--white);
  margin: -24px 16px 0;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 24px; background: var(--bg); border-radius: 12px; padding: 4px; }
.auth-tab {
  flex: 1; padding: 10px; text-align: center;
  font-size: 14px; font-weight: 600; border-radius: 10px;
  color: var(--text-muted); cursor: pointer; transition: all 0.2s; border: none; background: none;
}
.auth-tab.active { background: var(--white); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-prefix {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  width: 52px; border-radius: 14px 0 0 14px;
  font-size: 13px; font-weight: 700;
}
.input-icon {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  width: 48px; border-radius: 14px 0 0 14px; font-size: 16px;
}
.form-control {
  width: 100%; padding: 14px 16px;
  background: var(--bg); border: 1.5px solid transparent;
  border-radius: 14px; font-size: 14px; color: var(--text);
  transition: all 0.2s; outline: none; font-family: inherit;
}
.form-control:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.form-control.with-icon { padding-left: 56px; }
.form-control.with-prefix { padding-left: 60px; }
.input-eye {
  position: absolute; right: 14px;
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.form-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.form-check label { font-size: 13px; color: var(--text-muted); }
.form-check a { color: var(--primary); font-weight: 600; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748B' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 700; border: none;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--gradient); color: white; box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(37,99,235,0.45); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 24px; font-size: 15px; border-radius: 16px; }
.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 10px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Cards ── */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-flush { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.section { padding: 16px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

/* ── Gradient Hero Card ── */
.hero-card {
  background: var(--gradient);
  border-radius: var(--radius); padding: 22px;
  color: white; position: relative; overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.hero-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 6px; }
.hero-card-amount { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.hero-card-amount sup { font-size: 18px; vertical-align: super; }
.hero-card-sub { font-size: 12px; opacity: 0.75; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card { background: var(--white); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--primary); }
.stat-value.green { color: var(--success); }
.stat-value.dark { color: var(--text); }

/* ── List Items ── */
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--white);
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg); }
.list-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.list-icon.green { background: #F0FDF4; color: var(--success); }
.list-icon.red { background: #FFF1F2; color: var(--danger); }
.list-icon.yellow { background: #FFFBEB; color: var(--warning); }
.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 14px; font-weight: 600; }
.list-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; }
.badge-success { background: #F0FDF4; color: var(--success); }
.badge-danger { background: #FFF1F2; color: var(--danger); }
.badge-warning { background: #FFFBEB; color: var(--warning); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--bg); color: var(--secondary); }
.badge-instant { background: #EFF6FF; color: var(--primary); border: 1px solid #BFDBFE; }

/* ── MPIN Input ── */
.mpin-wrap { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.mpin-box {
  width: 46px; height: 54px; border-radius: 14px;
  background: var(--bg); border: 2px solid transparent;
  font-size: 22px; font-weight: 700; text-align: center;
  color: var(--text); transition: all 0.2s; outline: none;
  font-family: inherit;
}
.mpin-box:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.mpin-box.filled { border-color: var(--primary); background: var(--primary-light); }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tab-btn {
  flex: 1; padding: 10px; text-align: center;
  font-size: 14px; font-weight: 600; border-radius: 10px;
  color: var(--text-muted); cursor: pointer; border: none;
  background: none; transition: all 0.2s; font-family: inherit;
}
.tab-btn.active { background: var(--white); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Plan Card ── */
.plan-card {
  background: var(--white); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 12px;
  border-left: 4px solid var(--primary);
  display: flex; align-items: center; justify-content: space-between;
}
.plan-card.tier-low  { border-left-color: #2563EB; }
.plan-card.tier-middle { border-left-color: #7C3AED; }
.plan-card.tier-high { border-left-color: #DC2626; }
.plan-amount { font-size: 20px; font-weight: 800; }
.plan-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.plan-quota { font-size: 15px; font-weight: 700; color: var(--primary); }
.plan-income { font-size: 12px; color: var(--text-muted); }

/* ── Tier selector ── */
.tier-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.tier-btn {
  flex: 1; padding: 12px 8px; border-radius: 14px;
  text-align: center; font-weight: 700; font-size: 13px;
  border: 2px solid var(--border); background: var(--white);
  cursor: pointer; transition: all 0.2s;
}
.tier-btn .tier-pct { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.tier-btn.active.low { background: #EFF6FF; border-color: #2563EB; color: #2563EB; }
.tier-btn.active.middle { background: #F5F3FF; border-color: #7C3AED; color: #7C3AED; }
.tier-btn.active.high { background: #FFF1F2; border-color: #DC2626; color: #DC2626; }

/* ── Toast ── */
.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; width: calc(100% - 32px); max-width: 440px; }
.toast {
  padding: 14px 18px; border-radius: 14px; margin-bottom: 8px;
  font-size: 13px; font-weight: 600; color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease; display: flex; align-items: center; gap: 10px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
.toast.warning { background: var(--warning); }
@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 2000; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: 24px 24px 0 0;
  width: 100%; max-width: 480px; padding: 24px 20px 32px;
  transform: translateY(100%); transition: transform 0.35s cubic-bezier(.32,.72,0,1);
  max-height: 92vh; overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 20px; }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ── Banner slider ── */
.banner-wrap { margin: 14px 16px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.banner-slide { display: none; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; height: 160px; object-fit: cover; }
.banner-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.banner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all 0.3s; }
.banner-dot.active { background: var(--primary); width: 18px; border-radius: 3px; }

/* ── Profile card ── */
.profile-card {
  background: var(--gradient); border-radius: var(--radius);
  padding: 22px; color: white; margin: 0 16px 4px;
  position: relative; overflow: hidden;
}
.profile-card::before { content:''; position:absolute; right:-20px; top:-20px; width:120px; height:120px; border-radius:50%; background:rgba(255,255,255,0.1); }
.profile-card-name { font-size: 13px; opacity: 0.8; margin-bottom: 4px; }
.profile-card-code { font-size: 15px; font-weight: 800; letter-spacing: 2px; }
.profile-card-balance { font-size: 28px; font-weight: 800; margin: 10px 0 4px; }
.profile-card-sub { font-size: 12px; opacity: 0.75; }

/* ── Quick actions ── */
.quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; padding: 12px 16px; }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.quick-action-icon {
  width: 50px; height: 50px; border-radius: 16px;
  background: var(--white); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--primary);
}
.quick-action-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; }

/* ── Amount display ── */
.pay-summary {
  background: var(--text); color: white;
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.pay-summary-label { font-size: 11px; opacity: 0.7; margin-bottom: 4px; }
.pay-summary-amount { font-size: 24px; font-weight: 800; }
.pay-summary-get { text-align: right; }
.pay-summary-get .badge { font-size: 14px; font-weight: 800; padding: 6px 14px; }

/* ── Payment method select ── */
.pay-method {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 10px; cursor: pointer;
  border: 2px solid var(--border); transition: all 0.2s;
}
.pay-method.selected { border-color: var(--primary); background: var(--primary-light); }
.pay-method-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.pay-method-icon.blue { background: #2563EB; color: white; }
.pay-method-icon.dark { background: var(--text); color: white; }
.pay-method-body { flex: 1; }
.pay-method-name { font-size: 14px; font-weight: 700; }
.pay-method-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pay-method-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; transition: all 0.2s; }
.pay-method.selected .pay-method-radio { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px white; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--text-muted); }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; margin: 16px 0; }
.divider-text::before,.divider-text::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── Popup overlay ── */
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.popup-card { background: white; border-radius: 20px; max-width: 340px; width: 100%; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.popup-img { width: 100%; }
.popup-actions { display: flex; gap: 12px; padding: 16px; }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-800 { font-weight: 800; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-18 { font-size: 18px; }
.fs-24 { font-size: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.loading { opacity: 0.6; pointer-events: none; }
