/* LinkCash — White Mode + Mobile-First Responsive */

:root {
    --bg: #f4f7fb;
    --bg-page: #eef2f7;
    --card: #ffffff;
    --card-inner: #f1f5f9;
    --accent-mint: #1aeac7;
    --accent-emerald: #059669;
    --accent-purple: #7d5fff;
    --accent-indigo: #6366f1;
    --text: #0f172a;
    --text-dim: #64748b;
    --border: #e2e8f0;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-inset: inset 3px 3px 8px #e2e8f0, inset -2px -2px 6px #ffffff;
    --app-width: 430px;
    --nav-h: 78px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Legacy aliases used across pages */
    --bg-dark: var(--bg);
    --card-dark: var(--card);
    --border-subtle: var(--border);
    --text-white: var(--text);
    --accent-green: var(--accent-emerald);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

body {
    background-color: var(--bg-page) !important;
    background-image:
        radial-gradient(circle at 12% 10%, rgba(125, 95, 255, 0.10), transparent 42%),
        radial-gradient(circle at 88% 90%, rgba(16, 185, 129, 0.10), transparent 42%) !important;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
    color: var(--text) !important;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

body:not(:has(.bottom-nav)) {
    padding-bottom: max(24px, var(--safe-bottom));
    justify-content: flex-start;
}

.app-container {
    width: 100%;
    max-width: var(--app-width);
    margin: 0 auto;
    padding: 0 12px 8px;
    position: relative;
    flex: 0 0 auto;
}

.top-header {
    background: var(--card) !important;
    width: calc(100% - 24px);
    max-width: var(--app-width);
    margin: 10px auto 16px auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--border);
    border-bottom: 2px solid var(--accent-mint);
    border-radius: 50px;
    position: sticky;
    top: max(8px, env(safe-area-inset-top, 0px));
    z-index: 2000;
    box-shadow: var(--shadow);
}

.top-header .brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-header .brand-logo img {
    height: 28px;
}

.top-header .user-badge {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.12);
    padding: 4px 12px;
    border-radius: 50px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 168px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    background: #059669;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 18px 28px 20px;
    opacity: 0;
    transform: translateX(28px) scale(.985);
    pointer-events: none;
    transition: opacity .55s ease, transform .55s ease;
    color: #fff;
}

.hero-slide.is-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 1;
}

.hero-slide.is-exit {
    opacity: 0;
    transform: translateX(-24px) scale(.98);
}

.hero-slide.theme-earn { background: linear-gradient(135deg, #10b981 0%, #047857 100%); }
.hero-slide.theme-invite { background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%); }
.hero-slide.theme-tasks { background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%); }
.hero-slide.theme-vip { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.hero-slide.theme-withdraw { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); }

.hero-copy {
    flex: 1;
    min-width: 0;
    z-index: 2;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.25);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    backdrop-filter: blur(4px);
}

.hero-copy h2 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 6px;
    color: #fff;
}

.hero-copy p {
    font-size: 12px;
    line-height: 1.45;
    margin: 0;
    opacity: .95;
    color: #fff;
    max-width: 210px;
}

.hero-art {
    width: 132px;
    height: 118px;
    flex-shrink: 0;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,.18));
    animation: heroFloat 3.2s ease-in-out infinite;
}

.hero-slide.is-active .hero-art {
    animation: heroFloat 3.2s ease-in-out infinite, heroPop .6s ease;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes heroPop {
    from { transform: translateY(10px) scale(.92); opacity: .4; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.hero-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 3;
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255,255,255,.35);
    cursor: pointer;
    transition: .25s ease;
}

.hero-dot.is-active {
    width: 18px;
    border-radius: 999px;
    background: #fff;
}

.hero-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    background: rgba(255,255,255,.85);
    z-index: 4;
    border-radius: 0 2px 0 0;
}

@media (max-width: 420px) {
    .banner-slider { height: 158px; }
    .hero-art { width: 108px; height: 100px; }
    .hero-copy h2 { font-size: 18px; }
    .hero-copy p { font-size: 11px; max-width: 180px; }
}

.card-section {
    background: var(--card) !important;
    color: var(--text) !important;
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-emerald) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.support-item {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border-radius: 18px;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s;
}

.support-item:hover {
    transform: translateY(-2px);
}

.support-item i,
.support-item span {
    color: #ffffff !important;
}

.support-item i { font-size: 20px; }
.support-item span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
}

.btn-wa-ch { background: linear-gradient(135deg, #128C7E, #075E54); border-left: 4px solid #25D366 !important; }
.btn-tg-ch { background: linear-gradient(135deg, #0088cc, #005f8f); border-left: 4px solid #229ED9 !important; }
.btn-helpline { background: linear-gradient(135deg, #930b81, #5f27cd); border-left: 4px solid #ffffff !important; }
.btn-local { background: linear-gradient(135deg, #7d5fff, #5f27cd); border-left: 4px solid #1aeac7 !important; }
.btn-fb { background: linear-gradient(135deg, #3b5998, #2d4373); border-left: 4px solid #4267B2 !important; }
.btn-yt { background: linear-gradient(135deg, #ff0000, #b31217); border-left: 4px solid #ff4444 !important; }
.btn-email { background: linear-gradient(135deg, #e74c3c, #c0392b); border-left: 4px solid #ff7675 !important; }

.profile-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.profile-card-item {
    background: var(--card-inner);
    border-radius: 22px;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-inset);
    transition: transform 0.2s;
}

.profile-card-item:hover { transform: translateY(-2px); }

.profile-card-item i {
    font-size: 26px;
    color: var(--accent-emerald);
}

.profile-card-item span {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-width);
    background: #ffffff !important;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--border);
    display: flex !important;
    justify-content: space-around;
    align-items: center;
    padding: 10px 4px calc(10px + var(--safe-bottom));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
    z-index: 9999;
}

.nav-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.4px;
    width: 20%;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    color: #64748b;
}

.nav-item.active,
.nav-item.active i {
    color: var(--accent-emerald) !important;
}

.nav-item.active span {
    color: var(--text) !important;
}

.nav-item.active i {
    transform: translateY(-2px);
}

.auth-card {
    width: calc(100% - 24px);
    max-width: 420px;
    background: var(--card) !important;
    border-radius: 30px;
    padding: 50px 20px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    margin: 56px auto 24px auto;
}

.logo-box {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    width: 95px;
    height: 95px;
    background: var(--bg-page);
    border-radius: 50%;
    padding: 5px;
    box-shadow: var(--shadow);
}

.logo-inner {
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent-purple);
    overflow: hidden;
    padding: 4px;
}

.logo-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-header {
    text-align: center;
    margin-bottom: 22px;
}

.brand-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text) !important;
}

.brand-header p {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-emerald) !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.form-group { margin-bottom: 16px; }

.label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
    padding-left: 6px;
}

.input-box {
    display: flex;
    align-items: center;
    background: var(--card-inner) !important;
    border-radius: 16px;
    padding: 2px 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-inset);
    transition: 0.3s;
}

.input-box:focus-within {
    border-color: var(--accent-purple);
}

.input-box i {
    color: var(--accent-purple);
    font-size: 15px;
    margin-right: 10px;
}

.input-box input,
.input-box select {
    width: 100%;
    min-width: 0;
    padding: 12px 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text) !important;
    font-size: 16px;
    font-weight: 600;
}

.input-box input::placeholder {
    color: #94a3b8;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--accent-purple), #5f27cd);
    color: #ffffff !important;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(125, 95, 255, 0.25);
    transition: 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-submit:hover { transform: translateY(-2px); }

.msg-box {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 12px;
    text-align: center;
    margin-bottom: 16px;
    font-weight: 700;
}

.error-box { background: #fef2f2; color: #b91c1c !important; border: 1px solid #fecaca; }
.success-box { background: #ecfdf5; color: #047857 !important; border: 1px solid #a7f3d0; }
.pending-box { background: #fffbeb; color: #b45309 !important; border: 1px solid #fde68a; }

.footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-dim);
}

.footer-link a {
    color: var(--accent-emerald);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
}

.vip-card {
    background: var(--card) !important;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: var(--app-width);
}

.vip-badge {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.vip-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.btn-rent {
    background: linear-gradient(135deg, var(--accent-purple), #5f27cd);
    color: #ffffff !important;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.app-container .top-header {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.app-container table { width: 100%; }

.quick-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-row > * { flex: 1 1 140px; }

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wa-float {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(18px, var(--safe-bottom));
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 10000;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

.lang-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lang-modal-box {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px 18px 16px;
}

.lang-modal-header { text-align: center; margin-bottom: 16px; }
.lang-modal-header h3 { font-size: 18px; margin: 8px 0 4px; color: var(--text); }
.lang-modal-header p { font-size: 12px; color: var(--text-dim); }

.lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lang-btn {
    background: var(--card-inner);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
}

.lang-name { display: block; font-weight: 800; font-size: 14px; }
.lang-sub { display: block; font-size: 11px; color: var(--accent-emerald); margin-top: 4px; }

.lang-close {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: var(--card-inner);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.balance-hero {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    text-align: center;
    padding: 24px;
}

/* Keep dark readable text on normal white cards (don't inherit hero white) */
.card-section:not(.balance-hero) {
    color: var(--text) !important;
}

.live-profits-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow: hidden;
    position: relative;
}

@keyframes profitSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ticker-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 50px;
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0;
    margin-bottom: 16px;
}

.ticker-bar marquee {
    font-size: 12px;
    font-weight: 700;
    color: #047857;
}

.profit-row {
    background: var(--card-inner);
    padding: 12px 16px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    gap: 8px;
    animation: profitSlideIn 0.45s ease;
}

.profit-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a !important;
}

.menu-link {
    background: var(--card-inner);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    text-align: center;
    display: block;
}

.menu-link.mint {
    border-color: #a7f3d0;
    color: #059669;
}

.inner-panel {
    background: var(--card-inner) !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px;
    padding: 15px;
}

.navbar-center { justify-content: center; }

.nav-text {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
}

.eye-icon { cursor: pointer; color: #94a3b8; }
.eye-icon:hover { color: var(--accent-emerald); }

/* Small phones */
@media (max-width: 400px) {
    .vip-card {
        flex-direction: column;
        align-items: stretch;
    }

    .vip-card form,
    .vip-card .btn-rent { width: 100%; }

    .support-item { padding: 12px 8px; gap: 8px; }
    .support-item span { font-size: 9px; }

    .auth-card {
        padding: 48px 14px 22px;
        margin-top: 52px;
    }

    .logo-box {
        width: 82px;
        height: 82px;
        top: -40px;
    }
}

/* Tablet */
@media (min-width: 768px) {
    body {
        padding-top: 20px;
        padding-bottom: calc(var(--nav-h) + 36px);
    }

    .app-container,
    .top-header,
    .auth-card,
    .vip-card,
    .bottom-nav {
        max-width: var(--app-width);
    }

    .bottom-nav {
        bottom: 14px;
        border-radius: 24px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .app-container {
        background: transparent;
    }
}

/* Desktop: centered phone app shell */
@media (min-width: 1024px) {
    :root {
        --app-width: 440px;
    }

    body {
        padding-top: 28px;
        padding-bottom: calc(var(--nav-h) + 48px);
        background-color: #e8edf5 !important;
    }

    .top-header,
    .app-container,
    .auth-card {
        max-width: var(--app-width);
    }

    .app-container {
        background: transparent;
        padding-left: 14px;
        padding-right: 14px;
    }

    .bottom-nav {
        max-width: var(--app-width);
        bottom: 20px;
    }

    .wa-float {
        right: calc(50% - (var(--app-width) / 2) - 70px);
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
    }
}

/* Admin / guideline mobile fixes */
@media (max-width: 900px) {
    .admin-nav {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 12px 14px !important;
        align-items: flex-start !important;
    }

    .admin-nav .nav-links {
        flex-wrap: wrap !important;
        width: 100%;
        gap: 6px !important;
    }

    .container {
        max-width: 100% !important;
        margin: 16px auto !important;
        padding: 0 12px !important;
    }

    .grid-4 { grid-template-columns: 1fr 1fr !important; }

    .table-box {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 16px 12px !important;
    }

    .table-box table { min-width: 720px; }

    .guide-container {
        max-width: 100% !important;
        margin: 12px auto !important;
        padding: 18px 14px !important;
        border-radius: 18px !important;
    }

    .settings-card .form-group div[style*="display:flex"] {
        flex-direction: column !important;
    }
}

@media (max-width: 600px) {
    .grid-4 { grid-template-columns: 1fr !important; }
    .inline-form { flex-wrap: wrap; }
    .search-box { flex-direction: column; }
    .search-box button { padding: 12px !important; }
}

