/**
 * RX Global Theme — change colors here, whole user site updates.
 * Upload: user/css/theme.css
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@600;700;800&display=swap');

:root {
    /* === MAIN COLORS (edit these) === */
    --rx-primary: #4f46e5;
    --rx-primary-dark: #4338ca;
    --rx-secondary: #7c3aed;
    --rx-accent: #0891b2;
    --rx-accent-2: #ec4899;

    --rx-bg: #f0f4ff;
    --rx-bg-soft: #f8fafc;
    --rx-surface: #ffffff;

    --rx-border: #e8ecf4;
    --rx-border-strong: #c7d2fe;

    --rx-text: #0f172a;
    --rx-text-muted: #64748b;
    --rx-text-light: #94a3b8;

    --rx-success: #059669;
    --rx-warning: #d97706;
    --rx-danger: #dc2626;

    /* Gradients */
    --rx-gradient-brand: linear-gradient(135deg, var(--rx-primary) 0%, var(--rx-secondary) 55%, var(--rx-accent-2) 100%);
    --rx-gradient-card: linear-gradient(145deg, #1d4ed8 0%, #6d28d9 45%, #db2777 100%);
    --rx-gradient-soft: linear-gradient(180deg, var(--rx-bg) 0%, var(--rx-bg-soft) 50%, #f1f5f9 100%);

    /* Shadows */
    --rx-shadow-sm: 0 2px 8px rgba(79, 70, 229, 0.06);
    --rx-shadow-md: 0 8px 24px rgba(79, 70, 229, 0.1);
    --rx-shadow-lg: 0 16px 40px rgba(79, 70, 229, 0.14);
    --rx-shadow-glow: 0 12px 32px rgba(79, 70, 229, 0.28);

    /* Layout */
    --rx-radius: 1.15rem;
    --rx-radius-lg: 1.35rem;
    --rx-font: 'Inter', system-ui, -apple-system, sans-serif;
    --rx-mono: 'JetBrains Mono', monospace;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body.rx-body,
body.rx-auth-body,
body.rx-landing {
    font-family: var(--rx-font);
    color: var(--rx-text);
    background: var(--rx-gradient-soft);
    min-height: 100dvh;
}

/* Brand logo block */
.rx-brand-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    object-fit: contain;
    background: var(--rx-surface);
    border: 1px solid var(--rx-border);
    box-shadow: var(--rx-shadow-sm);
}

.rx-brand-logo--lg {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.15rem;
}

.rx-brand-fallback {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: var(--rx-gradient-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: var(--rx-shadow-glow);
}

.rx-brand-fallback--lg {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.15rem;
    font-size: 1.1rem;
}

.rx-brand-name {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--rx-text);
}

.rx-brand-tagline {
    font-size: 0.72rem;
    color: var(--rx-text-muted);
    font-weight: 600;
}

/* Cards */
.rx-card {
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius-lg);
    box-shadow: var(--rx-shadow-md);
}

.rx-card--gradient {
    background: var(--rx-gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: var(--rx-shadow-glow);
}

/* Buttons */
.rx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.85rem;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.rx-btn-primary {
    background: var(--rx-gradient-brand);
    color: #fff;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35);
}

.rx-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.42);
}

.rx-btn-outline {
    background: var(--rx-surface);
    color: var(--rx-primary);
    border: 1.5px solid var(--rx-border-strong);
}

/* Auth pages */
.rx-auth-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.rx-auth-card {
    width: 100%;
    max-width: 26rem;
    padding: 2rem 1.75rem;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 1.5rem;
    box-shadow: var(--rx-shadow-lg);
    position: relative;
    z-index: 2;
}

.rx-auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    pointer-events: none;
}

.rx-auth-blob--1 {
    width: 320px;
    height: 320px;
    background: rgba(79, 70, 229, 0.25);
    top: -80px;
    left: -60px;
}

.rx-auth-blob--2 {
    width: 280px;
    height: 280px;
    background: rgba(124, 58, 237, 0.2);
    bottom: -80px;
    right: -60px;
}

.rx-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--rx-border);
    border-radius: 0.85rem;
    font-size: 0.92rem;
    background: var(--rx-surface);
    color: var(--rx-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rx-input:focus {
    outline: none;
    border-color: var(--rx-primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* Upline badge */
.rx-upline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid var(--rx-border-strong);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--rx-primary-dark);
}

.rx-upline-badge i { font-size: 0.7rem; }

/* Admin user link */
.rx-user-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
    transition: color 0.15s;
}

.rx-user-link:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.rx-upline-text {
    font-size: 0.75rem;
    color: var(--rx-text-muted);
    margin-top: 0.15rem;
}

.rx-upline-text strong {
    color: var(--rx-primary);
}

/* Landing */
.rx-landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rx-border);
    box-shadow: var(--rx-shadow-sm);
}

.rx-landing-hero {
    padding: 7rem 0 4rem;
    background: var(--rx-gradient-soft);
}

.rx-landing-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: var(--rx-gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Shop */
.rx-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.85rem;
}

.rx-plan-card {
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius);
    padding: 1rem;
    box-shadow: var(--rx-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.rx-plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--rx-border-strong);
    box-shadow: var(--rx-shadow-md);
}

/* Page shell — spacing from layout.css (.rx-main-content) */
.rx-page {
    max-width: 32rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.rx-page-title {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.35rem;
}

.rx-page-sub {
    text-align: center;
    color: var(--rx-text-muted);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.rx-accent-line {
    width: 4.5rem;
    height: 4px;
    margin: 0.65rem auto 1rem;
    border-radius: 999px;
    background: var(--rx-gradient-brand);
}

@media (min-width: 992px) {
    .rx-page { padding-bottom: 2.5rem; }
}

/* Celebration overlay (check-in, salary claim) */
.rx-celebrate-root {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.rx-celebrate-root.is-active { opacity: 1; }
.rx-celebrate-root.is-out { opacity: 0; }

.rx-celebrate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}

.rx-celebrate-card {
    position: relative;
    background: var(--rx-surface);
    border-radius: 1.5rem;
    padding: 2rem 1.75rem;
    text-align: center;
    max-width: 20rem;
    width: 90%;
    box-shadow: var(--rx-shadow-lg);
    border: 1.5px solid var(--rx-border-strong);
    transform: scale(0.85) translateY(20px);
    animation: rxPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    overflow: hidden;
}

.rx-celebrate-root.is-out .rx-celebrate-card { animation: rxPopOut 0.4s ease forwards; }

.rx-celebrate-emoji { font-size: 3rem; line-height: 1; animation: rxBounce 0.6s ease 0.15s both; }

.rx-celebrate-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--rx-text);
    margin-top: 0.5rem;
}

.rx-celebrate-amount {
    font-family: var(--rx-mono);
    font-size: 1.75rem;
    font-weight: 900;
    background: var(--rx-gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.35rem 0;
}

.rx-celebrate-sub {
    font-size: 0.88rem;
    color: var(--rx-text-muted);
    font-weight: 600;
}

.rx-celebrate-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.rx-confetti-piece {
    position: absolute;
    top: -8px;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    opacity: 0;
    animation: rxConfettiFall 1.8s ease-out forwards;
}

@keyframes rxPopIn { to { transform: scale(1) translateY(0); } }
@keyframes rxPopOut { to { transform: scale(0.9) translateY(10px); opacity: 0; } }
@keyframes rxBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes rxConfettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(220px) rotate(720deg); }
}
