/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #0d2c4f; /* Azul naval oscuro */
    --secondary-color: #007bff; /* Azul brillante */
    --accent-color: #ffc107; /* Amarillo ámbar */
    --text-color: #343a40; /* Gris oscuro casi negro */
    --light-gray-color: #f8f9fa; /* Gris muy claro */
    --white-color: #ffffff;
    --font-family: 'Poppins', 'Helvetica', 'Arial', sans-serif;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--white-color);
    line-height: 1.7;
    font-weight: 300;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; }

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Justificación de párrafos principales */
.hero p,
.section-intro,
.resource-text p,
.modal-content article p,
.modal-content article li,
.contact-info-container p,
.contact-page .section-intro {
    text-align: justify;
}

/* --- Header y Navegación --- */
header {
    background-color: var(--white-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center; /* Alinea verticalmente imagen y texto */
    gap: 12px; /* Espacio entre el logo y el texto */
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 50%; /* Hace el logo circular */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra sutil para profundidad */
    border: 2px solid var(--light-gray-color); /* Borde fino para un acabado limpio */
}

.nav-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 25px;
}

.nav-link {
    font-weight: 400;
    font-size: 1rem;
    color: var(--primary-color);
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.nav-link.contact-link {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    border-bottom: none;
}
.nav-link.contact-link:hover {
    background-color: #ffac00;
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
}
.menu-toggle .bar {
    height: 3px;
    width: 25px;
    background-color: var(--primary-color);
    margin: 4px 0;
    transition: all 0.3s;
}

/* --- Botones CTA --- */
.cta-button {
    background: linear-gradient(45deg, var(--secondary-color), #0056b3);
    color: var(--white-color);
    padding: 15px 35px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    border: none;
    cursor: pointer;
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
    color: var(--white-color);
}

.cta-button-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    padding: 10px 25px;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}
.cta-button-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

/* --- Secciones --- */
main section {
    padding: 80px 0;
}
.section-header {
    text-align: center;
    margin-bottom: 50px;
}
.section-header h2 {
    position: relative;
}
.section-header h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 16px auto 0;
    border-radius: 999px;
}
.section-tag {
    display: inline-block;
    padding: 5px 15px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
}
.section-intro {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: #555;
}

/* --- Hero Section --- */
.hero {
    background-color: var(--light-gray-color);
    text-align: center;
    padding: 100px 0;
}
.hero-text {
    max-width: 800px;
    margin: 0 auto;
}
.hero h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.hero-lead {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #555;
}
.hero-typed {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 2.5rem;
    min-height: 1.4em;
}

/* --- Feature Section (Quiénes Somos) --- */
.feature-section {
    background-color: var(--white-color);
}

/* --- Services Section --- */
.services-section {
    background-color: var(--light-gray-color);
}
.service-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 40px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}
.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}
.card h3 {
    margin-bottom: 0.8rem;
}
.card p {
    margin: 0;
    font-size: 0.98rem;
    color: #555;
    text-align: justify;
}

/* --- Resources Section --- */
.resource-list {
    max-width: 900px;
    margin: 0 auto;
}
.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}
.resource-text h3 {
    margin-top: 0;
}

/* --- Final CTA --- */
.final-cta {
    background: linear-gradient(45deg, var(--primary-color), #1a4a7c);
    color: var(--white-color);
    text-align: center;
}
.final-cta h2, .final-cta p {
    color: var(--white-color);
}
.final-cta .cta-button {
    background: var(--accent-color);
    color: var(--primary-color);
    box-shadow: none;
}
.final-cta .cta-button:hover {
    background: #ffac00;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-color);
    color: var(--light-gray-color);
    text-align: center;
    padding: 25px 0;
    font-size: 0.9rem;
}

/* --- Página de Contacto --- */
.contact-page {
    padding: 80px 0;
}
.contact-wrapper {
    display: flex;
    gap: 50px;
    background: var(--white-color);
    padding: 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.contact-form-container { flex: 2; }
.contact-info-container { flex: 1; }
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1rem;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}
.contact-info-container h3 {
    margin-top: 0;
}
.contact-info-container p {
    margin-bottom: 1.5rem;
}
.availability {
    font-style: italic;
    font-size: 0.9rem;
    color: #555;
}

/* --- Estilos para mensajes de estado del formulario --- */
#form-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    display: block;
}
#form-status p {
    margin: 0;
    font-weight: 500;
}
.success-message {
    background-color: #e9f7ea;
    color: #28a745;
    border: 1px solid #a3d9b1;
}
.error-message {
    background-color: #f8d7da;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}
.info-message {
    background-color: #e7f3fe;
    color: #007bff;
    border: 1px solid #b8daff;
}

/* --- Modal --- */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: var(--white-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1002;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}
.modal-content article h1 { font-size: 2rem; }
.modal-content article ul { list-style-position: inside; padding-left: 20px; }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    h1 { font-size: 2.4rem; }
    h2 { font-size: 2rem; }
    .contact-wrapper { flex-direction: column; padding: 30px; }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px; /* Ajustar a la altura del header */
        left: 0;
        background-color: var(--white-color);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        text-align: center;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-menu li {
        margin: 0;
    }
    .nav-link {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    .nav-link.contact-link {
        border-radius: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    .resource-item {
        flex-direction: column;
        text-align: center;
    }
    .resource-text {
        margin-bottom: 20px;
    }
}

/* --- SIMP-HCA Section (landing con imagen al lado) --- */
.simp-hca-grid{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  align-items: center;
}

/* En esta sección el header queda alineado a la izquierda (en vez de centrado) */
.section-header.simp-hca-header{
  text-align: left;
  margin-bottom: 20px;
}
.section-header.simp-hca-header h2::after{
  margin: 16px 0 0; /* subrayado alineado a la izquierda */
}

/* El intro en esta sección no debe quedar centrado con max-width */
.section-intro.simp-hca-intro{
  max-width: none;
  margin: 0 0 18px 0;
}

/* Lista más limpia dentro de la landing */
.simp-hca-bullets{
  margin: 0 0 22px 0;
  padding-left: 18px;
}
.simp-hca-bullets li{
  margin-bottom: 10px;
  color: #555;
}

/* Imagen */
.simp-hca-figure{
  margin: 0;
}
.simp-hca-figure img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  background: var(--white-color);
}

/* Responsive: apilar texto e imagen */
@media (max-width: 900px){
  .simp-hca-grid{
    grid-template-columns: 1fr;
  }
}

/* Estilo para el separador de secciones */
.section-divider {
    border-bottom: 1px solid #ddd;
    margin: 60px 0;
}

/* Ajuste para centrar el header de la sección SIMP-HCA a petición */
.section-header.simp-hca-header {
    text-align: center;
}