/* ============================================================
   APLUS WALLET - PREMIUM WHITE (Apple-Like) THEME
   ============================================================ */
:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --txt: #1d1d1f;
    --dim: #86868b;
    --line: #e5e5ea;
    --blue: #0071e3;
    --blue2: #0a84ff;
    --green: #34c759;
    --red: #ff3b30;
    --orange: #ff9500;
    --purple: #af52de;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --shadow: 0 8px 24px rgba(0,0,0,.07);
    --shadow-lg: 0 18px 44px rgba(0,0,0,.12);
    --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--txt);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---------- TOP NAV ---------- */
.top-nav {
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
}
.top-nav.center-nav { justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.3px; color: var(--txt); display: flex; align-items: center; gap: 8px; }
.brand img { height: 26px; width: 26px; border-radius: 8px; object-fit: cover; }
.brand i { color: var(--blue); font-size: 1.1rem; }
.top-nav a.back-link { color: var(--blue); font-size: 1.15rem; text-decoration: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f0f0f2; transition: .2s; }
.top-nav a.back-link:active { transform: scale(.9); background: #e3e3e6; }
.hamb { color: var(--txt); font-size: 1.25rem; cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f0f0f2; transition: .2s; }
.hamb:active { transform: scale(.9); }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .9rem; text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,113,227,.35);
    transition: .2s;
}
.avatar:active { transform: scale(.92); }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 520px; margin: auto; padding: 22px 16px 60px; }

/* ---------- BALANCE CARD ---------- */
.bal-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1d1d1f 0%, #2c2c2e 60%, #3a3a3c 100%);
    border-radius: 28px;
    padding: 26px 24px;
    margin-bottom: 20px;
    color: #fff;
    box-shadow: 0 18px 44px rgba(0,0,0,.22);
}
.bal-card::before {
    content: '';
    position: absolute; width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(10,132,255,.45), transparent 70%);
    top: -80px; right: -60px;
}
.bal-card::after {
    content: '';
    position: absolute; width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, rgba(175,82,222,.35), transparent 70%);
    bottom: -60px; left: -40px;
}
.bal-label { font-size: .72rem; font-weight: 600; letter-spacing: 1.4px; opacity: .75; text-transform: uppercase; }
.bal-val { font-size: 2.7rem; font-weight: 700; line-height: 1.1; margin-top: 8px; letter-spacing: -1px; }
.bal-foot { margin-top: 16px; display: flex; gap: 8px; position: relative; z-index: 1; }
.chip {
    background: rgba(255,255,255,.16);
    padding: 7px 13px; border-radius: 50px;
    font-size: .68rem; font-weight: 600; letter-spacing: .3px;
    backdrop-filter: blur(8px);
}

/* ---------- STATS ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stat {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 18px; padding: 15px 6px; text-align: center;
    box-shadow: var(--shadow-sm); transition: .2s;
}
.stat:active { transform: scale(.95); }
.stat .l { font-size: .6rem; font-weight: 600; color: var(--dim); text-transform: uppercase; display: block; margin-bottom: 6px; letter-spacing: .8px; }
.stat .v { font-size: .9rem; font-weight: 700; color: var(--blue); }
.stat .v.warn { color: var(--orange); }

/* ---------- ACTION GRID ---------- */
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.act {
    background: var(--card); border: 1px solid var(--line); border-radius: 20px;
    padding: 20px 10px; text-align: center; color: var(--txt); text-decoration: none;
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
    font-weight: 600; font-size: .85rem;
}
.act i { font-size: 1.4rem; }
.act.with i { color: var(--blue); }
.act.send i { color: var(--purple); }
.act.alert i { color: var(--orange); }
.act.head i { color: var(--green); }
.act:hover { box-shadow: var(--shadow); }
.act:active { transform: scale(.94); box-shadow: var(--shadow-sm); }

/* ---------- CARDS ---------- */
.card-soft {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sec-head .t { font-weight: 700; font-size: 1.02rem; letter-spacing: -.2px; }
.sec-head .t i { color: var(--blue); }
.view-all {
    font-size: .78rem; color: var(--blue); font-weight: 600; cursor: pointer;
    border: 1px solid rgba(0,113,227,.25); padding: 6px 13px; border-radius: 50px;
    background: rgba(0,113,227,.05); transition: .2s;
}
.view-all:active { transform: scale(.92); background: rgba(0,113,227,.12); }

/* ---------- TRANSACTION LIST ---------- */
.t-item {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 13px;
    box-shadow: var(--shadow-sm); animation: rowIn .35s ease both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.t-icon { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.t-icon.cr { background: rgba(52,199,89,.12); color: var(--green); }
.t-icon.db { background: rgba(255,59,48,.12); color: var(--red); }
.dim { color: var(--dim) !important; }
#mainChart { min-height: 160px !important; width: 100%; }

/* ---------- SIDEBAR ---------- */
.sidebar {
    position: fixed; top: 0; left: -300px; width: 300px; height: 100%;
    background: rgba(255,255,255,.96); backdrop-filter: blur(20px);
    z-index: 2000; transition: left .3s cubic-bezier(.4,0,.2,1);
    padding: 34px 22px; box-shadow: 20px 0 50px rgba(0,0,0,.15);
    border-right: 1px solid var(--line);
}
.sidebar.open { left: 0; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1999; display: none; }
.sidebar-overlay.show { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.side-link {
    display: flex; align-items: center; gap: 15px; padding: 14px 16px;
    color: var(--txt); text-decoration: none; border-radius: 14px;
    margin-bottom: 6px; font-weight: 600; font-size: .95rem; transition: .18s;
}
.side-link i { width: 24px; color: var(--blue); font-size: 1rem; }
.side-link:hover { background: #f5f5f7; }
.side-link:active { background: #ececee; transform: scale(.97); }
.side-link.danger { color: var(--red); }
.side-link.danger i { color: var(--red); }

/* ---------- AUTH PAGES ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; background: linear-gradient(180deg, #f5f5f7 0%, #eef2f8 100%); }
.auth-card {
    width: 100%; max-width: 430px; background: var(--card);
    border: 1px solid var(--line); border-radius: 30px; padding: 38px 28px;
    box-shadow: var(--shadow-lg); text-align: center;
    animation: cardUp .5s cubic-bezier(.22,.9,.28,1) both;
}
@keyframes cardUp { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.auth-logo {
    width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 24px;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; color: #fff; box-shadow: 0 14px 32px rgba(0,113,227,.4);
    overflow: hidden;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-card h2 { font-weight: 700; letter-spacing: -.5px; margin-bottom: 5px; font-size: 1.5rem; }
.auth-card .sub { color: var(--dim); font-size: .88rem; margin-bottom: 26px; }
.field { text-align: left; margin-bottom: 16px; position: relative; }
.field label { font-size: .7rem; font-weight: 600; color: var(--dim); text-transform: uppercase; letter-spacing: 1.1px; display: block; margin: 0 6px 8px; }
.field i { position: absolute; left: 16px; top: 39px; color: var(--blue); font-size: .95rem; }
.field input {
    width: 100%; background: #fbfbfd; border: 1px solid var(--line);
    border-radius: 15px; padding: 13px 16px 13px 44px; color: var(--txt);
    font-family: inherit; font-weight: 600; font-size: .95rem; transition: .25s;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.12); background: #fff; }
.btn-go {
    width: 100%; background: linear-gradient(135deg, var(--blue), var(--blue2));
    border: none; padding: 15px; border-radius: 16px; color: #fff;
    font-weight: 700; font-size: .98rem; letter-spacing: .4px; margin-top: 10px;
    box-shadow: 0 12px 26px rgba(0,113,227,.35);
    transition: transform .15s ease, box-shadow .15s ease;
    font-family: inherit; cursor: pointer;
}
.btn-go:hover { box-shadow: 0 14px 30px rgba(0,113,227,.45); }
.btn-go:active { transform: scale(.96); box-shadow: 0 6px 14px rgba(0,113,227,.3); }
.foot { margin-top: 26px; font-size: .88rem; color: var(--dim); }
.foot a { color: var(--blue); font-weight: 700; text-decoration: none; }
.hint { font-size: .72rem; color: var(--dim); margin: 6px 4px 0; text-align: left; }
.hint a { color: var(--blue); font-weight: 600; text-decoration: none; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- VERIFY PAGE ---------- */
.bot-header { background: #f0f7ff; border: 1px solid rgba(0,113,227,.3); border-radius: 18px; padding: 16px; margin-bottom: 20px; }
.btn-tg {
    background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff; border: none;
    padding: 13px; border-radius: 14px; font-weight: 700; font-size: .95rem;
    width: 100%; text-decoration: none; display: flex; align-items: center; justify-content: center;
    gap: 10px; transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 10px 22px rgba(34,158,217,.35); font-family: inherit; cursor: pointer;
}
.btn-tg:hover { color: #fff; }
.btn-tg:active { transform: scale(.96); }
.resend { color: var(--red) !important; font-weight: 700; text-decoration: none; font-size: .85rem; display: inline-block; margin-top: 14px; }
.alert-soft { font-size: .82rem; border-radius: 14px; padding: 11px 14px; font-weight: 600; }

/* ---------- FORGOT / RESET PASSWORD ---------- */
.alert { display: block; }
.alert-success.alert-soft { background: #eafaf0; color: #12833f; border: 1px solid rgba(18,131,63,.22); }
.alert-danger.alert-soft  { background: #fdeceb; color: #c0392b; border: 1px solid rgba(192,57,43,.22); }
.forgot-row { text-align: right; margin: -6px 4px 18px; }
.forgot-row a { color: var(--blue); font-size: .82rem; font-weight: 700; text-decoration: none; }
.forgot-row a:hover { text-decoration: underline; }
.user-chip {
    display: flex; align-items: center; gap: 12px; text-align: left;
    background: #f7f9fc; border: 1px solid rgba(0,113,227,.16);
    border-radius: 16px; padding: 12px 14px; margin-bottom: 20px;
}
.user-chip > i { color: var(--blue); font-size: 1.3rem; }
.user-chip b { display: block; font-size: .92rem; }
.user-chip small { color: var(--dim); font-size: .78rem; letter-spacing: .3px; }

/* ---------- PROFILE ---------- */
.av {
    width: 92px; height: 92px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; font-weight: 700; margin: 0 auto 14px; color: #fff;
    box-shadow: 0 12px 30px rgba(0,113,227,.35);
}
.uid { color: var(--blue); font-weight: 700; letter-spacing: .4px; font-size: .85rem; }
.lbl { font-size: .68rem; color: var(--dim); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600; display: block; margin-bottom: 5px; }
.val { font-size: 1.05rem; font-weight: 700; display: block; margin-bottom: 16px; }
.val.green { color: var(--green); font-size: 1.45rem; }
.support { background: #fbfbfd; border: 1px dashed rgba(0,113,227,.45); border-radius: 18px; padding: 20px; text-align: center; }

/* ---------- WITHDRAW ---------- */
.avail { text-align: center; margin-bottom: 20px; }
.avail .l { font-size: .72rem; color: var(--dim); letter-spacing: 1.4px; font-weight: 600; text-transform: uppercase; }
.avail .v { font-size: 2.3rem; font-weight: 700; letter-spacing: -1px; }
.glass { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 24px; box-shadow: var(--shadow); }
.methods { display: flex; gap: 10px; margin: 14px 0 20px; }
.m {
    flex: 1; background: #fbfbfd; border: 1px solid var(--line); border-radius: 16px;
    padding: 16px 5px; text-align: center; cursor: pointer; transition: .2s;
}
.m i { font-size: 1.3rem; color: var(--dim); display: block; margin-bottom: 6px; }
.m span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.m.active { border-color: var(--blue); background: rgba(0,113,227,.07); box-shadow: 0 4px 14px rgba(0,113,227,.15); }
.m.active i { color: var(--blue); }
.m:active { transform: scale(.95); }
.lbl { font-size: .7rem; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: block; margin: 12px 0 7px; }
.inp {
    width: 100%; background: #fbfbfd; border: 1px solid var(--line); border-radius: 14px;
    padding: 13px 16px; color: var(--txt); font-family: inherit; font-weight: 600; margin-bottom: 10px; font-size: .95rem; transition: .2s;
}
.inp:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.1); background: #fff; }
.limit { background: #f7f7fa; border-left: 3px solid var(--blue); border-radius: 14px; padding: 12px 14px; font-size: .78rem; margin-top: 18px; color: var(--dim); }

/* ---------- TRANSFER ---------- */
.bal-box { background: #f7f7fa; border: 1px solid var(--line); border-radius: 20px; padding: 20px; text-align: center; margin-bottom: 22px; }
.grp {
    background: #fbfbfd; border: 1px solid var(--line); border-radius: 15px;
    padding: 4px 16px; display: flex; align-items: center; margin-bottom: 15px; transition: .2s;
}
.grp:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.1); }
.grp i { color: var(--blue); margin-right: 12px; font-size: .95rem; }
.grp input { background: transparent !important; border: none !important; color: var(--txt) !important; font-weight: 600; box-shadow: none !important; font-family: inherit; }
.note { background: #f7f7fa; border: 1px dashed var(--line); border-radius: 16px; padding: 14px; margin-top: 18px; text-align: center; font-size: .78rem; color: var(--dim); }
.note b { color: var(--txt); }
.err { background: rgba(255,59,48,.08); color: var(--red); border-radius: 14px; padding: 12px 14px; font-size: .82rem; text-align: center; margin-bottom: 16px; font-weight: 600; animation: shake .4s ease; }
.ok { background: rgba(52,199,89,.1); color: var(--green); border-radius: 14px; padding: 12px 14px; font-size: .82rem; text-align: center; margin-bottom: 16px; font-weight: 600; animation: pop .4s ease; }
.back { color: var(--dim); text-decoration: none; font-size: .82rem; font-weight: 600; display: block; text-align: center; margin-top: 18px; }
.back:active { color: var(--blue); }

/* ---------- BOT ALERT PAGE ---------- */
.alert-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 26px;
    padding: 34px 22px; text-align: center; margin-bottom: 20px; box-shadow: var(--shadow);
}
.bot-icon {
    width: 74px; height: 74px; background: #f0f7ff; border: 1px solid rgba(0,113,227,.25);
    border-radius: 24px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px; color: var(--blue); font-size: 2rem;
}
.id-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.id-lbl { font-size: .7rem; color: var(--dim); text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 10px; display: block; font-weight: 600; }
.id-val { font-size: 1.05rem; font-weight: 700; color: var(--blue); }
.inp { width: 100%; background: #fbfbfd; border: 1px solid var(--blue); border-radius: 13px; color: var(--txt); padding: 12px 14px; margin: 14px 0; font-family: inherit; font-weight: 600; }
.inp:focus { outline: none; box-shadow: 0 0 0 4px rgba(0,113,227,.1); }
.info { margin-top: 18px; padding: 16px; border-radius: 16px; background: #faf5ff; border: 1px dashed rgba(175,82,222,.35); font-size: .8rem; color: var(--dim); }
.info a { color: var(--blue); font-weight: 600; text-decoration: none; }
.status-msg { font-size: .85rem; color: var(--green); font-weight: 700; text-align: center; margin-top: 12px; animation: pop .4s ease; }

/* ---------- TOAST ---------- */
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
    background: rgba(29,29,31,.94); color: #fff; padding: 13px 22px; border-radius: 50px;
    font-size: .85rem; font-weight: 600; z-index: 3000; opacity: 0;
    transition: all .3s cubic-bezier(.22,.9,.28,1);
    display: flex; align-items: center; gap: 9px; max-width: 88vw;
    box-shadow: 0 12px 32px rgba(0,0,0,.25); pointer-events: none;
    backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { color: var(--blue2); }
.toast.error { background: rgba(255,59,48,.95); }
.toast.error i { color: #fff; }
.toast.success { background: rgba(52,199,89,.95); }
.toast.success i { color: #fff; }
.toast.warn { background: rgba(255,149,0,.95); }
.toast.warn i { color: #fff; }

/* ---------- ANIMATIONS ---------- */
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes pop { 0% { transform: scale(.92); opacity: .5; } 50% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 24px rgba(0,113,227,.2); }
    50% { box-shadow: 0 8px 34px rgba(0,113,227,.45); }
}
@keyframes floatIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.float-in { animation: floatIn .45s ease both; }
.pulse-glow { animation: pulseGlow 2.2s ease-in-out infinite; }

.vib-error { animation: shake .45s ease; }
.vib-pop { animation: pop .4s ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}