/* Configuración General */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
}

/* --- ESTILOS DEL LOGIN --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-login:hover {
    background-color: #2980b9;
}

.error-msg {
    color: #e74c3c;
    background: #fde8e7;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
}

/* --- ESTILOS DEL MENÚ RESPONSIVO (DOS NIVELES) --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    padding: 0 30px; /* Reducido para alineación perfecta */
    height: 60px;
    color: white;
    position: relative;
    z-index: 1000;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
    height: 100%;
}

.nav-links > li {
    position: relative; /* Base para el posicionamiento absoluto del submenú */
    display: flex;
    align-items: center;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    width: 100%;
    transition: background 0.3s;
}

.nav-links > li > a:hover {
    background-color: #34495e;
}

.arrow {
    font-size: 12px;
    margin-left: 5px;
}

/* --- ESTILOS DEL SUBMENÚ (SEGUNDO NIVEL) --- */
.submenu {
    display: none; /* Oculto por defecto */
    position: absolute;
    top: 60px; /* Justo debajo de la barra principal */
    left: 0;
    background-color: #34495e;
    min-width: 200px;
    list-style: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 0 0 4px 4px;
}

.submenu li a {
    padding: 12px 20px;
    font-size: 15px;
}

.submenu li a:hover {
    background-color: #1abc9c; /* Color de énfasis al pasar el cursor */
}

/* Mostrar submenú en pantallas grandes con Hover */
.has-submenu:hover .submenu {
    display: block;
}

/* Checkbox Hack para menú móvil */
#menu-toggle {
    display: none;
}

.menu-icon {
    display: none;
    font-size: 28px;
    cursor: pointer;
}

.content {
    padding: 20px;
    text-align: center;
}



/* --- MEDIA QUERIES (COMPORTAMIENTO MÓVIL) --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }

    .menu-icon {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: #2c3e50;
        border-top: 1px solid #34495e;
        height: auto;
    }

    .nav-links > li {
        display: block; /* Cambia a bloque en móviles */
        width: 100%;
    }

    .nav-links li a {
        padding: 15px 20px;
    }

    /* Mostrar menú móvil al activar el icono hamburguesa */
    #menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    /* Ajustes para el Submenú en móviles */
    .submenu {
        position: relative; /* Se despliega empujando el contenido hacia abajo */
        top: 0;
        width: 100%;
        background-color: #1f2c39; /* Un tono más oscuro para distinguir niveles */
        box-shadow: none;
    }

    .submenu li a {
        padding-left: 40px; /* Sangría para denotar jerarquía */
    }

    /* En móviles, el submenú se muestra automáticamente al abrir el menú 
       o puedes mantener el hover táctil. Para esta solución limpia CSS, 
       se despliega de forma nativa al pulsar el elemento padre */
    .has-submenu:hover .submenu {
        display: block;
    }
}
