/* VARIABLES */
:root {
    --bg: #ffffff;
    --text: #111;
    --card: #ffffff;
    --primary: #B20738; 
    --footer-bg: #f3f3f3;
}

.dark-mode {
    --bg: #0d1117;
    --text: #e6edf3;
    --card: #161b22;
    --footer-bg: #0d1117;
    --primary: #B20738;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 1.3rem; 
    overflow-x: hidden;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 18px 40px;
    background: var(--card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1000; 
    box-sizing: border-box; 
    overflow: hidden; 
}

.logo { font-size: 1.5rem; font-weight: 700; }

nav {
    display: flex;
    align-items: center;
    max-width: 600px; 
    width: 100%;
    justify-content: center;
}

nav a {
    margin-right: 25px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: unset; 
}

.actions { display: flex; gap: 2px; margin-left: 20px; align-items: center; }

/* BUTTONS */
.btn-primary {
    padding: 13px 25px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease;
    font-size: unset;
    border: none; /* Asegura que no tenga borde por defecto */
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(178, 7, 56, 0.4); 
}

.btn-outline {
    padding: 13px 25px;
    border: 2px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: .2s ease;
    font-size: unset;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* HERO */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    background: var(--bg);
    position: relative; 
    overflow: hidden; 
    min-height: 500px; 
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(178, 7, 56, 0.1) 0%, transparent 60%); 
    z-index: 0; 
    animation: hero-bg-glow 15s infinite ease-in-out; 
}

@keyframes hero-bg-glow {
    0% { transform: scale(1.0) translate(0%, 0%); opacity: 0.8; }
    25% { transform: scale(1.1) translate(10%, 10%); opacity: 0.9; }
    50% { transform: scale(1.0) translate(0%, 0%); opacity: 0.8; }
    75% { transform: scale(0.9) translate(-10%, -10%); opacity: 0.7; }
    100% { transform: scale(1.0) translate(0%, 0%); opacity: 0.8; }
}

.hero-visuals {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; z-index: 0; pointer-events: none; 
}

.hero-visuals .element { position: relative; opacity: 0.2; background-repeat: no-repeat; background-size: contain; }
.hero-visuals .element.hexa-lg { width: 150px; height: 150px; background: rgba(178, 7, 56, 0.1); clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
.hero-visuals .element.hexa-sm { width: 80px; height: 80px; background: rgba(178, 7, 56, 0.08); clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
.hero-visuals .element.cloud { width: 120px; height: auto; background-image: url('https://via.placeholder.com/120x60'); }
.hero-visuals .element.device { width: 100px; height: auto; background-image: url('https://via.placeholder.com/100'); }
.hero-visuals .element.pen-animated { width: 450px; height: 450px; opacity: 1; filter: none; animation-duration: 25s; animation-timing-function: linear; }

.hero-visuals .visual-wrapper { position: absolute; z-index: 5; cursor: pointer; pointer-events: auto; }
.hero-visuals .visual-wrapper:nth-of-type(1) { top: 10%; left: 5%; transform: scale(0.8); } 

.info-popup {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--primary); color: #fff; padding: 15px 25px; border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); z-index: 100; 
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 250px; text-align: center; font-size: 1rem; pointer-events: none; 
}
.info-popup.active { opacity: 1; visibility: visible; transform: translate(-50%, -120%); }

.hero-content { max-width: 800px; position: relative; z-index: 1; text-align: center; }
.hero-title { font-size: 3rem; margin-bottom: 20px; }
.hero-buttons { display: flex; justify-content: center; gap: 15px; }

/* PLATFORM & FEATURES */
.platform { padding: 80px 40px; text-align: center; background: var(--footer-bg); }
.platform-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; margin-top: 40px; }
.platform-card { padding: 40px; background: var(--card); border-radius: 10px; text-align: left; transition: transform 0.3s ease; border: 1px solid rgba(178, 7, 56, 0.1); }
.platform-card:hover { box-shadow: 0 15px 30px rgba(178, 7, 56, 0.2); transform: translateY(-5px); }
.platform-card h3 { color: var(--primary); font-size: 1.5rem; }
.clickable-card { cursor: pointer; }

/* CERTIFICACIONES */
.certifications { padding: 80px 40px; text-align: center; background: var(--bg); }
.certs-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; margin-top: 40px; align-items: center; justify-content: center; max-width: 1500px; margin: 0 auto; }
.cert-item { padding: 15px; display: flex; justify-content: center; align-items: center; }
.certifications .cert-stamp { width: 120px; height: 75px; object-fit: contain !important; opacity: 0.8 !important; transition: opacity 0.3s ease; }
.cert-stamp:hover { opacity: 1 !important; }

/* CTA & FOOTER */
.cta { padding: 100px 40px; text-align: center; background: var(--primary); color: #fff; }
.footer { background: var(--footer-bg); padding: 20px; text-align: center; }
.logo-img { height: 100px; width: auto; vertical-align: middle; }

/* Whatsapp Float */
.whatsapp-float {
    position: fixed; width: 60px; height: 60px; bottom: 40px; right: 40px;
    background-color: #25D366; color: #FFF; border-radius: 50px;
    text-align: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 10000; display: flex; justify-content: center; align-items: center;
    transition: transform 0.3s ease;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-icon { width: 30px; height: 30px; filter: brightness(0) invert(1); }

/* --- ESTILOS MODALES (BASE) --- */
.modal-overlay {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px); animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--card); color: var(--text); margin: 5% auto; 
    padding: 30px; border: 1px solid var(--primary); border-radius: 10px;
    width: 90%; max-width: 500px; position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; animation: slideUp 0.3s ease;
    max-height: 90vh; overflow-y: auto;
}

.close-modal {
    color: var(--text); float: right; font-size: 28px; font-weight: bold;
    cursor: pointer; line-height: 20px; position: absolute; top: 20px; right: 20px;
}
.close-modal:hover { color: var(--primary); }

/* About Text */
.about-text-content { text-align: left; margin-top: 20px; }
.about-text-content h3 { color: var(--primary); margin-bottom: 10px; font-size: 1.4rem; }
.about-text-content p { margin-bottom: 25px; line-height: 1.6; font-size: 1rem; color: var(--text); }

/* Form inputs */
.contact-form .input-group { margin-bottom: 15px; text-align: left; }
.contact-form input[type="text"], .contact-form input[type="email"] {
    width: 100%; padding: 15px; border-radius: 6px; border: 1px solid #ccc;
    background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif;
    box-sizing: border-box; font-size: 1rem;
}
.contact-form input:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* Video Modal Specifics */
.video-modal-content {
    max-width: 800px; padding: 20px; background: #000; border: none;
}
.video-modal-content .close-modal {
    color: #fff; top: 10px; right: 15px; z-index: 10;
}
.video-container {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
}
.video-container video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}


/* --- RESPONSIVE STYLES (Móvil y Tabletas) --- */
@media (min-width: 769px) { .hero { padding-top: 140px; } }

@media (max-width: 768px) {
    body { font-size: 14px; }
    .navbar, .hero, .features, .platform, .cta { padding: 20px 15px; }
    
    .navbar { position: fixed; flex-wrap: wrap; padding-bottom: 10px; overflow: visible; }
    
    .logo-img { height: 60px; }
    
    nav { 
        order: 3; width: 100%; margin-top: 10px; text-align: center; 
        display: flex; justify-content: space-around; overflow-x: auto; 
    }
    nav a { margin: 0 5px; flex-grow: 1; padding: 5px 0; font-size: 14px; white-space: nowrap; }
    
    .actions { order: 2; margin-left: 0; display: flex; gap: 5px; }
    .actions .btn-primary { display: none; }
    .actions .btn-outline { padding: 8px 10px; }
    
    .hero { padding-top: 150px; flex-direction: column; text-align: center; min-height: auto; }
    .hero-content { max-width: 100%; margin-bottom: 40px; order: 1; }
    .hero-title { font-size: 2rem; }
    
    .platform-grid { grid-template-columns: 1fr; gap: 20px; }
    .certs-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .certifications .cert-stamp { width: 90px; height: 55px; }
    
    .whatsapp-float { width: 50px; height: 50px; bottom: 20px; right: 20px; }
    .whatsapp-icon { width: 25px; height: 25px; }

    /* Ajuste de Modales en Móvil */
    .modal-content {
        width: 95%; margin: 15% auto; padding: 25px 15px;
    }
    .video-modal-content {
        margin-top: 30%;
    }
}