/* =========================================================
   HepBet Partners — Premium Affiliate Portal & Landing CSS
   ========================================================= */
:root {
    --bg-dark: #080c12;
    --bg-card: #111722;
    --bg-card-2: #161f2d;
    --bg-card-3: #1c2738;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-accent: rgba(0, 229, 153, 0.3);
    --text: #f3f6fa;
    --text-soft: #cbd5e1;
    --text-muted: #8492a6;
    --primary: #00e599;
    --primary-glow: rgba(0, 229, 153, 0.25);
    --primary-hover: #00ffaa;
    --accent-blue: #00b4d8;
    --accent-cyan: #06d6a0;
    --accent-gold: #ffb703;
    --accent-red: #ff4d6d;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(0, 229, 153, 0.15);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 10%, rgba(0, 229, 153, 0.06) 0px, transparent 50%),
        radial-gradient(at 90% 0%, rgba(0, 180, 216, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 90%, rgba(255, 183, 3, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: all .2s; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
.mono { font-family: "Cascadia Code", Consolas, monospace; }

/* Utility */
.up { color: var(--primary); }
.down { color: var(--accent-red); }
.gold { color: var(--accent-gold); }
.muted { color: var(--text-muted); }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header / Nav */
.aff-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 23, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand img {
    height: 38px;
    width: auto;
}
.brand-badge {
    background: linear-gradient(135deg, rgba(0, 229, 153, 0.2), rgba(0, 180, 216, 0.2));
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.balance-chip {
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 6px 16px 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.avatar-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent-blue));
    color: #000;
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all .2s;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #00c982);
    color: #06150e;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 229, 153, 0.4);
}
.btn-ghost {
    background: var(--bg-card-2);
    color: var(--text-soft);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--bg-card-3);
    color: #fff;
    border-color: var(--border-hover);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover {
    background: rgba(0, 229, 153, 0.1);
    color: var(--primary-hover);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
}

/* Nav Tabs */
.aff-nav-container {
    max-width: 1360px;
    margin: 20px auto 0;
    padding: 0 24px;
}
.aff-tabs {
    display: flex;
    gap: 8px;
    background: rgba(17, 23, 34, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: var(--radius);
    overflow-x: auto;
}
.aff-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-weight: 600;
    white-space: nowrap;
    transition: all .2s;
}
.aff-tab svg { width: 17px; height: 17px; fill: currentColor; }
.aff-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.aff-tab.is-active {
    background: linear-gradient(135deg, rgba(0, 229, 153, 0.15), rgba(0, 180, 216, 0.15));
    border: 1px solid var(--primary);
    color: var(--primary);
}

/* Container */
.aff-main {
    max-width: 1360px;
    margin: 24px auto 60px;
    padding: 0 24px;
}

/* Quick Ref Banner Box */
.ref-box {
    background: linear-gradient(135deg, rgba(0, 229, 153, 0.08) 0%, rgba(17, 23, 34, 0.95) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow);
}
.ref-info h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ref-info p {
    color: var(--text-muted);
    font-size: 13px;
}
.ref-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    min-width: 380px;
}
.ref-input-group input {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
    font-size: 13px;
}

/* KPI Grid */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all .2s;
}
.kpi-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.kpi-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}
.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.kpi-label {
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(0, 229, 153, 0.1);
    color: var(--primary);
}
.kpi-icon.is-blue { background: rgba(0, 180, 216, 0.1); color: var(--accent-blue); }
.kpi-icon.is-gold { background: rgba(255, 183, 3, 0.1); color: var(--accent-gold); }
.kpi-icon.is-cyan { background: rgba(6, 214, 160, 0.1); color: var(--accent-cyan); }
.kpi-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 6px;
}
.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.panel-head h3 {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-body {
    padding: 20px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table th {
    text-align: left;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.table-empty {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.badge.is-green { background: rgba(0, 229, 153, 0.15); color: var(--primary); }
.badge.is-blue { background: rgba(0, 180, 216, 0.15); color: var(--accent-blue); }
.badge.is-gold { background: rgba(255, 183, 3, 0.15); color: var(--accent-gold); }
.badge.is-code { background: var(--bg-card-3); color: var(--text-soft); font-family: monospace; border: 1px solid var(--border); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}
.pill.is-ok { background: rgba(0, 229, 153, 0.15); color: var(--primary); }
.pill.is-warn { background: rgba(255, 183, 3, 0.15); color: var(--accent-gold); }
.pill.is-bad { background: rgba(255, 77, 109, 0.15); color: var(--accent-red); }

/* SVG Chart Box */
.chart-box {
    padding: 16px 0 0;
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    padding: 0 10px;
    border-bottom: 1px solid var(--border);
}
.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}
.chart-bar-group {
    width: 100%;
    max-width: 28px;
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 100%;
}
.bar-clicks {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-blue), rgba(0, 180, 216, 0.3));
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: all .3s;
}
.bar-signups {
    flex: 1;
    background: linear-gradient(180deg, var(--primary), rgba(0, 229, 153, 0.3));
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: all .3s;
}
.chart-col:hover .bar-clicks { background: var(--accent-blue); filter: brightness(1.2); }
.chart-col:hover .bar-signups { background: var(--primary); filter: brightness(1.2); }
.chart-label {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
    font-size: 12px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Creative Banners Grid */
.creatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.creative-card {
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all .2s;
}
.creative-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.creative-img-wrap {
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.creative-img-wrap img {
    max-height: 100%;
    object-fit: contain;
}
.creative-body {
    padding: 16px;
}
.creative-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.creative-meta h4 {
    font-size: 14px;
    font-weight: 700;
}
.creative-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Form controls */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.fld {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.fld span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
}
.fld-box {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    padding: 0 12px;
    transition: all .2s;
}
.fld-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
.fld-box input, .fld-box select, .fld-box textarea {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    padding: 10px 0;
    color: #fff;
}
.fld-box select {
    cursor: pointer;
}
.fld-prefix {
    color: var(--primary);
    margin-right: 8px;
    font-weight: 700;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all .2s;
}
.modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow);
    transform: scale(0.95);
    transition: all .2s;
}
.modal-backdrop.is-open .modal-card {
    transform: scale(1);
}
.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-head h3 {
    font-size: 16px;
    font-weight: 700;
}
.modal-body {
    padding: 20px;
}
.modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(0, 0, 0, 0.15);
}

/* Toast Notification */
.aff-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card-3);
    border: 1px solid var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.aff-toast.is-show {
    transform: translateY(0);
    opacity: 1;
}

/* Landing Page Styles */
.landing-hero {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    position: relative;
}
.landing-grid {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-content h1 {
    font-size: 46px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.hero-highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    font-size: 17px;
    color: var(--text-soft);
    line-height: 1.6;
    margin-bottom: 28px;
}
.perk-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}
.perk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
}
.perk-item span.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 229, 153, 0.15);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 13px;
}

/* Auth Card on Landing */
.auth-card {
    background: rgba(17, 23, 34, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
}
.auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent-blue));
}
.auth-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.auth-nav-tab {
    flex: 1;
    text-align: center;
    padding: 16px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all .2s;
    background: rgba(0, 0, 0, 0.15);
}
.auth-nav-tab.is-active {
    color: var(--primary);
    background: transparent;
    border-bottom: 2px solid var(--primary);
}
.auth-content {
    padding: 28px;
}

/* Responsive */
@media (max-width: 992px) {
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .landing-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-content h1 { font-size: 36px; text-align: center; }
    .hero-desc { text-align: center; }
    .ref-box { flex-direction: column; align-items: stretch; }
    .ref-input-group { min-width: 100%; }
}
@media (max-width: 600px) {
    .kpi-row { grid-template-columns: 1fr; }
    .aff-topbar { padding: 0 16px; }
    .aff-main { padding: 0 16px; }
    .hero-content h1 { font-size: 30px; }
}
