:root {
    --color-primary: #1e90ff; 
    --color-primary-dark: #1c86ee;
    --color-secondary: #00ff7f;
    --color-secondary-dark: #00ee76;
    --color-accent: #ff4500;
    --color-accent-dark: #ff6347;
    --color-text: #333;
    --color-text-light: #666;
    --color-bg-light: #f4f7f6;
    --color-white: #fff;
    --color-dark-bg: #1f2937;
    --font-family: 'Arial', sans-serif;
    --container-width: 1200px;
    --border-radius-sm: 8px;
    --border-radius-lg: 50px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-text);
    overflow-x: hidden;
    background-color: var(--color-white);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    background: rgba(20, 30, 40, 0.8);
    backdrop-filter: blur(10px);
    color: var(--color-white);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 45px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: bold;
    padding: 0.5rem;
}

.nav-links a:hover {
    color: var(--color-secondary);
}

.cta-button {
    background: linear-gradient(45deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-white);
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.4);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* Clases de visibilidad por defecto */
.mobile-only {
    display: none; /* Oculto en escritorio por defecto */
}

.desktop-only {
    display: inline-block; /* Visible en escritorio por defecto */
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    text-align: center;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    object-fit: cover;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 30, 0.7);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: 0 2rem;
    z-index: 1;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    text-align: center;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease-out 0.2s both;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.4s both;
}

/* Buttons */
.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(45deg, var(--color-secondary), var(--color-secondary-dark));
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 255, 127, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 255, 127, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-secondary:hover {
    background: var(--color-white);
    color: var(--color-primary);
    transform: translateY(-3px);
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 4rem;
    color: var(--color-text);
}

/* Platform Showcase Section */
.platform-showcase {
    background: var(--color-white);
}

.platform-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.platform-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.platform-text .section-title {
    text-align: left;
    margin-bottom: 2rem;
}

.platform-text p {
    margin-bottom: 2rem;
    color: var(--color-text-light);
}

.platform-text ul {
    list-style: none;
    margin-bottom: 2.5rem;
}

.platform-text li {
    margin-bottom: 1rem;
    color: var(--color-text);
    font-weight: 500;
}

/* Features Section */
.features {
    background: var(--color-bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--border-radius-sm);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--color-text-light);
}

/* Testimonials Section */
.testimonials {
    background: var(--color-dark-bg);
    color: var(--color-white);
}

.testimonials .section-title {
    color: var(--color-white);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.testimonial-author {
    font-weight: bold;
    color: var(--color-secondary);
    text-align: right;
}

/* Brokers Section */
.brokers-section {
    background-color: var(--color-white);
    padding: 80px 0;
}

.brokers-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4rem;
    margin-top: 2rem;
}

.broker-logo img {
    height: 60px;
    max-width: 200px;
    opacity: 0.8;
    transition: opacity 0.3s, transform 0.3s, filter 0.3s;
    filter: grayscale(80%);
}

.broker-logo:hover img {
    opacity: 1;
    transform: scale(1.1);
    filter: grayscale(0%);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    color: var(--color-white);
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    background: var(--color-dark-bg);
    color: var(--color-white);
    padding: 60px 0 30px;
    text-align: center;
}

.footer-form-container {
    max-width: 500px;
    margin: 0 auto 4rem;
}

.footer-form-container h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.footer-form-container p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.contact-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.contact-form input {
    flex-grow: 1;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    color: var(--color-white);
    font-size: 1rem;
}

.contact-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#form-feedback {
    margin-top: 1rem;
    font-weight: bold;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.footer-links a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--color-secondary);
}

/* Animations */
/* MEJORA: Lógica de animación movida a CSS */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-secondary); }
}

/* Responsive Design */
@media (max-width: 900px) {
    .platform-grid {
        grid-template-columns: 1fr;
    }
    .platform-text .section-title {
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* Ocultar el botón de escritorio y mostrar el de móvil */
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: block; /* O inline-block si prefiere */
    }

    .nav-links .nav-cta {
        /* Estilos para el botón DENTRO del menú móvil */
        width: 80%;
        text-align: center;
        padding: 1rem;
        margin-top: 1.5rem;
    }

    .nav-toggle {
        display: block;
    }
    .nav-links {
        position: fixed;
        top: 0; right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--color-dark-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }
    .nav-links.active {
        right: 0;
    }
    .hero-buttons, .contact-form {
        flex-direction: column;
        align-items: center;
    }
    .hero {
        height: auto;
        padding: 150px 0 100px 0;
    }
    .hero h1 { min-height: 80px; }
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background: var(--color-dark-bg);
    padding: 2rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    position: relative;
    color: var(--color-white);
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.popup-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.solicitar-acceso {
    text-align: center;
    margin-top: 1rem;
}

.solicitar-acceso a {
    color: var(--color-secondary);
    text-decoration: none;
}

@media (min-width: 769px) {
    #login-button {
        display: none;
    }
}