/* --- VARIABLES GLOBALES Y ESTILOS BASE --- */
:root {
    --color-primary: #1a4d8c;
    --color-accent-blue: #5b90f4;
    --color-logo-blue: #008CFF;
    --color-logo-purple: #8200FF;
    --color-logo-cyan: #00C2BA;
    --color-bg-light: #f5f7fa;
    --color-text-dark: #2c3e50;
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: rgba(224, 205, 149, 0.1);
    line-height: 1.6;
    color: var(--color-text-dark);
}

/* --- ESTILOS DE COMPONENTES GLOBALES (Botones, Modales, etc.) --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-accent-blue, #5b90f4);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-primary, #1a4d8c);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    box-shadow: var(--shadow-premium);
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease-in-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    color: var(--color-primary);
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-logo-cyan);
    padding-bottom: 10px;
}

.modal-content p {
    line-height: 1.8;
    color: #333;
    font-size: 1.05em;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 3em;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
    line-height: 1;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

/* --- SECCIÓN HERO --- */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 800px;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)), url('../img/hero_image.jpg');
    background-size: cover;
    background-position: bottom;
    background-color: #0b1523;
    opacity: 1;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px 40px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 20px;
}

.logo img {
    height: 70px;
    filter: brightness(1.2);
}

.nav-links {
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    padding: 0 15px;
    display: block;
    opacity: 0.9;
    position: relative;
}

.nav-links a:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background-color: rgba(255, 255, 255, 0.5);
}

.contact-button {
    background-color: var(--color-logo-cyan, #00BCD4);
    border: 2px solid var(--color-logo-cyan, #00BCD4);
    color: white;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
}

.contact-button:hover {
    background-color: transparent;
    color: var(--color-logo-cyan, #00BCD4);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.contact-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.main-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.mainlogo {
    position: relative;
    width: 250px;
    height: auto;
    filter: brightness(1.1);
}

.headline-area {
    width: 80%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.headline {
    font-size: clamp(0.5em, 4.0vw, 2.5em);
    line-height: 1.2;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(to bottom, white 40%, var(--color-accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-top: 20px;
}

.nameline {
    font-size: clamp(1.5em, 3vw, 3.5em);
    line-height: 1.2;
    font-weight: 800;
    margin: 0;
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-contact-btn {
    display: none;
    background-color: var(--color-logo-cyan);
    color: white;
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 30px;
    transition: background-color 0.3s ease;
}

.mobile-contact-btn:hover {
    background-color: #009aaf;
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    opacity: 0.7;
    padding: 20px 40px;
    position: relative;
    z-index: 2;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white !important;
    font-size: 2.5em;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    cursor: pointer;
    animation: bounce 2s infinite;
    z-index: 2;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- ESTILOS GENERALES DE SECCIONES --- */
.about-section, .team-section, .work-lines-section, .dual-text-section, .contact-section {
    padding: 30px 40px;
}

.about-section, .team-section, .dual-text-section {
    overflow: hidden;
    position: relative;
}

.about-section h2, .team-section h2, .work-lines-section h2, .contact-section h2 {
    font-size: 3em;
    margin-bottom: 70px;
    color: var(--color-text-dark);
    font-weight: 700;
    position: relative;
    text-align: center;
}

.about-section h2::after, .team-section h2::after, .work-lines-section h2::after, .contact-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--color-logo-blue), var(--color-logo-purple));
    border-radius: 2px;
}

.about-section::after, .dual-text-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent 30%, #008CFF 55%, #008CFF 60%, transparent 70%);
    z-index: 10;
}

.about-section:before {
    content: "";
    background-image: url(/img/background1.svg);
    background-size: cover;
    background-repeat: no-repeat;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
}

/* --- SECCIÓN FUNDACIÓN (ABOUT) --- */
.mvh-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 0 auto;
    padding: 0 20px;
}

.mvh-item {
    flex: 1 1 30%;
    min-width: 280px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
    padding: 40px 30px;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
    text-align: left;
}

.mvh-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 140, 255, 0.1), rgba(0, 140, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: scale(0.1);
    z-index: 0;
}

.mvh-item:hover::before {
    opacity: 1;
    transform: scale(1);
}

.mvh-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

.mvh-item h3 {
    font-size: 1.8em;
    color: var(--color-primary);
    margin-top: 25px;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    text-align: center;
}

.mvh-item p {
    flex-grow: 1;
    font-size: 1.05em;
    line-height: 1.7;
    color: #555;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.mvh-item .icon {
    font-size: 3.5em;
    color: var(--color-accent-blue);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.mvh-item .read-more-btn {
    margin-top: auto;
    align-self: flex-start;
    background-color: var(--color-accent-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: background-color 0.3s ease;
    z-index: 100;
    text-align: center;
    margin: auto;
}

.mvh-item .read-more-btn:hover {
    background-color: var(--color-primary);
}

/* --- SECCIÓN EQUIPO --- */
.team-section:before {
    content: "";
    background-image: url(/img/background2.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right top;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.05;
}

.team-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    z-index: 5;
    position: relative;
}

.team-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.team-member.president {
    margin-bottom: 40px;
    max-width: 700px;
    align-self: center;
}

.team-member {
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-premium);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    min-width: 280px;
    max-width: 450px;
}

.team-member:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.15);
}

.member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid var(--color-accent-blue);
}

.team-member h3 {
    color: var(--color-primary);
    font-size: 1.5em;
    margin-bottom: 5px;
}

.team-member .role {
    color: var(--color-accent-blue);
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.team-member .bio {
    color: #666;
    font-size: 0.95em;
    text-align: left;
}

/* --- SECCIÓN TEXTO DUAL --- */
.dual-text-container {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    gap: 50px;
    text-align: left;
    flex-wrap: wrap;
}

.dual-text-column {
    flex: 1;
    min-width: 300px;
}

.dual-text-column h3 {
    font-size: 2em;
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    position: relative;
}

/* --- SECCIÓN LÍNEAS DE TRABAJO --- */
.work-lines-section {
    text-align: center;
}

.work-lines-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: nowrap;
    max-width: 1200px;
    margin: 0 auto;
}

.work-card {
    flex: 1 1 30%;
    min-width: 250px;
    background-color: #fcfcfc;
    border-radius: 10px;
    padding: 40px 30px;
    box-shadow: var(--shadow-premium);
    transition: box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
    z-index: 1;
}

.work-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 140, 255, 0.07), rgba(0, 140, 255, 0) 70%);
    z-index: -1;
}

.work-card h3 {
    font-size: 1.6em;
    color: var(--color-primary);
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    border-bottom: 2px solid var(--color-logo-cyan);
    padding-bottom: 10px;
}

.work-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.work-card li {
    font-size: 1em;
    margin-bottom: 12px;
    color: #555;
    position: relative;
    padding-left: 25px;
}

.work-card li::before {
    content: '\f058';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--color-logo-blue);
}

.work-cta-container {
    max-width: 900px;
    margin: 70px auto 0 auto;
    padding: 40px;
    background: linear-gradient(135deg, var(--color-primary), #2a6fcc);
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 15px 35px rgba(26, 77, 140, 0.3);
}

.work-cta-container h3 {
    font-size: 2.2em;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
}

.work-cta-container p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-button {
    background-color: var(--color-logo-cyan);
    color: white;
    padding: 15px 35px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.cta-button:hover {
    background-color: white;
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* --- SECCIÓN CONTACTO --- */
.contact-section {
    text-align: center;
}

.contact-container {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    gap: 30px;
    text-align: left;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}

.contact-form-area {
    flex: 2;
    min-width: 350px;
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-premium);
}

.contact-details-area {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-primary);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--color-logo-cyan);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 194, 186, 0.3);
}

.submit-button {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(to right, var(--color-logo-blue), var(--color-logo-purple));
    color: white;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 10px rgba(0, 140, 255, 0.3);
}

.submit-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.contact-box {
    background-color: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.contact-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--color-logo-blue);
}

.contact-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--color-logo-blue), var(--color-logo-cyan), var(--color-logo-purple));
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.contact-box i {
    color: var(--color-logo-cyan);
    margin-right: 15px;
    font-size: 1.6em;
}

.contact-box p {
    margin-bottom: 5px;
    color: var(--color-text-dark);
}

.contact-box a {
    font-size: 1.1em;
    color: var(--color-logo-blue);
    font-weight: 600;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    font-size: 1em;
    color: #555;
}

.contact-item a {
    font-size: 10px;
}

/* --- ESTILOS PARA MENSAJES DEL FORMULARIO AJAX --- */
.form-message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid transparent;
    display: none; 
    font-weight: 600;
}

.form-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.form-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* --- FOOTER --- */
.main-footer {
    background-color: #0b1523;
    color: #f0f2f5;
    padding: 60px 40px 20px 40px;
    font-size: 0.9em;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-column {
    flex: 1;
    min-width: 250px;
}

.footer-column h4 {
    color: var(--color-logo-cyan);
    font-size: 1.2em;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li a {
    color: #a0a0a0;
    text-decoration: none;
    line-height: 2.2;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: var(--color-logo-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    color: #a0a0a0;
    font-size: 0.8em;
}

.footer-logo-text p {
    font-weight: 700;
    font-size: 1.2em;
    color: #fff;
    margin-bottom: 15px;
}

/* --- MEDIA QUERIES (RESPONSIVIDAD) --- */
@media (max-width: 992px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
    .work-lines-container {
        flex-direction: column;
        align-items: center;
    }
    .work-card {
        width: 90%;
        margin-bottom: 25px;
        max-width: 400px;
        flex: 0 0 100%;
    }
    .about-section, .team-section, .work-lines-section, .dual-text-section, .contact-section {
        padding: 60px 20px;
    }
    .contact-container {
        flex-direction: column;
        align-items: center;
    }
    .contact-form-area, .contact-details-area {
        min-width: 90%;
        width: 90%;
    }
    .team-grid {
        flex-direction: column;
        align-items: center;
    }
    .team-member.president, .team-member {
        max-width: 400px;
        width: 90%;
    }
    .footer-container {
        justify-content: center;
        text-align: center;
    }
    .footer-column {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .modal-content h3 {
        font-size: 1.8em;
    }
    .close-button {
        font-size: 2.5em;
        top: 5px;
        right: 15px;
    }
    .work-cta-container {
        padding: 30px 20px;
    }
    .work-cta-container h3 {
        font-size: 1.8em;
    }
    
    .contact-form-area {
        padding: 30px 20px;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 728px) {
    .header, .footer-info {
        display: none;
    }
    .hero-content {
        padding-top: 50px;
    }
    .mainlogo {
        width: 150px;
    }
    .mobile-contact-btn {
        display: inline-block;
    }
}

/* ===== NUEVO: Media Query para dispositivos muy pequeños (menos de 480px) ===== */
@media (max-width: 480px) {
    .about-section h2, .team-section h2, .work-lines-section h2, .contact-section h2 {
        font-size: 2.2em;
        margin-bottom: 50px;
    }
    
    /* ===== CORRECCIÓN MÓVIL < 480px: Ajustes en tarjetas para evitar desbordamiento ===== */
    .mvh-item, .team-member, .work-card {
        padding: 30px 20px; /* Reducir el padding interno */
        min-width: 0;       /* Eliminar el ancho mínimo para que sean 100% fluidas */
    }

    .mvh-item {
        flex: 1 1 100%;
    }

    .contact-item a {
        font-size: 8px;
    }

    .dual-text-column h3 {
        font-size: 1.8em;
    }

    .work-cta-container h3 {
        font-size: 1.6em;
    }

    /* ===== CORRECCIÓN MÓVIL < 480px: El botón del CTA ahora ocupa todo el ancho y se ve bien ===== */
    .cta-button {
        padding: 15px 20px; /* Reducir padding vertical para que no sea tan alto */
        font-size: 1em;     /* Ajustar tamaño de fuente */
        width: 100%;        /* Hacer que ocupe todo el ancho disponible */
        box-sizing: border-box; /* Asegurar que el padding no lo haga desbordar */
    }

    .headline-area {
        width: 95%; /* Dar un poco más de espacio al titular en pantallas muy pequeñas */
    }
}