/* --- 1. VARIABLES DE COLOR INSTITUCIONAL --- */
:root {
    /* Colores DGETI / Institucionales OFICIALES */
    --guinda-principal: #9B227;  /* Guinda Oficial */
    --guinda-oscuro: #611232;     /* Guinda Oscuro (Degradados) */
    --dorado-acento: #BC955C;     /* Dorado (Complementario) */
    
    /* Estos se quedan igual */
    --gris-oxford: #2C3E50;       
    --gris-claro: #F8F9FA;        
    --blanco: #FFFFFF;
    --fuente-titulos: 'Montserrat', sans-serif;
    --fuente-texto: 'Open Sans', sans-serif;
}

/* --- 2. RESET Y ESTILOS GENERALES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--fuente-texto);
    color: var(--gris-oxford);
    background-color: var(--blanco);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--fuente-titulos);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--guinda-principal);
    color: var(--blanco);
}

.btn-primary:hover {
    background-color: var(--guinda-oscuro);
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--guinda-principal);
    color: var(--guinda-principal);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--guinda-principal);
    color: var(--blanco);
}

/* --- NUEVO: BARRA SUPERIOR (TOP BAR) --- */
.top-bar {
    background-color: var(--gris-oxford);
    color: #ccc;
    padding: 8px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.top-bar .container {
    display: flex;
    justify-content: flex-end; /* Alineado a la derecha */
    gap: 20px;
}

.top-bar a:hover {
    color: var(--blanco);
    text-decoration: underline;
}

.top-bar i {
    margin-right: 5px;
    color: var(--dorado-acento);
}

/* --- 3. HEADER (Pegajoso) --- */
header {
    background-color: var(--blanco);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
    border-bottom: 4px solid var(--guinda-principal);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%; /* Asegura que el contenedor respete la altura del header */
}

/* --- CORRECCIÓN DEL LOGO (VERSIÓN DEFINITIVA) --- */
/* Ahora usamos ".logo-area img" en lugar de ".logo-img".
   Esto atrapará TU imagen aunque no tenga la clase puesta. */
.logo-area img {
    height: auto !important;      /* !important fuerza al navegador a obedecer */
    max-height: 60px !important;  /* Límite estricto de altura */
    width: auto;            
    max-width: 250px;             /* Límite de ancho por si acaso */
    display: block;         
    object-fit: contain;
}

.logo-text {
    font-family: var(--fuente-titulos);
    font-size: 1.2rem;
    color: var(--gris-oxford);
    font-weight: 700;
    line-height: 1.2;
}

.logo-text span {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: #666;
}

/* Navegación Desktop */
nav ul {
    display: flex;
    gap: 25px;
    align-items: center;
}

nav ul li a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gris-oxford);
    position: relative;
}

nav ul li a:hover {
    color: var(--guinda-principal);
}

.btn-nav-destacado {
    background-color: var(--gris-oxford);
    color: var(--blanco) !important;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.btn-nav-destacado:hover {
    background-color: var(--guinda-principal);
}

/* Menú Móvil Icono */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: var(--guinda-principal);
    cursor: pointer;
}

/* --- 4. HERO SECTION (Banner Principal) --- */
.hero {
    position: relative;
    height: 70vh; /* Altura del banner */
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--blanco);
    overflow: hidden;
    background-color: #333; /* Color de fondo mientras carga imagen */
}

/* Imagen de fondo del Hero */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.5; /* Oscurecer para leer texto */
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(128, 0, 32, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
    animation: fadeIn 1s ease-out;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* --- 5. ACCESOS RÁPIDOS (Barra de Iconos) --- */
.quick-access {
    background-color: var(--gris-claro);
    padding: 3rem 0;
    border-bottom: 1px solid #ddd;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    text-align: center;
}

.access-item {
    background: var(--blanco);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    border-top: 3px solid transparent;
}

.access-item:hover {
    transform: translateY(-5px);
    border-top: 3px solid var(--guinda-principal);
}

.access-icon {
    font-size: 2.5rem;
    color: var(--guinda-principal);
    margin-bottom: 15px;
}

.access-title {
    font-weight: 700;
    color: var(--gris-oxford);
    font-size: 1.1rem;
}

/* --- 6. OFERTA EDUCATIVA (Tarjetas) --- */
.specialties {
    padding: 5rem 0;
    background-color: var(--blanco);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--guinda-principal);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.section-header p {
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.career-card {
    background: var(--blanco);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s;
    border: 1px solid #eee;
}

.career-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.career-img-container {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.career-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.career-card:hover .career-img {
    transform: scale(1.05);
}

.career-info {
    padding: 20px;
}

.career-info h3 {
    color: var(--gris-oxford);
    margin-bottom: 10px;
}

.career-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--guinda-principal);
    font-weight: 700;
    font-size: 0.9rem;
}

/* --- 7. NOTICIAS (Grid simple) --- */
.news-section {
    padding: 5rem 0;
    background-color: #f0f2f5;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px; /* Margen de seguridad para móviles */
}

.news-item {
    background: var(--blanco);
    padding: 20px;
    border-left: 4px solid var(--guinda-principal);
}

.news-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
    display: block;
}

.news-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 700;
}

/* --- 8. FOOTER (Institucional) --- */
footer {
    background-color: var(--gris-oxford);
    color: var(--blanco);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 3rem;
}

.footer-col h3 {
    border-bottom: 2px solid var(--guinda-principal);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: inline-block;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: var(--dorado-acento);
    padding-left: 5px;
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.official-logos {
    background-color: #1a252f;
    padding: 20px 0;
    text-align: center;
}

.official-logos img {
    height: 50px;
    margin: 0 15px;
    opacity: 0.8;
    filter: grayscale(100%);
    transition: 0.3s;
}

.official-logos img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* --- 9. RESPONSIVE --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px; left: 0; width: 100%;
        background: var(--blanco);
        padding: 20px;
        box-shadow: 0 5px 5px rgba(0,0,0,0.1);
    }
    nav ul.active { display: flex; }
    .hero h1 { font-size: 2rem; }
    header { padding: 0 10px; }
    
    /* Ajuste para la top-bar en móvil */
    .top-bar .container {
        justify-content: center;
    }
}

/* Animación simple */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 10. ESTILOS DE LOGIN (ADMINISTRATIVO) --- */
.login-wrapper {
    min-height: 80vh; /* Ocupa casi toda la pantalla */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gris-claro);
    padding: 20px;
    background-image: linear-gradient(rgba(44, 62, 80, 0.05), rgba(128, 0, 32, 0.05)); /* Textura sutil */
}

.login-card {
    background: var(--blanco);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 5px solid var(--guinda-principal); /* Detalle institucional arriba */
    animation: fadeIn 0.5s ease-out;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--gris-oxford);
    font-size: 1.5rem;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: var(--fuente-texto);
    font-size: 1rem;
    transition: border 0.3s;
}

.form-control:focus {
    border-color: var(--guinda-principal);
    outline: none;
    box-shadow: 0 0 5px rgba(128, 0, 32, 0.2);
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

.login-footer-link {
    margin-top: 25px;
    font-size: 0.85rem;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.login-footer-link a {
    color: var(--guinda-principal);
    font-weight: 600;
}

.login-footer-link a:hover {
    text-decoration: underline;
}