:root {
    --darkest: #061A3A;
    --primary: #0F3D91;
    --accent: #3B82F6;
    --light: #7DD3FC;
    --bg: #E8F0FE;
    --white: #FFFFFF;
    --danger: #DC2626;
    --success: #16A34A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--darkest);
    line-height: 1.5;
}

a { text-decoration: none; color: var(--primary); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--darkest);
    color: var(--white);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(6,26,58,0.15);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar .brand { font-size: 20px; font-weight: 700; color: var(--white); display: flex; align-items: center; gap: 8px; }
.navbar .brand i { color: var(--light); }
.navbar-links { display: flex; align-items: center; gap: 20px; }
.navbar-links a { color: var(--white); font-size: 14px; opacity: 0.9; }
.navbar-links a:hover { opacity: 1; color: var(--light); }
.wallet-pill {
    background: var(--primary);
    color: var(--white);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--darkest); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--primary); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: var(--white); }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(6,26,58,0.06);
    margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--darkest); }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, var(--darkest), var(--primary));
}
.auth-card {
    background: var(--white);
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-card h1 {
    font-size: 22px;
    text-align: center;
    color: var(--darkest);
    margin-bottom: 6px;
}
.auth-card .sub { text-align: center; color: #64748B; font-size: 14px; margin-bottom: 24px; }
.auth-logo { text-align: center; font-size: 32px; color: var(--primary); margin-bottom: 8px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--darkest); }
.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #D6E2F5;
    border-radius: 10px;
    font-size: 15px;
    background: var(--white);
    color: var(--darkest);
}
.form-control:focus { outline: none; border-color: var(--accent); }
select.form-control { appearance: none; }
.input-icon-group { position: relative; }
.input-icon-group i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94A3B8; }
.input-icon-group .form-control { padding-left: 42px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #DCFCE7; color: #166534; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-info { background: var(--bg); color: var(--primary); }

/* ---------- Dashboard grid ---------- */
.balance-card {
    background: linear-gradient(135deg, var(--primary), var(--darkest));
    color: var(--white);
    border-radius: 20px;
    padding: 28px 24px;
    margin-bottom: 24px;
}
.balance-card .label { font-size: 13px; opacity: 0.8; }
.balance-card .amount { font-size: 34px; font-weight: 800; margin: 6px 0 16px; }
.balance-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.service-tile {
    background: var(--white);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(6,26,58,0.06);
    transition: transform .15s ease;
}
.service-tile:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(6,26,58,0.12); }
.service-tile i {
    font-size: 26px;
    color: var(--accent);
    background: var(--bg);
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    margin: 0 auto 10px;
}
.service-tile span { font-size: 13px; font-weight: 600; color: var(--darkest); display: block; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--bg); }
th { color: #64748B; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-failed { background: #FEE2E2; color: #991B1B; }
.badge-pending { background: #FEF9C3; color: #854D0E; }
.badge-refunded { background: var(--bg); color: var(--primary); }

/* ---------- Misc ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 16px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 22px; color: var(--darkest); }
.text-muted { color: #64748B; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .navbar-links { gap: 12px; }
}
.footer { text-align: center; padding: 30px 0; color: #64748B; font-size: 13px; }

/* ---------- OTP Number list ---------- */
.otp-list { display: flex; flex-direction: column; gap: 10px; }
.otp-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 12px; background: var(--bg);
}
.otp-item-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--white); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.otp-item-info { flex: 1; min-width: 0; }
.otp-item-name { font-weight: 700; font-size: 14px; color: var(--darkest); }
.otp-item-meta { font-size: 12px; color: #64748B; }
.otp-item-price { font-weight: 700; font-size: 14px; color: var(--primary); white-space: nowrap; }

/* ---------- Virtual account card (NCWallet) ---------- */
.va-card {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 16px;
}
.va-card .va-number { font-size: 24px; font-weight: 800; letter-spacing: 1px; margin: 6px 0; }
.va-card .va-label { font-size: 12px; opacity: .85; }

/* ---------- OTP code display ---------- */
.otp-code-box {
    text-align: center; padding: 30px 20px; border-radius: 16px;
    background: var(--bg); margin-bottom: 20px;
}
.otp-code-box .code { font-size: 36px; font-weight: 800; letter-spacing: 4px; color: var(--primary); }
.otp-code-box .waiting { color: #64748B; font-size: 14px; }

/* ---------- Mobile app header (image-matched) ---------- */
.app-header { display: none; }
.navbar-desktop-only { display: none; }
body.has-bottom-nav { padding-bottom: 78px; }

@media (max-width: 768px) {
    .navbar-desktop-only { display: none !important; }
    .app-header { display: block; background: var(--darkest); padding: 14px 16px; position: sticky; top: 0; z-index: 100; }
    .app-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .app-header-left { display: flex; align-items: center; gap: 12px; }
    .avatar-circle {
        width: 42px; height: 42px; border-radius: 50%;
        background: var(--primary); color: var(--light);
        display: flex; align-items: center; justify-content: center;
        font-size: 20px; flex-shrink: 0;
    }
    .app-header-greeting { font-size: 12px; color: #9DB3D9; }
    .app-header-name { font-size: 14px; font-weight: 700; color: var(--white); letter-spacing: .3px; }
    .app-header-id { font-size: 12px; font-weight: 500; color: var(--light); }
    .app-header-icons { display: flex; align-items: center; gap: 10px; }
    .icon-btn {
        width: 36px; height: 36px; border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        background: transparent; border: none; color: var(--light);
        font-size: 17px; cursor: pointer;
    }
    .icon-btn:hover { background: rgba(255,255,255,0.08); }
    .app-menu-panel {
        max-height: 0; overflow: hidden; transition: max-height .2s ease;
        background: var(--primary); border-radius: 0 0 16px 16px;
    }
    .app-menu-panel.open { max-height: 300px; }
    .app-menu-panel a {
        display: flex; align-items: center; gap: 10px;
        padding: 12px 20px; color: var(--white); font-size: 14px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
}

/* ---------- Bottom navigation (image-matched) ---------- */
.bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: var(--darkest);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(6,26,58,0.25);
}
@media (max-width: 768px) {
    .bottom-nav { display: flex; align-items: center; justify-content: space-around; }
    .bottom-nav a {
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        color: #7C93BE; font-size: 10px; font-weight: 600; padding: 6px 4px;
        flex: 1; text-align: center;
    }
    .bottom-nav a i { font-size: 20px; }
    .bottom-nav a.active { color: var(--light); }
    .bottom-nav a span { white-space: nowrap; }
}
