/* =========================================
   1. VARIABLES & CONFIGURACIÓN GLOBAL (DARK PREDOMINA)
   ========================================= */
:root {
    /* --- MODO OSCURO (Dark - Por defecto) --- */
    --primary-color: #E50914; /* Rojo Jape Pro */
    --primary-hover: #b80710;
    --primary-glow: rgba(229, 9, 20, 0.4);
    
    --bg-main: #121212;
    --bg-secondary: #1e1e1e;
    --bg-color: #0a0a0a; /* Navbar/Modales base */
    --bg-overlay: rgba(0, 0, 0, 0.8);
    
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: rgba(255, 255, 255, 0.5);

    --card-bg: #242424;
    --border-color: #333333;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);

    /* Inputs y Modales */
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --modal-bg: #1a1a1a;
    
    --font-main: 'Inter', sans-serif;
}

[data-theme="light"] {
    /* --- MODO CLARO (Light) --- */
    --bg-main: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-color: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.6);
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #888888;

    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    --input-bg: rgba(240, 240, 240, 0.8);
    --input-border: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* BODY LIMPIO - SIN IMÁGENES DE FONDO ANTIGUAS */
body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    background-image: none; /* Forzamos a quitar cualquier imagen antigua */
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* =========================================
   2. NAVBAR PRO
   ========================================= */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 15px 0; background-color: var(--bg-color); 
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.navbar.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.5); padding: 12px 0; }

.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }

.nav-menu { display: flex; gap: 30px; align-items: center; }
.nav-link { color: var(--text-secondary); font-weight: 600; font-size: 0.95rem; transition: color 0.3s; }
.nav-link:hover { color: var(--primary-color); }

.nav-actions { display: flex; align-items: center; gap: 15px; }

.theme-btn-nav { background: none; border: none; cursor: pointer; color: var(--text-primary); display: flex; align-items: center; transition: 0.3s; }
.theme-btn-nav:hover { color: var(--primary-color); }

.btn-nav-glow {
    background: var(--primary-color); color: white; border: none;
    padding: 8px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.3s;
}
.btn-nav-glow:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 15px var(--primary-glow); }

/* =========================================
   3. ESTRUCTURA Y SECCIONES PRO
   ========================================= */
.section-padding { padding: 8rem 10% 5rem; }

.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 3rem; color: var(--text-primary); font-weight: 700; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

.btn { padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; border: none; display: inline-block; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn-outline { background-color: transparent; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background-color: var(--primary-color); color: white; }

/* HERO SECTION */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 4rem; background-color: var(--bg-secondary); min-height: 100vh; }
.hero-content { flex: 1; }
.hero-content h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 1.5rem; font-weight: 800; }
.hero-content h1 span { color: var(--primary-color); }
.hero-content p { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 2rem; }

.app-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.store-btn { display: flex; align-items: center; gap: 0.8rem; background-color: #000; color: white; padding: 0.6rem 1.2rem; border-radius: 8px; transition: transform 0.3s; border: 1px solid #333; }
.store-btn:hover { transform: translateY(-3px); border-color: var(--primary-color); }
.store-btn i { font-size: 1.8rem; }
.store-text { display: flex; flex-direction: column; line-height: 1; text-align: left; }
.store-text small { font-size: 0.7rem; color: #ccc;}
.store-text strong { font-size: 1.1rem; }

[data-theme="light"] .store-btn { background-color: var(--text-primary); color: var(--bg-main); }

/* AJUSTE IMAGEN 3D HERO */
.hero-image { flex: 1; display: flex; justify-content: center; perspective: 1000px; }
.mockup-3d {
    width: 100%;
    max-width: 430px;
    height: auto;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
    will-change: transform;
}

/* GRIDS (Pasos y Servicios) */
.steps-grid, .services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; max-width: 1200px; margin: 0 auto;}
.step-card, .service-card { background-color: var(--card-bg); padding: 2rem; border-radius: 12px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border-color); transition: all 0.3s; }

/* Efecto Glow en Hover */
.step-card:hover, .service-card:hover { transform: translateY(-8px); border-color: var(--primary-color); box-shadow: 0 10px 30px rgba(229, 9, 20, 0.15); }
.service-card:hover i, .step-card:hover .icon-wrapper { transform: scale(1.1); transition: transform 0.3s ease; }

.icon-wrapper { width: 60px; height: 60px; background-color: var(--bg-secondary); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; font-size: 1.5rem; color: var(--primary-color); transition: 0.3s;}
.service-card i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1.5rem; transition: 0.3s;}
.link-red { color: var(--primary-color); font-weight: 600; display: inline-block; margin-top: 1rem; }

/* EMPRESAS */
.business { display: flex; align-items: center; gap: 4rem; background-color: var(--bg-secondary); }
.business-content { flex: 1; }
.business-image { flex: 1; display: flex; justify-content: center; }
.business-benefits { list-style: none; margin: 2rem 0; }
.business-benefits li { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.8rem; color: var(--text-secondary); font-weight: 500;}
.business-benefits i { color: var(--primary-color); font-size: 1.2rem;}

.mockup-placeholder.dashboard { width: 100%; max-width: 500px; height: 350px; background-color: var(--card-bg); border: 2px solid var(--border-color); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); box-shadow: var(--shadow); }
.mockup-placeholder.dashboard i { font-size: 4rem; color: var(--primary-color); margin-bottom: 1rem;}

/* FOOTER */
.footer-premium { background: #080808; border-top: 1px solid #222; padding: 60px 0 30px; color: #888; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-col { display: flex; flex-direction: column; }
.footer-heading { color: white; margin-bottom: 20px; font-weight: 600; font-size: 1rem; }
.footer-list a { display: block; color: #888; margin-bottom: 12px; transition: 0.3s; font-size: 0.9rem; }
.footer-list a:hover { color: var(--primary-color); padding-left: 5px; }

/* =========================================
   4. MODALES DE AUTENTICACIÓN Y FORMULARIOS
   ========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-overlay); backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; padding: 20px; }
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-glass { width: 100%; max-width: 440px; background: var(--modal-bg); border: 1px solid var(--input-border); border-radius: 24px; padding: 40px 35px; position: relative; box-shadow: var(--shadow); transform: scale(0.95) translateY(20px); transition: transform 0.4s; max-height: 90vh; overflow-y: auto; }
.modal-overlay.active .modal-glass { transform: scale(1) translateY(0); }

.modal-close { position: absolute; top: 15px; right: 20px; background: none; border: none; color: var(--text-secondary); font-size: 2rem; cursor: pointer; transition: 0.2s; }
.modal-close:hover { color: var(--primary-color); }
.logo-area { text-align: center; margin-bottom: 20px; }
.logo-area img { width: 60px; height: auto; }
.modal-glass h2 { text-align: center; color: var(--text-primary); margin-bottom: 5px; font-weight: 700;}
.modal-glass .subtitle { text-align: center; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 25px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; color: var(--text-primary); font-size: 0.85rem; margin-bottom: 6px; font-weight: 600; }
.form-input { width: 100%; background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text-primary); padding: 12px 14px; border-radius: 10px; font-size: 1rem; transition: 0.3s; }
.form-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }

.btn-submit { width: 100%; background: var(--primary-color); color: white; padding: 14px; border: none; border-radius: 10px; font-weight: 600; cursor: pointer; margin-top: 10px; font-size: 1rem; transition: 0.3s; }
.btn-submit:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 15px var(--primary-glow); }

.error-box { background: rgba(229, 9, 20, 0.1); color: #ff6b6b; padding: 10px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 15px; border: 1px solid rgba(229, 9, 20, 0.2); display: none; }
.footer-text { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--text-secondary); }
.footer-text a { color: var(--primary-color); font-weight: 600; }

.social-login-container { margin-top: 25px; }
.divider { display: flex; align-items: center; text-align: center; margin: 20px 0; color: var(--text-muted); font-size: 0.8rem; }
.divider span { padding: 0 10px; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--input-border); }
.social-buttons { display: flex; gap: 12px; }
.btn-social { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; background-color: var(--modal-bg); border: 1px solid var(--input-border); color: var(--text-primary); }
.btn-social:hover { background-color: var(--input-bg); border-color: var(--text-secondary); }

/* =========================================
   5. LOADER GLOBAL
   ========================================= */
.page-loader { position: fixed; inset: 0; background: var(--bg-main); z-index: 99999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.6s ease, visibility 0.6s ease; }
.page-loader.fade-out { opacity: 0; visibility: hidden; }
.loader-content { position: relative; width: 100px; height: 100px; display: flex; justify-content: center; align-items: center; margin-bottom: 25px; }
.loader-logo { width: 45px; height: auto; z-index: 2; animation: logo-pulse 2s ease-in-out infinite; }
.loader-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--primary-color); border-right-color: rgba(229, 9, 20, 0.3); animation: spin-orbit 1.2s linear infinite; }
.loader-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid transparent; border-bottom-color: var(--text-secondary); opacity: 0.5; animation: spin-orbit 2s linear infinite reverse; }
.loader-text { font-family: var(--font-main); font-size: 0.9rem; font-weight: 600; letter-spacing: 2px; color: var(--text-primary); text-transform: uppercase; animation: text-fade 1.5s ease-in-out infinite; }
@keyframes spin-orbit { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes logo-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.95); opacity: 0.8; } }
@keyframes text-fade { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* =========================================
   6. ANIMACIONES ON SCROLL
   ========================================= */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* =========================================
   ESTILOS PARA LOS ICONOS DE IMAGEN DE SERVICIOS
   ========================================= */
.service-icon-img {
    width: 75px; 
    height: 75px;
    object-fit: contain; 
    margin: 0 auto 1.5rem auto; 
    display: block;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3)); 
}

.service-card:hover .service-icon-img {
    transform: scale(1.15); 
}

/* =========================================
   7. RESPONSIVE MÓVIL (Con Fix de Botones)
   ========================================= */
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 5px; z-index: 1100; }
@media (max-width: 992px) {
    .section-padding { padding: 6rem 5% 4rem; }
    .hero, .business { flex-direction: column; text-align: center; }
    .hero-content h1 { font-size: 2.8rem; }
    .app-buttons { justify-content: center; }
    .business-benefits li { justify-content: center; }
    .section-title.text-left { text-align: center; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-menu { flex-direction: column; position: fixed; top: 60px; left: 0; width: 100%; background-color: var(--bg-color); border-bottom: 1px solid var(--border-color); padding: 30px 20px; gap: 25px; transform: translateY(-150%); opacity: 0; transition: all 0.3s; z-index: 900; pointer-events: none; }
    .nav-menu.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-link { display: block; width: 100%; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-col { align-items: center; }
    .hero-content h1 { font-size: 2.2rem; }
    
    /* --- FIX: Botones de tiendas asimétricos --- */
    .app-buttons {
        flex-direction: column; 
        align-items: center; 
        width: 100%;
        gap: 15px; 
    }

    .store-btn {
        width: 100%; 
        max-width: 280px; 
        justify-content: center; 
    }

    .store-text {
        min-width: 120px; 
    }
}

/* =========================================
   NUEVO ESTILO PROFESIONAL: RED DE ALIANZA (SIN CUADRADO)
   ========================================= */
.business-photo-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible; /* Importante para que los elementos flotantes salgan */
    padding: 0; /* Eliminamos el padding para integración total */
}

.business-alliance-network {
    width: 100%;
    max-width: 650px; /* Un tamaño más impactante */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(229, 9, 20, 0.15)); /* Solo un glow sutil */
    transition: transform 0.6s ease;
    will-change: transform;
}

/* Efecto al pasar el mouse */
.business-photo-wrapper:hover .business-alliance-network {
    transform: scale(1.02) translateY(-5px); /* Un movimiento muy sutil */
}

/* Ajuste móvil proporcional */
@media (max-width: 992px) {
    .business-alliance-network { max-width: 450px; }
    
}

/* =========================================
   ESTILOS PARA VIDEOS TUTORIALES (REELS VERTICALES)
   ========================================= */

.business-image {
    display: flex;
    justify-content: center; /* Centra el video en su mitad de la pantalla */
    width: 100%;
}

.business-video-wrapper {
    width: 100%;
    max-width: 320px; /* Simulamos el ancho de un celular premium */
    position: relative;
    border-radius: 16px;
    overflow: hidden; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    background-color: #000;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    will-change: transform;
}

/* Efecto de levitación con resplandor al pasar el mouse */
.business-video-wrapper:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(229, 9, 20, 0.2); 
    border-color: rgba(229, 9, 20, 0.5);
}

.tutorial-video {
    width: 100%;
    height: auto;
    display: block; 
    aspect-ratio: 9 / 16; /* Forzamos la proporción vertical (Reel/TikTok) */
    object-fit: contain; /* ESTA ES LA CLAVE: Evita que el video se estire o le haga zoom */
    background-color: #000;
}

/* Ajustes del reproductor nativo webkit para que se vea limpio */
video::-webkit-media-controls-enclosure {
    border-radius: 0 0 16px 16px;
}