/* =========================================================
   LAYOUT GENERAL (NAV / MAIN / FOOTER)
   ========================================================= */

.layout {
    display: flex;
    flex-direction: column;
    width: 100dvw;
    min-height: 100dvh;
}



/* =========================================================
   NAVEGACIÓN SUPERIOR
   Altura controlada desde su propio CSS (nav.css)
   ========================================================= */

.nav-secundaria {
    flex-shrink: 0;
    background-color: var(--color-primario);
    margin-bottom: 0;
    /* min-width: 400px; */
}

.nav-secundaria ul {
    background-color: transparent;
}

.nav-secundaria ul li {
    background-color: transparent;
}

.nav-secundaria ul li a {
    color: var(--color-blanco);
}


.nav-secundaria a::after {
    background-color: var(--color-blanco);
    height: 3px;
}

.nav-secundaria a:hover::after {
    width: 100%;
}

/* =========================================================
   CONTENIDO PRINCIPAL
   Ocupa todo el espacio disponible entre nav y footer
   ========================================================= */

main {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    /* MUY IMPORTANTE */
    overflow: visible;
}

.contenedor {
    padding: 0;
    margin: 15px auto;
}

/* =========================================================
   FOOTER
   Altura controlada desde su propio CSS
   ========================================================= */
.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-top: 0;
    /* min-width: 400px; */
}

/* --- Grupos de footer --- */
.footer-group {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 0.1rem 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Separador solo dentro de cada grupo */
.footer-group li:not(:last-child)::after {
    content: "|";
    margin-left: 20px;
    color: #ffffff;
}

/* Separación visual entre grupos en desktop */
.footer-group+.footer-group {
    margin-left: 2rem;
}

/* Accesibilidad: foco visible */
.footer-legal a:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
    border-radius: 4px;
}

/*Contraste/foco*/
.footer-legal a {
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    padding-bottom: 0px;
}

/* Separador visual ENTRE grupos en desktop */
@media (min-width: 833px) {

    .footer-group+.footer-group {
        margin-left: 1rem;
    }

    .footer-group+.footer-group::before {
        content: "|";
        color: #ffffff;
        font-weight: 400;
        opacity: 1;
    }

}

@media (min-width: 833px) and (max-width: 944px) {

    .footer-group+.footer-group::before {
        opacity: 0;
    }
}

/* --- Responsive: móvil --- */
@media (max-width: 832px) {

    .footer-legal {
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
    }

    .footer-group {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }

    .footer-group+.footer-group {
        margin-left: 0rem;
    }

    .footer-legal li {
        margin-bottom: 0rem;
    }

    /* Quitar separadores en móvil */
    .footer-legal li::after,
    .footer-group li::after,
    .footer-legal li:not(:last-child)::after,
    .footer-group li:not(:last-child)::after {
        content: "" !important;
        margin: 0 !important;
    }

    /* Títulos opcionales si se añaden después */
    .footer-group::before {
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .footer-group-nav::before {
        content: "Navegación";
    }

    .footer-group-legal::before {
        content: "Legal y privacidad";
    }
}


/******************************************************************************************************************************/
/* .footer-legal {
    order: -1;
} */

.logo-index {
    display: block;
    width: 40px;
    height: auto;
}

.logo-index .st1 {
    fill: #155A44;
    stroke: #155A44;
    stroke-miterlimit: 10;
}

.logo-index .st2 {
    fill: #FFFFFF;
    stroke: #FFFFFF;
    stroke-width: 0.5;
    stroke-miterlimit: 10;
}

.logo-index .st3 {
    fill: #FFFFFF;
}



/* =========================================================
   LOGIN – CONTENEDOR GENERAL
   Se centra dentro del main sin romper el layout
   ========================================================= */

.login-wrapper {
    font-family: var(--fuente-base);
    font-size: large;
    width: 100%;
    min-height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   LOGIN – CAJA DEL FORMULARIO
   ========================================================= */

.login-box {
    width: 400px;
    padding: 2rem 3rem;
    background-color: var(--color-blanco);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-caja);
    font-size: 1.3rem;
}

.login-box h1 {
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
}

@media (max-width: 400px) {
    .login-box {
        width: 320px;
        padding: 2rem 1.2rem;
    }
}

/* =========================================================
   CAMPOS DEL FORMULARIO
   ========================================================= */

.login-field {
    margin-bottom: 1rem;
}

.login-field label {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
}

.login-input {
    width: 100%;
    padding: 0.3rem;
    font-size: large;
    border: 1px solid var(--color-borde-input);
    border-radius: 4px;
}


/* =========================================================
   BOTÓN PRINCIPAL
   ========================================================= */

.login-btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    background-color: var(--color-primario);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.login-btn:hover {
    opacity: 0.8;
    transform: translateX(3px);
}


/* =========================================================
   MENSAJE DE ERROR / ESTADO
   Mantiene altura fija para evitar saltos visuales
   ========================================================= */

.login-message {
    height: 1.5em;
    line-height: 1.5em;
    margin-top: 1rem;
    font-size: 1rem;
    text-align: center;
    color: var(--color-error);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

/* Visible solo cuando hay contenido */
.login-message:not(:empty) {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   TRANSICIÓN DE SALIDA DEL LOGIN
   ========================================================= */

.login-fade-out {
    opacity: 0;
    transition: opacity 0.6s ease;
}


/* =========================================================
   CONTRASEÑA – MOSTRAR / OCULTAR
   ========================================================= */

.password-container {
    position: relative;
    /* display: flex;
    align-items: center; */
}

.password-container .login-input {
    padding-right: 2.5rem;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 51%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
}

.toggle-password:hover {
    transform: translateY(-50%) scale(1.1);
}

.toggle-password.active {
    color: var(--color-boton-hover);
}

/********************************************************************/
.toggle-password svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toggle-password .icon-eye {
    display: block;
}

.toggle-password .icon-eye-slash {
    display: none;
}

/* Cuando está activo (modo texto visible) */
.toggle-password.show .icon-eye {
    display: none;
}

.toggle-password.show .icon-eye-slash {
    display: block;
}


/* =========================================================
   ACCESIBLE - ALTO CONTRASTE
   ========================================================= */
body.contraste-alto .login-box {
    color: #000 !important;
}

/*Eliminamos el borde amarillo del focus en modo normal, pero NO en contraste alto*/
body:not(.contraste-alto) #loginLayer input:focus-visible {
    outline: none;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.25);
}