/* --- RESET Y CONFIGURACIÓN GENERAL --- */
:root {
    --primary-color: #6a0dad;
    --secondary-color: #6bd8c6;
    --text-color: #f0f0f0;
    --bg-dark-gray: #1a1a1d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(-45deg, #0b0c10, #1f2833, #45a29e, #66fcf1);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    color: var(--text-color);
    /* --- OPTIMIZACIÓN MÓVIL (1) --- */
    /* Permitimos el scroll vertical si el contenido (ej. teclado) lo requiere */
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh; /* Usar min-height en vez de height */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0; /* Añadimos padding vertical para que no se pegue arriba/abajo en scroll */
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hidden { display: none !important; }

/* --- PANTALLA DE CARGA Y LOGO --- */
#splash-screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.logo-container {
    text-align: center;
    animation: fadeIn 1.5s ease-out;
    /* --- OPTIMIZACIÓN MÓVIL (2) --- */
    width: 90%; /* Asegura que el contenedor no se desborde */
    max-width: 500px;
}

.logo-main {
    /* --- OPTIMIZACIÓN MÓVIL (2) --- */
    width: 100%; /* El logo se adapta al contenedor */
    height: auto;
}

.logo-reflection {
    background: url(oficial.png) no-repeat center center;
    background-size: contain; 
    /* --- OPTIMIZACIÓN MÓVIL (2) --- */
    width: 100%; /* Adaptable */
    padding-top: 100%; /* Truco para mantener proporción cuadrada */
    height: 0;
    display: block;
    margin: 0 auto;
    transform: 
        scaleY(-1)
        scale(0.75)
        translateY(100%); /* Ajuste de translateY para que funcione con el nuevo tamaño */
    opacity: 0.2;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, black 50%);
    mask-image: linear-gradient(to top, transparent 0%, black 50%);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


/* --- MODAL DE IDIOMA --- */
#language-modal {
    padding: 2rem; /* Reducimos padding para móviles por defecto */
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    animation: fadeIn 0.5s;
    z-index: 50;
    width: 90%; /* Asegura que no se desborde */
    max-width: 500px;
}

#language-modal h3 { 
    margin-bottom: 1.5rem; 
    font-weight: 300;
    font-size: 1.1rem; /* Ajustamos tamaño de fuente */
}

#language-modal .flags { 
    display: flex; 
    gap: 1rem; 
    flex-direction: column; /* Apilamos los botones en móvil por defecto */
}

#language-modal button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%; /* Ocupan todo el ancho del modal */
}

.flag-icon {
    width: 24px;
    height: auto;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 3px;
}


/* --- CONTENIDO PRINCIPAL --- */
#main-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s;
    transition: filter 0.5s ease, transform 0.5s ease;
    padding-top: 5rem; /* <-- AÑADIR ESTA LÍNEA */
    padding-bottom: 2rem;
}

#main-content.blurry {
    filter: blur(8px);
    transform: scale(0.95);
}

.hero-container {
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.dynamic-text-container {
    margin-bottom: 2rem;
    min-height: 120px; /* Aumentamos altura mínima para evitar saltos en móvil */
}

/* --- OPTIMIZACIÓN MÓVIL (3) --- */
.dynamic-text-container h1 {
    font-size: 2rem; /* Tamaño base para móviles */
    font-weight: 600;
    display: inline;
}

#dynamic-text {
    color: var(--secondary-color);
}

.typed-cursor { 
    font-size: 2rem; /* Coincide con el h1 */
    color: var(--secondary-color); 
}

.pricing-subtitle {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(240, 240, 240, 0.8);
    margin-bottom: 2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    animation: fadeIn 1s 0.5s backwards;
}

/* --- FORMULARIO "FROSTED GLASS" --- */
.frosted-glass {
    background: rgba(25, 28, 35, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem; /* Menos padding en móviles */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.form-group {
    position: relative;
    margin-bottom: 2.5rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 0 10px 0;
    color: var(--text-color);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    position: relative;
    z-index: 2;
}

.form-group select { 
    appearance: none; -webkit-appearance: none; 
    cursor: pointer; padding-right: 20px;
}

select option { background: #1f2833; color: var(--text-color); }

.form-group label {
    position: absolute;
    top: 15px; /* Por defecto, la etiqueta está dentro */
    left: 0;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
    font-size: 1rem; /* Mismo tamaño que el input */
}

/* --- LÓGICA DE ETIQUETAS MEJORADA (dependerá de JS) --- */
.form-group.is-focused label,
.form-group.has-content label {
    top: -20px;
    font-size: 0.75rem;
    color: var(--secondary-color);
    z-index: 3; 
}

.form-group.tel.has-content label,
.form-group.tel.is-focused label {
  left: 56px; /* Solo se mueve cuando está activo */
}


.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--secondary-color);
}

/* Estilos intl-tel-input (sin cambios mayores) */
.iti { width: 100% !important; }
.iti__country-list { background-color: #1f2833; border: 1px solid rgba(255, 255, 255, 0.1); }
.iti__country { color: var(--text-color); }
.iti__country:hover { background-color: rgba(255, 255, 255, 0.1); }
.iti__dial-code { color: rgba(255,255,255,0.5); }
.iti--allow-dropdown input[type=tel] { padding-left: 52px !important; background: transparent !important; border: none !important; border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important; color: var(--text-color) !important; padding-top: 15px !important; padding-bottom: 10px !important; }
.iti__flag-container { position: absolute; top: 50%; transform: translateY(-50%); }

/* Contact Method */
.contact-method { text-align: left; color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }
.contact-method > div { margin-top: 1.4rem; display: flex; gap: 1rem; flex-wrap: wrap; /* Permite que los botones se ajusten */ }
.contact-method input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.contact-method label { cursor: pointer; padding: 0.5rem 1rem; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 20px; transition: all 0.3s ease; font-size: 0.9rem;position: relative; pointer-events: auto; }
.contact-method input[type="radio"]:checked + label { background: var(--secondary-color); color: var(--bg-dark-gray); border-color: var(--secondary-color);z-index: 2; }
.contact-method input[type="radio"]:focus + label { outline: 2px solid var(--secondary-color); outline-offset: 2px; }

.cta-button {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: var(--bg-dark-gray);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem; /* Un poco más de espacio */
}


/* --- VISTA DE SERVICIOS --- */
#services-trigger {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#services-view {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alineamos arriba para permitir scroll */
    background: rgba(11, 12, 16, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 6rem 1rem 2rem 1rem; /* Padding para que no se pegue a los bordes */
    overflow-y: auto; /* Permitir scroll dentro del modal */
}

#services-view.visible { opacity: 1; pointer-events: all; }

#close-services {
    position: fixed; /* Usar fixed para que se quede fijo aunque haya scroll */
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 31; /* Debe estar por encima del contenido del modal */
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna por defecto */
    gap: 1.5rem;
    width: 100%;
    max-width: 900px; /* Ancho máximo para la cuadrícula */
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s ease 0.2s, opacity 0.5s ease 0.2s;
}

#services-view.visible .services-grid { transform: translateY(0); opacity: 1; }

.service-card {
    background: rgba(31, 40, 51, 0.8);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-icon { font-size: 2.5rem; font-weight: 700; color: var(--secondary-color); margin-bottom: 1rem; }
.service-card h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.service-card p { font-weight: 300; color: rgba(255, 255, 255, 0.7); }


/* ================================================= */
/* ---               MEDIA QUERIES               --- */
/* ================================================= */

/* --- TABLETS (e.g., iPads en vertical y móviles grandes en horizontal) --- */
@media (min-width: 600px) {
    .frosted-glass {
        padding: 2rem;
    }

    #language-modal .flags { 
        flex-direction: row; /* Botones de idioma en fila */
    }

    .dynamic-text-container h1, .typed-cursor {
        font-size: 2.2rem;
    }
}

/* --- DISPOSITIVOS MÁS GRANDES (Tablets en horizontal, Laptops) --- */
@media (min-width: 769px) {
    body {
        padding: 0; /* Quitamos el padding, ya no hay problema de scroll */
    }
    
    #language-modal {
        padding: 2rem 3rem;
    }
    
    .dynamic-text-container h1, .typed-cursor {
        font-size: 2.5rem; /* Restauramos tamaño original */
    }
    
    .services-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 2rem;
    }
    
    #services-trigger { 
        top: 30px; 
        right: 40px; 
        padding: 0.8rem 1.5rem; 
    }

    #close-services {
        top: 30px;
        right: 40px;
    }
}

/* --- OPTIMIZACIÓN MÓVIL (4) --- */
/* Desactivar efectos hover en dispositivos que no los soportan */
@media (hover: none) {
    #language-modal button:hover,
    .cta-button:hover,
    #services-trigger:hover,
    #close-services:hover,
    .service-card:hover {
        transform: none;
        background: inherit; /* Restablecer fondos si es necesario */
        box-shadow: none;
    }

    /* Caso especial para botones con cambio de color */
    #language-modal button:hover { background: rgba(255, 255, 255, 0.1); }
    #services-trigger:hover { background: rgba(255, 255, 255, 0.1); }
}

.contact-method label i {
    margin-right: 8px; /* Crea un espacio entre el icono y el texto */
    font-size: 1.1em; /* Opcional: hace el icono un poco más grande */
}

/* --- VISTA SOBRE NOSOTROS --- */

/* Estilo del botón "Sobre Nosotros" (similar al de servicios) */
#about-trigger {
    position: fixed;
    top: 20px;
    /* Lo ponemos a la izquierda para que no choque con el otro */
    left: 20px; 
    background: rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Vista superpuesta (casi idéntica a la de servicios) */
#about-view {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center; /* Centramos el contenido */
    background: rgba(11, 12, 16, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    padding: 1rem;
}

#about-view.visible {
    opacity: 1;
    pointer-events: all;
}

/* Contenedor del contenido "Sobre Nosotros" */
.about-container {
    width: 90%;
    max-width: 600px;
    text-align: center;
    padding: 2.5rem; /* Más padding para que respire */
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s ease 0.2s, opacity 0.5s ease 0.2s;
}

#about-view.visible .about-container {
    transform: translateY(0);
    opacity: 1;
}

.about-logo {
    width: 190px; /* Tamaño controlado del logo */
    height: auto;
    margin-bottom: 1.5rem;
}

.about-container h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.about-container p {
    font-weight: 300;
    line-height: 1.7; /* Más interlineado para mejorar la legibilidad */
    color: rgba(240, 240, 240, 0.9);
}

/* Botón de cierre (similar al de servicios) */
#close-about {
    position: fixed;
    top: 20px;
    right: 20px; /* Lo dejamos a la derecha */
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 31;
}

/* Media query para ajustar en pantallas más grandes */
@media (min-width: 769px) {
    #about-trigger { 
        top: 30px; 
        left: 40px; 
        padding: 0.8rem 1.5rem; 
    }
}

/* --- FOOTER CON REDES SOCIALES --- */
.social-footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.1);
    background: rgba(106, 13, 173, 0.8);
    border-color: var(--secondary-color);
    box-shadow: 0 10px 25px rgba(106, 13, 173, 0.3);
}

.social-links a:nth-child(1):hover {
    background: rgba(24, 119, 242, 0.8);
    box-shadow: 0 10px 25px rgba(24, 119, 242, 0.3);
}

.social-links a:nth-child(2):hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 10px 25px rgba(225, 48, 108, 0.3);
}

.social-links a:nth-child(3):hover {
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .social-footer {
        bottom: 15px;
    }
    
    .social-links a {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .social-links {
        gap: 12px;
    }
}