:root {
    --bg-dark: #050511;
    --bg-card: rgba(10, 10, 25, 0.6);
    --bg-card-hover: rgba(10, 10, 25, 0.8);
    --primary: #4d9eff;
    --primary-glow: rgba(0, 255, 133, 0.4);
    --secondary: #4f46e5;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --gradient-brand: linear-gradient(135deg, #4d9eff 0%, #00f7ff 100%);
    --font-heading: "Outfit", sans-serif;
    --font-body: "Inter", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Matrix Rain Canvas Background */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.12;
}

/* Ensure all content is above the matrix canvas */
.referral-banner,
.header,
.hero,
.lead-section,
.stats-section,
.testimonials-section,
.features-section,
.steps-section,
footer,
.floating-whatsapp {
    position: relative;
    z-index: 1;
}

/* Background Effects */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%,
            rgba(79, 70, 229, 0.1) 0%,
            transparent 40%),
        radial-gradient(circle at 90% 80%,
            rgba(0, 255, 133, 0.05) 0%,
            transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 40px;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 8px 0;
    background: rgba(5, 5, 17, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 160px 0 100px;
    position: relative;
    text-align: center;
}

/* Premium Glow Effect behind text */
.hero::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(0, 255, 133, 0.15), transparent 70%);
    filter: blur(60px);
    z-index: -1;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(0, 255, 133, 0.1);
    border: 1px solid rgba(0, 255, 133, 0.2);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 24px;
    background: linear-gradient(to right, #ffffff, #e0e7ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-title span {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 40px;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.hero-link {
    margin-top: -40px;
    margin-bottom: 40px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.hero-link a {
    color: var(--primary);
    font-weight: 600;
}

.lead-section {
    padding: 90px 0;
}

.lead-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 255, 133, 0.2);
    position: relative;
    overflow: hidden;
}

.lead-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-brand);
}

.lead-header {
    text-align: center;
    margin-bottom: 30px;
}

.lead-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.lead-header p {
    color: var(--text-muted);
}

.lead-form {
    display: grid;
    gap: 18px;
}

.lead-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lead-field input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    font-size: 1rem;
}

.lead-field.error input {
    border-color: rgba(239, 68, 68, 0.6);
}

.lead-error {
    display: none;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #f87171;
}

.lead-field.error .lead-error {
    display: block;
}

.lead-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.lead-consent a {
    color: var(--primary);
    font-weight: 600;
}

.lead-submit {
    width: 100%;
    justify-content: center;
}

.lead-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.lead-success {
    text-align: center;
}

.lead-success-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 255, 133, 0.3);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 255, 133, 0.5);
    background: #00ff95;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Video Wrapper */
.video-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container video {
    width: 100%;
    display: block;
}

/* Stats Section (Glass Cards) */
.stats-section {
    padding: 80px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: var(--glass-border);
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 255, 133, 0.3);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1;
    text-shadow: 0 0 20px rgba(0, 255, 133, 0.3);
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Features/What Is Section */
.features-section {
    padding: 100px 0;
    background: rgba(255, 255, 255, 0.01);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Testimonials */
.testimonials-section {
    padding: 90px 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.testimonial-card {
    background: var(--bg-card);
    border: var(--glass-border);
    padding: 28px;
    border-radius: 20px;
}

.testimonial-quote {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 16px;
}

.testimonial-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.testimonials-link {
    text-align: center;
    margin-top: 24px;
}

.testimonials-link a {
    color: var(--primary);
    font-weight: 600;
}

.feature-card {
    background: var(--bg-card);
    border: var(--glass-border);
    padding: 40px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: rgba(79, 70, 229, 0.5);
    background: rgba(79, 70, 229, 0.05);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    display: block;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Steps Section */
.steps-section {
    padding: 100px 0;
}

.step-card {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.02), transparent);
    padding: 40px;
    border-radius: 24px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    align-items: flex-start;
    position: relative;
    /* Para el conector */
    z-index: 2;
}

/* Conector de Pasos */
@media (min-width: 769px) {
    .step-card:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 100px;
        left: 80px;
        /* Centrado bajo el número */
        width: 2px;
        height: 60px;
        /* Longitud de la línea hacia el siguiente */
        background: linear-gradient(to bottom, var(--primary), transparent);
        opacity: 0.3;
        z-index: 1;
    }
}

.step-number {
    font-size: 4rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    line-height: 0.8;
}

.step-content h3 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.step-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.pill-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-main);
}

/* Footer & Legal */
footer {
    padding: 60px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

.referral-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #4f46e5, #4d9eff);
    color: #000;
    font-weight: 700;
    padding: 12px;
    text-align: center;
    z-index: 2000;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Floating WhatsApp Button */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse-green 2s infinite;
}

.floating-whatsapp:hover {
    transform: scale(1.1);
    background-color: #20ba59;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- ANIMACIONES & MEJORAS VISUALES --- */

/* 1. Botón "Shine" */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    10% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* 2. Glow Cards (Mejorado) */
.feature-card,
.stat-card,
.step-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover,
.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 255, 133, 0.15), 0 0 15px rgba(0, 255, 133, 0.1) inset;
    border-color: var(--primary);
}

/* 3. Hero Typography & Matrix Text */
.hero-title span {
    background: linear-gradient(to right, #4d9eff, #00f7ff, #4d9eff);
    background-size: 200% auto;
    animation: gradientShift 5s linear infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

h2 {
    position: relative;
    display: inline-block;
}

h2:contains("- SAL DE MATRIX -"),
/* Fallback si no hay clase específica */
section.hero h2 {
    font-size: 1.5rem;
    letter-spacing: 4px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
    animation: textFlicker 4s infinite alternate;
}

@keyframes textFlicker {

    0%,
    18%,
    22%,
    25%,
    53%,
    57%,
    100% {
        opacity: 1;
        text-shadow: 0 0 10px var(--primary-glow);
    }

    20%,
    24%,
    55% {
        opacity: 0.8;
        text-shadow: none;
    }
}

/* 4. Scroll Reveal Classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .step-card {
        flex-direction: column;
        gap: 10px;
        padding: 30px 20px;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .testimonial-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .lead-card {
        padding: 28px 20px;
    }

    .hero-link {
        margin-top: -30px;
    }
}
