/* --- Reseteo y Base --- */
:root {
    --color-primary: #2563eb; /* blue-600 */
    --color-primary-dark: #1d4ed8; /* blue-700 */
    --color-secondary: #4b5563; /* gray-600 */
    --color-text-light: #ffffff;
    --color-text-dark: #1f2937; /* gray-800 */
    --color-bg-light: #f9fafb; /* gray-50 */
    --color-bg-medium: #f3f4f6; /* gray-100 */
}
*, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: #e5e7eb; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: ui-sans-serif, system-ui, sans-serif; scroll-behavior: smooth; }
body { margin: 0; line-height: 1.75; font-family: 'Segoe UI', Roboto, sans-serif; background-color: var(--color-bg-light); color: var(--color-text-dark); font-size: 1.10rem; }

/* --- Estructura y Contenedores --- */
.container { width: 100%; margin-left: auto; margin-right: auto; padding-left: 1.5rem; padding-right: 1.5rem; }
@media (min-width: 768px) { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
main { display: block; }
.section { padding-top: 5rem; padding-bottom: 5rem; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title .subtitle { color: var(--color-primary); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.section-title h2 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 800; margin-top: 0.5rem; }
.section-title p { color: var(--color-secondary); margin-top: 1rem; max-width: 42rem; margin-left: auto; margin-right: auto; font-size: 1.25rem; }

/* --- Header y Navegación --- */
header { background-color: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); position: sticky; top: 0; z-index: 50; }
header nav { padding-top: 0.75rem; padding-bottom: 0.75rem; display: flex; justify-content: space-between; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.logo-container .logo { height: 3rem; width: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2)) hue-rotate(-25deg) saturate(200%); }
.logo-container .logo-text {font-size: 1.5rem; line-height: 2rem; color:var(--color-primary); text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.logo-container .font-light { font-weight: 300; }
.logo-container .font-bold { font-weight: 700; }
.main-nav { display: none; }
@media (min-width: 768px) { .main-nav { display: flex; align-items: center; gap: 2rem; font-size: 1.125rem; } }
.main-nav a { color: var(--color-secondary); font-weight: 500; text-decoration: none; transition: color 0.3s ease; }
.main-nav a:hover { color: var(--color-primary); }
.portal-button { display: none; }
@media (min-width: 1024px) { .portal-button { display: inline-block; background-color: var(--color-primary); color: var(--color-text-light); font-weight: 700; padding: 0.5rem 1.5rem; border-radius: 0.5rem; text-decoration: none; transition: background-color 0.3s ease; } .portal-button:hover { background-color: var(--color-primary-dark); } }
#mobile-menu-btn { font-size: 1.5rem; color: var(--color-text-dark); background: none; border: none; cursor: pointer; }
@media (min-width: 768px) { #mobile-menu-btn { display: none; } }
#mobile-menu { display: none; background-color: white; padding: 0.5rem 0; }
#mobile-menu a { display: block; text-align: center; padding: 0.75rem 1rem; color: var(--color-secondary); text-decoration: none; font-weight: 600; }
#mobile-menu a:hover { background-color: var(--color-bg-medium); }
#mobile-menu .portal-button-mobile-container { margin: 1rem; }
#mobile-menu .portal-button-mobile { display: block; width: 100%; text-align: center; background-color: var(--color-primary); color: var(--color-text-light); font-weight: 700; padding: 0.75rem 1.5rem; border-radius: 0.5rem; text-decoration: none; }

/* --- Hero Section --- */
.hero-bg { text-align: center; color: white; background: linear-gradient(rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 0.8)), url('https://images.unsplash.com/photo-1521737711867-e3b97375f902?q=80&w=1974&auto=format&fit=crop') center/cover; }
.hero-bg h1 { font-size: 2.5rem; line-height: 1.25; font-weight: 800; margin-bottom: 1rem; }
.hero-bg p { font-size: 1.25rem; line-height: 1.75rem; color: #d1d5db; max-width: 48rem; margin-left: auto; margin-right: auto; margin-bottom: 2rem; }
.hero-bg .cta-button { display: inline-block; background-color: var(--color-primary); color: var(--color-text-light); font-weight: 700; padding: 0.75rem 2rem; border-radius: 0.5rem; text-decoration: none; transition: all 0.3s ease; }
.hero-bg .cta-button:hover { background-color: var(--color-primary-dark); transform: scale(1.05); }
@media (min-width: 768px) { .hero-bg h1 { font-size: 3.75rem; } }

/* --- Secciones CoreGestión y Servicios --- */
/* CORRECCIÓN: Se añaden estilos al contenedor de presentación */
.feature-presentation {
    display: grid;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -4px rgb(0 0 0 / 0.07);
}
@media (min-width: 768px) { .feature-presentation { grid-template-columns: repeat(2, 1fr); padding: 3rem; } }
.feature-presentation .feature-text h3 { font-size: 1.675rem; line-height: 2.25rem; font-weight: 700; margin-bottom: 1rem; }
.feature-presentation .feature-text p { color: #4b5563; }
.feature-presentation .feature-image img { border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); width: 100%; height: auto; }
.accordion { max-width: 48rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.accordion-item { background-color: white; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.accordion-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; cursor: pointer; }
.accordion-header:hover { background-color: #f9fafb; }
.accordion-header h3 { font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 0.75rem; }
.accordion-header h3 i { color: var(--color-primary); }
.accordion-header .chevron { transition: transform 0.3s ease; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.5s ease-in-out; }
.accordion-content div { padding: 1.5rem; border-top: 1px solid #e5e7eb; background-color: rgba(239, 246, 255, 0.5); }
.services-section { background-color: var(--color-bg-medium); }
.services-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }
.service-card { background-color: white; padding: 2rem; border-radius: 0.75rem; text-align: center; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); transition: transform 0.3s ease; }
.service-card:hover { transform: translateY(-0.5rem); }
.service-card i { font-size: 2.25rem; color: var(--color-primary); margin-bottom: 1rem; }
.service-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.service-card p { color: var(--color-secondary); }

/* --- Sección Contacto --- */
.contact-form-container { max-width: 42rem; margin-left: auto; margin-right: auto; background-color: white; padding: 2rem; border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.form-grid { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }
.form-group { margin-bottom: 1.5rem; }
.contact-form-container input, .contact-form-container textarea { width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 0.5rem; transition: all 0.3s ease; font-size: 1rem; }
.contact-form-container input:focus, .contact-form-container textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
.submit-button { width: 100%; background-color: var(--color-primary); color: var(--color-text-light); font-weight: 700; padding: 0.75rem 1.5rem; border-radius: 0.5rem; transition: background-color 0.3s ease; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; cursor: pointer; }
.submit-button:hover { background-color: var(--color-primary-dark); }
#form-message { margin-top: 1rem; text-align: center; font-weight: 600; }

/* --- Footer --- */
footer { background-color: var(--color-text-dark); color: white; padding: 2rem; }
footer p { text-align: center; }

/* --- ESTILOS FINALES PARA EL CARRUSEL --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.8); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 1000; opacity: 0; transition: opacity 0.3s ease; }
.modal-content { background-color: transparent; box-shadow: none; width: 90%; max-width: 1000px; padding: 0; position: relative; }
.modal-close-btn { position: absolute; top: -1rem; right: -1rem; font-size: 2.5rem; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); background-color: transparent; border: none; cursor: pointer; z-index: 20; transition: transform 0.2s ease, opacity 0.2s ease; opacity: 0.8; }
.modal-close-btn:hover { opacity: 1; transform: scale(1.1); }
.carousel-viewport { position: relative; width: 100%; overflow: hidden; border-radius: 0.75rem; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5); aspect-ratio: 16 / 9; }
#carousel-images { display: flex; height: 100%; transition: transform 0.5s ease-in-out; }
.carousel-item { flex-shrink: 0; width: 100%; height: 100%; }
.carousel-image { width: 100%; height: 100%; object-fit: contain; } /* CORRECCIÓN CLAVE */
.carousel-control { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0,0,0,0.3); color: white; border-radius: 50%; width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; transition: background-color 0.3s ease; border: none; cursor: pointer; }
.carousel-control:hover { background-color: rgba(0,0,0,0.5); }
.carousel-control.prev { left: 1rem; }
.carousel-control.next { right: 1rem; }
.carousel-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.75rem; }
.carousel-dots button { width: 0.75rem; height: 0.75rem; border-radius: 50%; background-color: rgba(255, 255, 255, 0.5); border: none; cursor: pointer; transition: background-color 0.3s ease; }
.carousel-dots button.active { background-color: white; }

/* --- Animaciones y Utilidades --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; margin-left: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }