* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #22d3ee;          /* cyan neon */
    --primary-dark: #06b6d4;
    --accent: #818cf8;           /* violet */
    --gradient: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --bg: #070b14;
    --bg-2: #0b1120;
    --card: rgba(15, 23, 42, .72);
    --card-solid: #0f172a;
    --text: #e2e8f0;
    --heading: #f8fafc;
    --muted: #8b9bb4;
    --border: rgba(148, 163, 184, .16);
    --border-strong: rgba(34, 211, 238, .45);
    --green: #34d399;
    --red: #f87171;
    --amber: #fbbf24;
    --glow-cyan: 0 0 24px rgba(34, 211, 238, .25);
    --font-main: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 189, 248, .13), transparent),
        radial-gradient(ellipse 60% 40% at 85% 100%, rgba(99, 102, 241, .10), transparent),
        linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { color: var(--heading); letter-spacing: -.01em; }
a { color: var(--primary); }
.muted { color: var(--muted); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; width: 100%; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; }

::selection { background: rgba(34, 211, 238, .3); }

/* Navbar */
.navbar {
    background: rgba(7, 11, 20, .8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand {
    font-size: 1.2rem; font-weight: 700; text-decoration: none;
    background: linear-gradient(135deg, #22d3ee, #818cf8);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: var(--primary);
}
.nav-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-links a { color: var(--text); text-decoration: none; font-size: .95rem; transition: color .15s, text-shadow .15s; }
.nav-links a:hover { color: var(--primary); text-shadow: 0 0 12px rgba(34, 211, 238, .6); }
/* ① Số dư ví (tiền, đ) — không phải token API */
.badge-balance {
    background: rgba(34, 211, 238, .1);
    border: 1px solid rgba(34, 211, 238, .35);
    color: var(--primary);
    padding: 4px 14px; border-radius: 999px;
    font-weight: 600; font-size: .88rem;
    font-family: var(--font-mono);
    box-shadow: inset 0 0 12px rgba(34, 211, 238, .08);
}

/* Buttons */
.btn {
    display: inline-block; padding: 10px 22px; border-radius: 10px; border: none;
    cursor: pointer; font-size: .95rem; font-weight: 600; text-decoration: none;
    text-align: center; font-family: var(--font-main);
    transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--gradient); color: #fff;
    box-shadow: 0 4px 18px rgba(56, 189, 248, .35);
}
.btn-primary:hover { box-shadow: 0 6px 26px rgba(56, 189, 248, .55); color: #fff; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--border-strong); color: var(--primary); box-shadow: var(--glow-cyan); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 14px rgba(16, 185, 129, .3); }
.btn-danger { background: linear-gradient(135deg, #f43f5e, #dc2626); color: #fff; box-shadow: 0 4px 14px rgba(244, 63, 94, .3); }
.btn-sm { padding: 6px 14px; font-size: .85rem; border-radius: 8px; }
.btn-block { display: block; width: 100%; }

/* Cards */
.card {
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
.card h2, .card h3 { margin-bottom: 14px; }
.card h3::before { content: "▸ "; color: var(--primary); }

/* Hero */
.hero { text-align: center; padding: 64px 16px 44px; }
.hero-badge {
    display: inline-block; margin-bottom: 18px;
    font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
    color: var(--primary);
    background: rgba(34, 211, 238, .08);
    border: 1px solid rgba(34, 211, 238, .3);
    padding: 5px 16px; border-radius: 999px;
    box-shadow: inset 0 0 16px rgba(34, 211, 238, .07);
}
.hero h1 {
    font-size: 2.6rem; line-height: 1.2; margin-bottom: 16px;
    background: linear-gradient(135deg, #f8fafc 30%, #22d3ee 70%, #818cf8 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 28px; }
.hero strong { color: var(--primary); }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 24px 0; }
.plan {
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 30px 22px; text-align: center;
    position: relative;
    transition: transform .2s, border-color .2s, box-shadow .25s;
}
.plan:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--glow-cyan); }
.plan.popular {
    border: 1px solid var(--border-strong);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, .3), var(--glow-cyan);
}
.plan .tag {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--gradient); color: #fff; font-size: .72rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    padding: 3px 14px; border-radius: 999px;
    box-shadow: 0 2px 12px rgba(56, 189, 248, .5);
}
.plan h3 { font-size: 1.15rem; color: var(--heading); }
.plan .price {
    font-size: 2rem; font-weight: 700; margin: 12px 0 2px;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, #22d3ee, #818cf8);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.plan .unit { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }

/* Forms */
.form-card { max-width: 420px; margin: 36px auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; color: var(--heading); }
.form-group input, .form-group select {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: 1rem; font-family: var(--font-main);
    background: rgba(7, 11, 20, .6); color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .15), var(--glow-cyan);
}
.form-group input::placeholder { color: var(--muted); }
.form-hint { color: var(--muted); font-size: .85rem; margin-top: 5px; }

/* Khối thanh toán VietQR ở trang nạp tiền */
.qr-pay { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.qr-pay-img {
    background: #fff; border-radius: 14px; padding: 10px;
    border: 1px solid var(--border-strong); flex: 0 0 auto;
}
.qr-pay-img img { display: block; width: 300px; max-width: 100%; height: auto; }
.qr-pay-info { flex: 1 1 340px; min-width: 300px; }

/* Captcha (ảnh SVG sinh bởi captcha.php, không cần GD) */
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.captcha-img {
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #f2f4f9;
    display: block;
    max-width: 100%; height: auto;
}
.captcha-reload { line-height: 1; padding: 8px 12px; font-size: 1rem; }
.form-group input#captcha {
    text-transform: uppercase;
    letter-spacing: .35em;
    font-family: var(--font-mono);
    max-width: 260px;
}

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .95rem; backdrop-filter: blur(8px); }
.alert a { font-weight: 600; }
.alert-success { background: rgba(52, 211, 153, .1); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, .35); }
.alert-error { background: rgba(248, 113, 113, .1); color: #fca5a5; border: 1px solid rgba(248, 113, 113, .35); }
.alert-info { background: rgba(56, 189, 248, .1); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, .35); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: none; }
tbody tr, table tr { transition: background .15s; }
table tr:hover td { background: rgba(34, 211, 238, .04); }

/* Misc */
.key-code {
    font-family: var(--font-mono);
    background: rgba(34, 211, 238, .08);
    border: 1px solid rgba(34, 211, 238, .22);
    color: var(--primary);
    padding: 3px 9px; border-radius: 7px; font-size: .84rem;
}
.status { font-weight: 600; font-size: .82rem; padding: 3px 11px; border-radius: 999px; font-family: var(--font-mono); }
.status-active, .status-approved { background: rgba(52, 211, 153, .12); color: var(--green); border: 1px solid rgba(52, 211, 153, .35); }
.status-expired, .status-rejected { background: rgba(248, 113, 113, .12); color: var(--red); border: 1px solid rgba(248, 113, 113, .35); }
.status-pending { background: rgba(251, 191, 36, .12); color: var(--amber); border: 1px solid rgba(251, 191, 36, .35); }
.amount-plus { color: var(--green); font-weight: 600; font-family: var(--font-mono); }
.amount-minus { color: var(--red); font-weight: 600; font-family: var(--font-mono); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
    background: var(--card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 14px; padding: 18px 20px;
    position: relative; overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}
.stat::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--gradient); opacity: .8;
}
.stat:hover { border-color: var(--border-strong); box-shadow: var(--glow-cyan); }
.stat .label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; }
.stat .value { font-size: 1.7rem; font-weight: 700; color: var(--heading); font-family: var(--font-mono); margin-top: 2px; }

/* Footer */
.footer {
    background: rgba(7, 11, 20, .8);
    border-top: 1px solid var(--border);
    padding: 20px 0; color: var(--muted); font-size: .88rem; text-align: center;
}

/* Avatar page */
.avt-source-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.avt-source-or {
    color: var(--muted);
    font-size: .85rem;
}
.avt-url-input {
    flex: 1;
    min-width: 200px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .9rem;
    font-family: var(--font-main);
    background: rgba(7, 11, 20, .6);
    color: var(--text);
}
.avt-url-input:focus {
    outline: none;
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .15), var(--glow-cyan);
}
.avt-crop-wrap {
    margin-top: 14px;
}
.avt-crop-wrap img {
    max-width: 100%;
}
.avt-crop-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* Cropper.js dark overrides */
.cropper-container {
    border-radius: 12px;
}
.cropper-view-box {
    outline: 2px solid var(--primary);
    outline-color: rgba(34, 211, 238, .75);
}
.cropper-point {
    background-color: var(--primary);
    width: 10px;
    height: 10px;
}
.cropper-line {
    background-color: var(--primary);
}
.cropper-dashed {
    border-color: rgba(34, 211, 238, .3);
}
.cropper-modal {
    background: rgba(7, 11, 20, .65);
}

/* Avatar page old */
.avt-preview-wrap {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-2);
    border: 1px solid var(--border);
    max-width: 540px;
    margin: 0 auto;
}
.avt-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1080 / 1701;
    object-fit: cover;
}
.avt-preview-empty {
    border: 2px dashed var(--border-strong);
    background: rgba(34, 211, 238, .04);
    min-height: 200px;
}
.avt-timer {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(7, 11, 20, .85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    padding: 5px 18px;
    border-radius: 999px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}
.form-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    color: var(--muted);
    font-size: .88rem;
}
.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

@media (max-width: 640px) {
    .hero { padding: 40px 12px 28px; }
    .hero h1 { font-size: 1.9rem; }
}
