/* ============================================================================
   NexShop — lapisan tampilan minimalis 2026
   Dimuat paling akhir. Hanya menimpa tampilan; tidak menyentuh id, handler,
   izin, atau struktur data. Efek diadaptasi dari pola React Bits
   (Aurora / Shiny Text / Spotlight Card / Count Up) dan ditulis ulang tanpa
   React supaya tetap cocok dengan halaman statis + CSP hash.
   ========================================================================== */

/* ── Token ───────────────────────────────────────────────────────────────── */
body.rs-portal-page {
    --nx-ink: var(--nx-text);
    --nx-body: var(--nx-text-secondary);
    --nx-muted: var(--nx-text-secondary);
    --nx-line: var(--nx-border);
    --nx-line-kuat: var(--nx-border-strong);
    --nx-kanvas: var(--nx-neutral-50);
    --nx-putih: var(--nx-neutral-0);
    --nx-biru: var(--nx-action);
    --nx-biru-terang: var(--nx-action);
    --nx-navy: var(--nx-neutral-950);
    --nx-radius: 14px;
    --nx-radius-kecil: 10px;
    --nx-bayang: 0 1px 2px color-mix(in srgb, var(--nx-neutral-900) 5%, transparent);
    --nx-bayang-naik: 0 10px 28px color-mix(in srgb, var(--nx-neutral-900) 9%, transparent);
}

/* ── Panel kiri login: aurora halus ──────────────────────────────────────── */
html body.rs-portal-page.rs-portal-page #sectionAuth .ax-panel {
    position: relative;
    overflow: hidden;
    background-color: #0a1730 !important;
}

/* Cahaya aurora sebagai lapisan di atas latar panel (bukan background-image
   panel itu sendiri, supaya warna latar tetap terbaca oleh audit kontras). */
html body.rs-portal-page.rs-portal-page #sectionAuth .ax-panel::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(560px 420px at 92% -12%, rgba(14, 165, 233, .34), transparent 64%),
        radial-gradient(460px 380px at -12% 112%, rgba(201, 162, 39, .22), transparent 68%);
}

body.rs-portal-page .ax-panel > * {
    position: relative;
    z-index: 1;
}

html body.rs-portal-page.rs-portal-page #sectionAuth .ax-panel::after {
    display: none;
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(64px);
    opacity: .55;
    pointer-events: none;
}

body.rs-portal-page .ax-panel::before {
    width: 460px;
    height: 460px;
    top: -180px;
    right: -160px;
    background: radial-gradient(circle, rgba(14, 165, 233, .38), transparent 68%);
    animation: nx-aurora-a 18s ease-in-out infinite alternate;
}

body.rs-portal-page .ax-panel::after {
    width: 380px;
    height: 380px;
    bottom: -170px;
    left: -120px;
    background: radial-gradient(circle, rgba(201, 162, 39, .28), transparent 70%);
    animation: nx-aurora-b 22s ease-in-out infinite alternate;
}

@keyframes nx-aurora-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-28px, 26px, 0) scale(1.08); }
}

@keyframes nx-aurora-b {
    from { transform: translate3d(0, 0, 0) scale(1.04); }
    to   { transform: translate3d(24px, -22px, 0) scale(1); }
}

/* ── Statistik panel kiri: garis rambut, bukan kotak ─────────────────────── */
body.rs-portal-page .ax-stats {
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-top: 18px;
}

html body.rs-portal-page.rs-portal-page #sectionAuth .ax-stats > *,
html body.rs-portal-page.rs-portal-page #sectionAuth .ax-stats dt,
html body.rs-portal-page.rs-portal-page #sectionAuth .ax-stats dd {
    padding: 0 18px !important;
    background: transparent !important;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, .14) !important;
    border-radius: 0 !important;
}

html body.rs-portal-page.rs-portal-page #sectionAuth .ax-stats > *:first-child {
    padding-left: 0 !important;
    border-left: 0 !important;
}

/* ── Form login: bidang tenang ───────────────────────────────────────────── */
body.rs-portal-page #sectionAuth input:not([type="checkbox"]):not([type="radio"]),
body.rs-portal-page #sectionAuth select {
    height: 44px;
    border-radius: var(--nx-radius-kecil);
    border: 1px solid var(--nx-line-kuat);
    background: var(--nx-putih);
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

body.rs-portal-page #sectionAuth input:focus,
body.rs-portal-page #sectionAuth select:focus {
    outline: 0;
    border-color: var(--nx-biru-terang);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .16);
}

body.rs-portal-page #sectionAuth button[type="submit"] {
    height: 46px;
    border-radius: var(--nx-radius-kecil);
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: 0 6px 18px rgba(14, 106, 155, .22);
    transition: transform .12s ease, box-shadow .16s ease, filter .16s ease;
}

body.rs-portal-page #sectionAuth button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(14, 106, 155, .28);
}

/* ── Kartu dashboard: tenang, garis rambut, sorot mengikuti kursor ───────── */
body.rs-portal-page .tvd-card {
    position: relative;
    border-radius: var(--nx-radius);
    border: 1px solid var(--nx-line);
    background: var(--nx-putih);
    box-shadow: var(--nx-bayang);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
    overflow: hidden;
}

body.rs-portal-page .tvd-card.nx-sorot::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .22s ease;
    background: radial-gradient(260px circle at var(--nx-x, 50%) var(--nx-y, 0%), rgba(14, 165, 233, .10), transparent 62%);
}

body.rs-portal-page .tvd-card.nx-sorot:hover::after {
    opacity: 1;
}

body.rs-portal-page .tvd-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--nx-bayang-naik);
    border-color: var(--nx-line-kuat);
}

body.rs-portal-page .tvd-card-angka,
body.rs-portal-page .tvd-card-angka strong,
body.rs-portal-page .tvd-card-angka .tvd-angka {
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* Kartu saldo: gradien tenang, bukan blok navy pekat */
body.rs-portal-page .tvd-card-navy,
body.rs-portal-page .tvd-balance {
    border: 0;
    background:
        radial-gradient(520px circle at 88% -10%, rgba(14, 165, 233, .28), transparent 58%),
        linear-gradient(155deg, #0d1c3a 0%, #0b1730 52%, #0a1428 100%);
    box-shadow: 0 14px 34px rgba(11, 23, 48, .28);
}

body.rs-portal-page .tvd-balance-amount {
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

/* ── Tombol: satu bahasa bentuk ──────────────────────────────────────────── */
body.rs-portal-page .tvd-btn-primary,
body.rs-portal-page .tvd-btn-ghost,
body.rs-portal-page .tvd-btn-gold,
body.rs-portal-page .tvd-btn-deposit {
    border-radius: var(--nx-radius-kecil);
    font-weight: 600;
    transition: transform .12s ease, box-shadow .16s ease, background-color .16s ease;
}

body.rs-portal-page .tvd-btn-primary:hover,
body.rs-portal-page .tvd-btn-deposit:hover {
    transform: translateY(-1px);
}

/* ── Kepala tabel: lebih lapang ──────────────────────────────────────────── */
body.rs-portal-page .tvd-card-tabel th {
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}

body.rs-portal-page .tvd-card-tabel td,
body.rs-portal-page .tvd-card-tabel th {
    padding-top: 14px;
    padding-bottom: 14px;
}

/* ── Hormati preferensi gerak minimal ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    body.rs-portal-page .ax-panel::before,
    body.rs-portal-page .ax-panel::after {
        animation: none;
    }

    body.rs-portal-page .tvd-card,
    body.rs-portal-page .tvd-card:hover,
    body.rs-portal-page #sectionAuth button[type="submit"]:hover {
        transform: none;
    }
}

/* ── Ponsel: efek dikurangi agar tetap ringan ────────────────────────────── */
@media (max-width: 640px) {
    body.rs-portal-page .ax-panel::before {
        width: 300px;
        height: 300px;
        filter: blur(48px);
        opacity: .45;
    }

    body.rs-portal-page .ax-panel::after {
        display: none;
    }

    body.rs-portal-page .ax-stats > * {
        padding: 0 12px;
    }
}

/* ── Angka kartu: jangan pecah baris ────────────────────────────────────── */
body.rs-portal-page #sectionDashboard .tvd-card-angka {
    white-space: nowrap;
    font-size: clamp(15px, 1.05vw, 19px);
    line-height: 1.15;
}

body.rs-portal-page #sectionDashboard .tvd-card-angka.tvd-angka-gelap {
    font-size: clamp(15px, 1.05vw, 19px);
}

/* ── Kartu level: teks boleh membungkus rapi, tidak terpotong ────────────── */
body.rs-portal-page .tvd-level-link,
body.rs-portal-page .tvd-level-teks,
body.rs-portal-page .tvd-vip p {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

body.rs-portal-page .tvd-card,
body.rs-portal-page .tvd-card * {
    min-width: 0;
}

/* ── Kartu tingkatan di sidebar: napas tambah ───────────────────────────── */
body.rs-portal-page .tvd-vip {
    padding: 14px 14px 16px;
    line-height: 1.55;
}

body.rs-portal-page .tvd-vip p {
    margin: 6px 0 0;
    font-size: 12.5px;
}

/* ── Kepala grafik: toggle tidak menempel ───────────────────────────────── */
body.rs-portal-page .tvd-chart-head {
    gap: 12px;
    align-items: flex-start;
}

body.rs-portal-page .tvd-seg {
    margin-left: auto;
}

/* ── Field password: ruang untuk tombol tampilkan ───────────────────────── */
body.rs-portal-page #sectionAuth input[type="password"],
body.rs-portal-page #sectionAuth input[data-nx-password] {
    padding-right: 96px;
}

/* ── Jarak tombol masuk dari field terakhir ─────────────────────────────── */
body.rs-portal-page #sectionAuth form button[type="submit"],
body.rs-portal-page #sectionAuth button[type="submit"] {
    margin-top: 18px;
}

/* ── Teks bantu: kontras dinaikkan ──────────────────────────────────────── */
body.rs-portal-page #sectionAuth .ax-sub,
body.rs-portal-page #sectionAuth small,
body.rs-portal-page #sectionAuth .ax-bantuan {
    color: #475569;
}

body.rs-portal-page #sectionAuth .ax-panel .ax-sub,
body.rs-portal-page #sectionAuth .ax-panel small {
    color: #c3d0e2;
}

/* ── Kartu statistik dashboard (article.tvd-stat) ───────────────────────── */
body.rs-portal-page #sectionDashboard .tvd-stat strong {
    display: block;
    white-space: nowrap;
    font-size: clamp(16px, 1.12vw, 20px);
    line-height: 1.2;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

body.rs-portal-page #sectionDashboard .tvd-stat-top {
    gap: 8px;
    align-items: flex-start;
}

body.rs-portal-page #sectionDashboard .tvd-stat-top span {
    font-size: 11.8px;
    line-height: 1.35;
    letter-spacing: -.005em;
    color: #475569;
    min-width: 0;
}

body.rs-portal-page #sectionDashboard .tvd-stat small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

body.rs-portal-page #sectionDashboard .tvd-stat {
    min-width: 0;
    padding: 16px 18px;
    border-radius: var(--nx-radius);
    border: 1px solid var(--nx-line);
    background: var(--nx-putih);
    box-shadow: var(--nx-bayang);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

body.rs-portal-page #sectionDashboard .tvd-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--nx-bayang-naik);
    border-color: var(--nx-line-kuat);
}

/* ── Banner cookie tidak boleh menutupi isi ─────────────────────────────── */
body.rs-portal-page:has(.nexshop-cookie-banner) #sectionDashboard,
body.rs-portal-page:has(.nexshop-cookie-banner) #sectionAuth {
    padding-bottom: 280px;
}

@media (min-width: 900px) {
    body.rs-portal-page:has(.nexshop-cookie-banner) #sectionDashboard,
    body.rs-portal-page:has(.nexshop-cookie-banner) #sectionAuth {
        padding-bottom: 170px;
    }
}

body.rs-portal-page .nexshop-cookie-banner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* ── Topbar ponsel: kolom cari dapat ruang ──────────────────────────────── */
body.rs-portal-page .tvd-topbar-cari {
    flex: 1 1 auto;
    min-width: 0;
}

body.rs-portal-page .tvd-search,
body.rs-portal-page #tvdSearch {
    min-width: 0;
    width: 100%;
}

body.rs-portal-page .tvd-topbar,
body.rs-portal-page .tvd-topbar-inner {
    gap: 10px;
}

/* ── Tombol saldo: boleh membungkus di layar sangat kecil ───────────────── */
@media (max-width: 380px) {
    body.rs-portal-page .tvd-balance-actions {
        flex-wrap: wrap;
    }

    body.rs-portal-page .tvd-balance-actions > * {
        flex: 1 1 140px;
    }
}
