/* Base y Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f8f9fa;
    color: #333;
    overflow-x: hidden;
}

/* Variables de Colores */
:root {
    --primary: #000080; /* Azul marino profundo */
    --primary-dark: #00004d; /* Versión más oscura para algunos elementos */
    --secondary: #FF9500; /* Naranja */
    --light: #FFFFFF; /* Blanco */
    --dark: #101010; /* Negro suave */
    --gray: #f0f0f0; /* Gris claro para secciones */
}

/* Utilidades */
.highlight {
    color: var(--secondary);
}

/* Navegación */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: #00049e; /* Color ajustado para coincidir con el logo */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 8vh;
    padding: 0 5%;
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 5px 0;
    background-color: #00049e; /* Color ajustado para coincidir con el logo */
}

.nav-logo {
    height: 40px;
}

.nav-links {
    display: flex;
    justify-content: space-around;
    width: 40%;
}

.nav-links li {
    list-style: none;
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #00049e; /* Color ajustado para coincidir con el logo */
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
}

.dropdown-content a {
    color: var(--light);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--light);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Sección Hero */
#hero {
    height: 100vh;
    position: relative;
    color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
    margin-top: 8vh;
}

.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

#hero-video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 4, 158, 0.8); /* Versión con transparencia del color ajustado */
}

.hero-content {
    max-width: 800px;
    z-index: 1;
}

.hero-logo {
    margin-bottom: 30px;
}

.main-logo {
    width: 300px;
    margin-bottom: 10px;
}

.tagline {
    font-size: 2.5rem;
    letter-spacing: 10px;
    margin-top: -20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.hero-text {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

/* Secciones Generales */
section {
    padding: 100px 5%;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    color: #333; /* Color oscuro para el título */
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background-color: var(--secondary);
    margin: 20px auto;
}

.subsection-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 40px;
    color: #000070; /* Color azul oscuro para los subtítulos */
}

/* Sección Servicios */
#servicios {
    background-color: var(--light);
}

.services-section {
    margin-bottom: 80px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Tarjetas de servicios tecnológicos */
.service-card {
    height: 250px;
    perspective: 1000px;
    border-radius: 10px;
    overflow: hidden;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.service-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
}

/* Estilo para el frente de la tarjeta: imagen completa */
.card-front {
    overflow: hidden;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Esto asegura que la imagen cubra todo el espacio sin distorsionarse */
}

/* Para los nombres de servicios, colocamos una capa de texto sobre la imagen */
.card-front .service-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 112, 0.7); /* Fondo semi-transparente */
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Estilo para el reverso de la tarjeta */
.card-back {
    background-color: var(--secondary); /* Naranja */
    color: var(--light);
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.card-back p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Grid de Localización */
.localization-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
}

/* Tarjetas de servicios de localización */
.localization-item {
    height: 200px;
    perspective: 1000px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.localization-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.localization-item:hover .localization-inner {
    transform: rotateY(180deg);
}

.localization-front, .localization-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Imagen completa para el frente de las tarjetas de localización */
.localization-front {
    overflow: hidden;
}

.localization-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Texto sobre la imagen */
.localization-front .service-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 112, 0.7);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Corrección del problema del reverso */
.localization-back {
    background-color: var(--secondary); /* Naranja */
    color: var(--light);
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.localization-back p {
    font-size: 1rem;
    line-height: 1.6;
}

/* El cuadro central con degradado diagonal ajustado y logo más grande */
.logo-center {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, 
                               #FF9500 0%, 
                               #FF7000 60%, /* Extendemos la zona naranja hasta el 60% */
                               #5B0099 85%, /* Transición más rápida al púrpura-azul */
                               #00049e 100%); /* Azul al final */
    border-radius: 10px;
    overflow: hidden;
}

.center-logo {
    text-align: center;
    padding: 10px;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid-logo {
    width: 90%; /* Aumentamos el tamaño del logo */
    max-width: 220px; /* También aumentamos el tamaño máximo */
}

.center-logo p {
    color: var(--light);
    font-size: 1.2rem;
    letter-spacing: 5px;
}

/* Sección Sobre Nosotros */
.about-section {
    background-color: var(--gray);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* Sección Únete */
.join-section {
    background-color: var(--light);
}

.join-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.join-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
}

.join-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 50%;
}

.join-content {
    flex: 1;
}

.join-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--secondary);
}

.join-content p {
    margin-bottom: 30px;
    line-height: 1.7;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary);
    color: var(--light);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #00049e; /* Azul ajustado */
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Sección Contacto */
/* Sección Contacto */
.contact-section {
    background-color: #00008B; /* Azul más profundo como en la imagen */
    color: var(--light);
    padding: 80px 5%;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    color: #CCCCCC; /* Color gris claro para el título CONTACTO */
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background-color: var(--secondary); /* La línea naranja debajo del título */
    margin: 20px auto;
}

.contact-container {
    display: flex;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(0, 0, 139, 0.6); /* Azul ligeramente más claro */
    border-radius: 15px;
    padding: 40px;
}

.contact-info {
    flex: 1;
}

.contact-heading {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--light);
}

.contact-info p {
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.contact-detail {
    font-size: 1.1rem;
    color: #FFB833; /* Color naranja más claro para que destaquen el email y teléfono */
    font-weight: 500;
}

.contact-form {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--dark);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 5px;
    background-color: var(--secondary);
    color: var(--light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-submit:hover {
    background-color: #e68600;
}

/* Footer */
footer {
    background-color: var(--dark);
    color: var(--light);
    padding: 50px 5% 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.footer-logo {
    text-align: center;
}

.footer-logo-img {
    width: 120px;
    margin-bottom: 10px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    text-decoration: none;
    color: var(--light);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-icon {
    text-decoration: none;
    color: var(--light);
    padding: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--secondary);
    color: var(--light);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .nav-links {
        width: 60%;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .localization-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .logo-center {
        grid-column: 1 / span 2;
        grid-row: auto;
    }
    
    .join-container, .contact-container {
        flex-direction: column;
    }
}

@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .nav-links {
        position: absolute;
        right: 0px;
        height: 92vh;
        top: 8vh;
        background-color: #00049e; /* Azul ajustado */
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        z-index: 5;
    }
    
    .nav-links li {
        opacity: 0;
    }
    
    .burger {
        display: block;
    }
    
    .nav-active {
        transform: translateX(0%);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-text {
        font-size: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .localization-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-center {
        grid-column: 1;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
}

/* Animación para el menú móvil */
@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Animación de fade-in para los elementos */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

/* Mejora de presentación para datos de contacto */
.contact-details {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--secondary); /* Naranja */
    background-color: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.contact-link:hover {
    background-color: var(--secondary);
    color: var(--light);
    transform: translateY(-2px);
}

.contact-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Ajustes responsive */
@media screen and (max-width: 768px) {
    .contact-details {
        flex-direction: column;
        gap: 10px;
    }
}

/* Estilos para el CAPTCHA */
.captcha-container {
    background-color: #f6f6f6;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    max-width: 400px;
}

.captcha-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.captcha-icon {
    margin-right: 8px;
    font-size: 18px;
}

.captcha-title {
    color: #505050;
    font-weight: 600;
    font-size: 16px;
}

.captcha-instruction {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.captcha-image-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.captcha-image {
    height: 60px;
    width: 180px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.refresh-captcha {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: none;
    background-color: #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #505050;
    transition: background-color 0.2s;
}

.refresh-captcha:hover {
    background-color: #d9d9d9;
}

.refresh-captcha svg {
    width: 16px;
    height: 16px;
}

#captcha_answer {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    background-color: white;
    text-align: center;
}

#captcha_answer::placeholder {
    color: #999;
    text-align: center;
}

/* Versión para modo oscuro (para la sección de contacto con fondo oscuro) */
.contact-section .captcha-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-section .captcha-title,
.contact-section .captcha-instruction {
    color: #fff;
}

.contact-section .captcha-image {
    border-color: rgba(255, 255, 255, 0.2);
}

.contact-section .refresh-captcha {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.contact-section .refresh-captcha:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.contact-section #captcha_answer {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.contact-section #captcha_answer::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Estilos para WhatsApp */
.whatsapp-link {
    color: #FFB833;
    text-decoration: none;
    transition: color 0.3s ease;
}

.whatsapp-link:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

/* Ajuste para el footer */
.footer-social {
    display: flex;
    justify-content: center;
}

.social-icon {
    text-decoration: none;
    color: var(--light);
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #25D366; /* Color de WhatsApp */
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: #128C7E; /* Color más oscuro de WhatsApp */
    color: var(--light);
}

.footer-contact {
    display: flex;
    gap: 15px;
}

.footer-contact-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--light);
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-contact-link:hover {
    background-color: var(--secondary);
}

/* Ajustes responsive para el footer */
@media screen and (max-width: 768px) {
    .footer-contact {
        margin-top: 20px;
        justify-content: center;
    }
}

/* Badge de AI */
.ai-badge {
    display: inline-block;
    background: linear-gradient(45deg, #FF9500, #FFB833);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* Mejora visual para las métricas */
#metricas h3 {
    background: linear-gradient(180deg, #FFFFFF, #FFB833);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Resaltar el {AI} en el logo textual */
.hero-title span[style*="FF9500"] {
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 149, 0, 0.5);
}