:root {
    --primary: #0000ff;
    --accent: #4338ca;
    --bg: #f3f4f6;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --danger: #dc2626;
    --success: #059669;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Lexend', Arial, sans-serif;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
.page-shell { max-width: 760px; margin: 0 auto; }
.topbar {
    height: 72px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1050;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,.05);
}
.icon-button {
    width: 42px; height: 42px; border: 0; background: transparent;
    border-radius: 14px; display: grid; place-items: center; cursor: pointer;
}
.icon-button:hover { background: #eef2ff; }
.brand-logo { display: block; width: 145px; max-height: 48px; object-fit: contain; }
.hero {
    padding: 32px 22px 42px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 0 0 34px 34px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(24px, 6vw, 40px); }
.hero p { margin: 0; opacity: .84; line-height: 1.6; }
.notice {
    margin: 18px 16px;
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 13px;
    background: #eff6ff;
    color: #1d4ed8;
}
.section-title { padding: 0 16px; margin: 25px 0 12px; font-size: 18px; }
.section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; padding:0 16px; margin-top:25px; }
.section-heading .section-title { padding:0; margin:4px 0 0; }
.section-kicker { display:block; color:#6366f1; font-size:9px; font-weight:800; letter-spacing:1px; }
.section-count { flex:0 0 auto; margin-bottom:3px; color:#94a3b8; font-size:10px; font-weight:800; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
.product-card {
    background: var(--surface); border-radius: 22px; padding: 0; overflow: hidden;
    box-shadow: 0 6px 18px rgba(15,23,42,.06);
    display: flex; flex-direction: column; min-width: 0;
}
.product-art {
    width: 100%; height: auto; min-height: 0; border-radius: 22px 22px 0 0; display: block;
    overflow: hidden; line-height: 0; background: transparent;
    color: white; font-size: 32px; font-weight: 800;
    background-color: transparent;
}
.product-art img { display: block; width: 100%; height: auto; min-height: 0; border-radius: inherit; object-fit: contain; object-position: center; }
.product-card:nth-child(3n) .product-art,
.product-card:nth-child(3n+1) .product-art { background: transparent; }
.product-info { padding: 11px 13px 13px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 13px; font-weight: 700; line-height: 1.45; min-height: 38px; }
.product-price { color: var(--danger); font-size: 17px; font-weight: 800; margin: 7px 0 10px; }
.button {
    display: inline-flex; justify-content: center; align-items: center; gap: 7px;
    border: 0; border-radius: 14px; padding: 13px 16px; cursor: pointer;
    text-decoration: none; font: inherit; font-weight: 700;
}
.button-primary { color: #fff; background: var(--primary); width: 100%; }
.button-primary:disabled { opacity:.48; cursor:not-allowed; transform:none; }
.button-secondary { color: var(--primary); background: #eef2ff; }
.button-danger { color: #fff; background: var(--danger); }
.button:active { transform: scale(.98); }
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    width: 100%; max-width: none; margin: 0; padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    display: flex; justify-content: space-around; gap: 5px;
    background: rgba(255,255,255,.95); backdrop-filter: blur(18px);
    border-radius: 24px 24px 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.12);
}
.nav-item {
    flex: 1; text-align: center; text-decoration: none; color: #94a3b8;
    font-size: 10px; font-weight: 700; padding: 5px 2px;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { display: block; width: 23px; height: 23px; margin: 0 auto 4px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.drawer-backdrop { display: none; position: fixed; inset: 0; z-index: 1055; background: rgba(15,23,42,.45); }
.drawer-backdrop.open { display: block; }
.drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1060;
    width: min(300px, 88vw); overflow-y: auto; transform: translateX(-105%);
    transition: transform .25s ease; background: #fff;
    border-radius: 0 30px 30px 0; box-shadow: 12px 0 40px rgba(0,0,0,.16);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
    min-height: 170px; padding: 35px 18px 22px; text-align: center; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 0 0 30px 30px;
}
.drawer-head .brand-logo { width: 215px; max-width: 100%; height: auto; margin: 0 auto 7px; }
.drawer-links { padding: 16px 14px; }
.drawer-link {
    display: flex; align-items: center; gap: 13px; padding: 15px 16px;
    margin-bottom: 7px; border-radius: 16px; text-decoration: none; font-weight: 700;
}
.drawer-link:hover, .drawer-link.active { background: #eef2ff; color: var(--primary); }
.drawer-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; flex: 0 0 auto; }
.auth-wrap { min-height: calc(100vh - 40px); display: grid; place-items: center; padding: 20px 16px 130px; }
.auth-card, .content-card {
    width: 100%; max-width: 470px; background: #fff; border-radius: 28px;
    padding: 25px; box-shadow: 0 10px 30px rgba(15,23,42,.07);
}
.auth-card { text-align: center; }
.auth-card .brand-logo { width: 210px; height: auto; margin: 0 auto 18px; }
.form-group { text-align: left; margin-bottom: 14px; }
.form-label { display: block; margin: 0 0 7px; font-size: 13px; font-weight: 700; }
.form-control, .form-select {
    width: 100%; border: 1px solid #e5e7eb; border-radius: 14px; padding: 13px 14px;
    background: #f8fafc; color: var(--text); font: inherit; outline: none;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.muted { color: var(--muted); font-size: 13px; }
.text-success { color: var(--success) !important; }
.alert { padding: 13px 15px; border-radius: 14px; margin: 0 0 16px; font-size: 13px; }
.alert-error { background: #fef2f2; color: #b91c1c; }
.alert-success { background: #ecfdf5; color: #047857; }
.profile-hero {
    padding: 35px 20px 55px; text-align: center; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 0 0 38px 38px;
}
.avatar { width: 82px; height: 82px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.45); }
.stats-card { margin: -30px 16px 24px; padding: 19px 9px; display: flex; background: #fff; border-radius: 23px; box-shadow: 0 10px 25px rgba(15,23,42,.1); }
.stat { flex: 1; text-align: center; }
.stat + .stat { border-left: 1px solid #eef2f7; }
.stat-value { display: block; color: var(--primary); font-size: 17px; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 700; }
.menu-title { margin: 22px 20px 9px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.menu-group { margin: 0 16px; overflow: hidden; background: #fff; border-radius: 21px; box-shadow: 0 5px 18px rgba(15,23,42,.05); }
.menu-item { display: flex; align-items: center; gap: 13px; padding: 17px; text-decoration: none; border-bottom: 1px solid #f3f4f6; font-weight: 700; }
.menu-item:last-child { border-bottom: 0; }
.menu-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; }
.menu-item .arrow { margin-left: auto; color: #cbd5e1; }
.transaction { display: flex; align-items: center; gap: 12px; padding: 15px; margin-bottom: 12px; border-radius: 19px; background: #fff; box-shadow: 0 5px 16px rgba(15,23,42,.05); }
.transaction-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; }
.transaction-icon.success { background: #ecfdf5; color: #059669; }
.transaction-icon.pending { background: #fffbeb; color: #d97706; }
.transaction-icon.error { background: #fef2f2; color: #dc2626; }
.transaction-main { min-width: 0; flex: 1; }
.transaction-title { display: block; font-size: 13px; font-weight: 800; }
.transaction-time { color: #9ca3af; font-size: 10px; }
.transaction-right { text-align: right; }
.transaction-amount { display: block; font-weight: 800; font-size: 13px; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 8px; font-size: 9px; font-weight: 800; }
.badge.success { background: #d1fae5; color: #047857; }
.badge.pending { background: #fef3c7; color: #b45309; }
.badge.error { background: #fee2e2; color: #b91c1c; }
.empty { padding: 35px 16px; text-align: center; color: var(--muted); }
.order-credentials { display:grid; gap:8px; margin: -4px 0 14px 54px; }
.order-credentials > div { display:flex; align-items:center; gap:9px; padding:9px 10px; border:1px solid #dbe4ff; border-radius:11px; background:#f7f9ff; }
.order-credentials span { flex:0 0 58px; color:#64748b; font-size:9px; font-weight:800; }
.order-credentials code { flex:1; min-width:0; overflow:hidden; color:#1e293b; font:700 12px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace; text-overflow:ellipsis; white-space:nowrap; }
.order-credentials button { flex:0 0 auto; padding:6px 8px; border:0; border-radius:7px; color:#fff; background:#4f46e5; font:700 9px inherit; cursor:pointer; }
.wallet-page, .history-page { padding: 22px 16px 0; }
.wallet-hero, .history-hero { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:22px; color:#fff; border-radius:25px; background:linear-gradient(135deg,#0000ff,#4f46e5); box-shadow:0 12px 28px rgba(37,55,230,.22); }
.wallet-label, .history-kicker { display:block; opacity:.78; font-size:11px; font-weight:700; margin-bottom:5px; }
.wallet-balance { display:block; font-size:25px; font-weight:800; }
.wallet-history { flex:0 0 auto; padding:10px 12px; border:1px solid rgba(255,255,255,.35); border-radius:13px; color:#fff; text-decoration:none; font-size:11px; font-weight:800; background:rgba(255,255,255,.13); }
.topup-card { margin-top:14px; }
.topup-heading { display:flex; align-items:center; gap:10px; margin-bottom:20px; }
.topup-heading-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; color:#0000ff; background:#eef2ff; font-weight:800; }
.topup-heading h1 { margin:0 0 3px; font-size:21px; }
.topup-heading p { margin:0; color:#94a3b8; font-size:11px; }
.choice-label { display:block; margin:0 0 8px; font-size:12px; font-weight:800; color:#475569; }
.provider-grid, .amount-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:18px; }
.amount-grid { grid-template-columns:repeat(4,1fr); }
.choice input { position:absolute; opacity:0; pointer-events:none; }
.choice span { display:block; padding:13px 8px; text-align:center; cursor:pointer; border:1px solid #e5e7eb; border-radius:13px; background:#f8fafc; color:#64748b; font-size:11px; font-weight:800; transition:.2s ease; }
.choice span small { display:block; margin-top:3px; color:#94a3b8; font-size:9px; font-weight:600; }
.choice input:checked + span { color:#0000ff; border-color:#818cf8; background:#eef2ff; box-shadow:0 0 0 3px #e0e7ff; }
.security-note { display:flex; gap:8px; align-items:flex-start; margin-top:14px; padding:12px; border-radius:13px; color:#64748b; background:#f8fafc; font-size:10px; line-height:1.5; }
.recent-title { display:flex; justify-content:space-between; align-items:center; margin:23px 0 10px; }
.recent-title strong { font-size:15px; }
.recent-title a { color:#0000ff; font-size:11px; font-weight:800; text-decoration:none; }
.recent-row { display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid #f1f5f9; }
.recent-row:last-child { border-bottom:0; }
.recent-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; color:#059669; background:#ecfdf5; font-weight:800; }
.recent-icon.pending { color:#d97706; background:#fffbeb; }
.recent-main { flex:1; min-width:0; }
.recent-main strong { display:block; font-size:12px; }
.recent-main small { color:#94a3b8; font-size:10px; }
.recent-amount { color:#059669; font-size:12px; font-weight:800; }
.recent-amount.pending { color:#d97706; }
@media (max-width:430px) { .amount-grid { grid-template-columns:repeat(2,1fr); } }
@media (min-width: 680px) {
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .product-art { height: auto; }
}