/**
 * NextSole — Olympic Trade inspired theme
 * Edit :root variables to tweak colors site-wide.
 */

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

:root {
    --ot-white: #ffffff;
    --ot-page: #f4fbff;
    --ot-soft: #eefaff;
    --ot-ink: #14263a;
    --ot-muted: #6a7e91;
    --ot-blue: #158ee8;
    --ot-blue2: #27c2ff;
    --ot-green: #16c784;
    --ot-green2: #8ff0c5;
    --ot-line: rgba(21, 142, 232, 0.16);
    --ot-shadow: 0 22px 55px rgba(21, 142, 232, 0.15);

    /* Aliases used across existing RX classes */
    --rx-primary: var(--ot-blue);
    --rx-primary-dark: #0b79c6;
    --rx-secondary: var(--ot-green);
    --rx-accent: var(--ot-blue2);
    --rx-accent-2: var(--ot-green);

    --rx-bg: var(--ot-page);
    --rx-bg-soft: var(--ot-soft);
    --rx-surface: var(--ot-white);

    --rx-border: var(--ot-line);
    --rx-border-strong: rgba(21, 142, 232, 0.28);

    --rx-text: var(--ot-ink);
    --rx-text-muted: var(--ot-muted);
    --rx-text-light: #94a3b8;

    --rx-success: var(--ot-green);
    --rx-warning: #d97706;
    --rx-danger: #dc2626;

    --rx-gradient-brand: linear-gradient(135deg, var(--ot-blue) 0%, var(--ot-green) 100%);
    --rx-gradient-card: linear-gradient(135deg, #158ee8 0%, #16c784 100%);
    --rx-gradient-soft: linear-gradient(180deg, #ffffff 0%, var(--ot-page) 48%, #edfff7 100%);

    --rx-shadow-sm: 0 14px 34px rgba(21, 142, 232, 0.1);
    --rx-shadow-md: 0 18px 45px rgba(21, 142, 232, 0.13);
    --rx-shadow-lg: var(--ot-shadow);
    --rx-shadow-glow: 0 17px 38px rgba(22, 199, 132, 0.22);

    --rx-radius: 1.15rem;
    --rx-radius-lg: 1.35rem;
    --rx-font: 'Manrope', system-ui, -apple-system, sans-serif;
    --rx-display: 'Space Grotesk', sans-serif;
    --rx-mono: 'Manrope', monospace;
}

*, *::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);
    min-height: 100dvh;
    background:
        radial-gradient(circle at 10% 8%, rgba(39, 194, 255, 0.22), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(22, 199, 132, 0.17), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, var(--ot-page) 48%, #edfff7 100%);
}

/* Brand */
.rx-brand-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 1.25rem;
    object-fit: contain;
    background: linear-gradient(135deg, #ffffff, #e8fbff);
    border: 1px solid var(--ot-line);
    box-shadow: 0 12px 28px rgba(21, 142, 232, 0.16);
    padding: 0.35rem;
}

.rx-brand-logo--lg {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 1.75rem;
    padding: 0.5rem;
}

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

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

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

.rx-brand-tagline {
    font-size: 0.72rem;
    color: var(--rx-text-muted);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Cards */
.rx-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(21, 142, 232, 0.14);
    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.2);
    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.85rem 1.25rem;
    border-radius: 1.2rem;
    border: none;
    cursor: pointer;
    font-weight: 900;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.rx-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--ot-blue), var(--ot-green));
    box-shadow: 0 17px 38px rgba(22, 199, 132, 0.22);
}

.rx-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 42px rgba(22, 199, 132, 0.3);
}

.rx-btn-outline {
    background: var(--rx-surface);
    color: #0874af;
    border: 1px solid var(--ot-line);
    box-shadow: 0 15px 34px rgba(21, 142, 232, 0.14);
}

.rx-btn-outline:hover {
    transform: translateY(-3px);
}

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

.rx-auth-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.34;
    background-image:
        linear-gradient(rgba(21, 142, 232, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(21, 142, 232, 0.07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 82%);
}

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

.rx-auth-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.7;
}

.rx-auth-blob--1 {
    width: 220px;
    height: 220px;
    top: -90px;
    left: -85px;
    background: rgba(39, 194, 255, 0.22);
}

.rx-auth-blob--2 {
    width: 260px;
    height: 260px;
    right: -110px;
    bottom: -120px;
    background: rgba(22, 199, 132, 0.18);
}

.rx-auth-top {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1.75rem;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 42px rgba(21, 142, 232, 0.12);
    position: relative;
    z-index: 2;
}

.rx-auth-top-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.rx-auth-top-brand strong {
    font-family: var(--rx-display);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(90deg, #0b79c6, #16c784);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rx-auth-top-brand span {
    display: block;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #56879f;
}

.rx-auth-heading h1 {
    font-family: var(--rx-display);
    font-size: clamp(2rem, 8vw, 2.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, #0b7fc6, #16c784);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.35rem;
}

.rx-auth-heading p {
    margin: 0;
    color: var(--ot-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.rx-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(21, 142, 232, 0.2);
    border-radius: 1rem;
    font-size: 0.92rem;
    background: #f8fcff;
    color: var(--rx-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rx-input:focus-within,
.rx-input:focus {
    outline: none;
    border-color: var(--ot-blue);
    box-shadow: 0 0 0 4px rgba(21, 142, 232, 0.12);
}

.rx-form-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ot-muted);
    margin-bottom: 0.4rem;
}

.rx-auth-error {
    color: var(--rx-danger);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.hidden { display: none !important; }

.rx-auth-error.hidden { display: none; }

.rx-auth-link {
    color: var(--ot-blue);
    font-weight: 800;
    text-decoration: none;
}

.rx-auth-link:hover { color: #0b79c6; }

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

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

.rx-user-link {
    color: var(--ot-blue);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed rgba(21, 142, 232, 0.4);
}

.rx-user-link:hover { color: #0b79c6; }

/* Page shell */
.rx-page {
    max-width: 32rem;
    margin: 0 auto;
    padding: 5.5rem 1rem 7.5rem;
}

.rx-page-title {
    font-family: var(--rx-display);
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.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 */
.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(20, 38, 58, 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: 1px solid var(--ot-line);
    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-family: var(--rx-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--rx-text);
    margin-top: 0.5rem;
}

.rx-celebrate-amount {
    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); }
}

/* ── PWA install banner (global — must live in theme.css) ── */
.ot-pwa-banner {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 10050;
    transform: translateY(calc(100% + 2rem));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.35s ease;
}

.ot-pwa-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ot-pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    border-radius: 1.1rem;
    background: #ffffff;
    border: 1px solid rgba(21, 142, 232, 0.18);
    box-shadow: 0 16px 40px rgba(21, 142, 232, 0.2), 0 4px 12px rgba(20, 38, 58, 0.08);
}

.ot-pwa-banner-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.8rem;
    background: linear-gradient(135deg, #158ee8, #16c784);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.ot-pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.ot-pwa-banner-text strong {
    display: block;
    font-size: 0.84rem;
    font-weight: 800;
    color: #14263a;
}

.ot-pwa-banner-text span {
    display: block;
    font-size: 0.68rem;
    color: #6a7e91;
    font-weight: 600;
    margin-top: 0.1rem;
}

.ot-pwa-banner-btn {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 0.95rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #158ee8, #16c784);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(21, 142, 232, 0.3);
}

.ot-pwa-banner-dismiss {
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 992px) {
    .ot-pwa-banner {
        bottom: 1.25rem;
        max-width: 24rem;
        left: auto;
        right: 1.25rem;
    }
}
