:root {
    --morado: #4a2e83;
    --morado-claro: #7653a6;
    --naranja: #ff6339;
    --blanco: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;

    background:
        linear-gradient(
            135deg,
            #6c4f91 0%,
            #9d87a8 48%,
            #e2d5ce 100%
        );

    color: var(--morado);
}

/* Contenedor del login */
header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Contenedor principal */
.login-wrapper {
    width: min(100%, 325px);
    margin: 0 auto;
    position: relative;
}

/* Tarjeta del formulario */
#loginForm {
    width: 100%;
    padding: 20px 22px 22px;

    background: rgba(221, 207, 224, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;

    box-shadow:
        0 18px 40px rgba(63, 35, 82, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Título */
.login-title {
    width: 100%;
    text-align: center;
    margin-bottom: 16px;
}

.login-title h1 {
    margin: 0 0 10px;
    color: var(--morado);
    font-size: 17px;
    font-weight: 700;
}

.login-title hr {
    width: 100% !important;
    margin: 0 auto !important;
    border: 0 !important;
    height: 2px;
    background: linear-gradient(
        90deg,
        #6f1fa1,
        #ff5f3b
    );
}

/* Logo circular */
.avatar-circle {
    width: 82px;
    height: 82px;
    margin: 0 auto 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    border-radius: 50%;

    box-shadow: 0 5px 10px rgba(51, 31, 75, 0.28);

    overflow: hidden;
}

.avatar-circle img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    border-radius: 50%;
}

/* Etiquetas */
#loginForm label {
    display: inline-block;
    margin-bottom: 8px;

    color: var(--morado);
    font-size: 13px;
    font-weight: 600;
}

/* Elimina espacio excesivo provocado por los br */
#loginForm br + br {
    display: none;
}

/* Campos */
#loginForm input,
#loginForm select {
    width: 100%;
    height: 34px;
    margin-bottom: 22px;
    padding: 7px 12px;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;

    background: rgba(236, 225, 232, 0.6);
    color: #302a34;

    outline: none;
    font-size: 12px;

    box-shadow:
        inset 0 1px 3px rgba(72, 45, 82, 0.08);

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

#loginForm input:focus,
#loginForm select:focus {
    background: rgba(255, 255, 255, 0.77);
    border-color: var(--morado);

    box-shadow:
        0 0 0 3px rgba(74, 46, 131, 0.18);
}

.password-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 34px;
    margin-bottom: 22px;
}

.password-wrapper input {
    margin-bottom: 0 !important;
    padding-right: 38px;
}

#togglePasswordBtn {
    position: absolute;
    top: 50%;
    right: 8px;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--morado);
    cursor: pointer;
}

#togglePasswordBtn svg {
    display: block;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

#togglePasswordBtn .icon-eye-open {
    display: none;
}

#togglePasswordBtn.is-visible .icon-eye-closed {
    display: none;
}

#togglePasswordBtn.is-visible .icon-eye-open {
    display: block;
}

/* Opciones del select */
#loginForm select option {
    color: var(--morado);
    background: #ffffff;
}

/* Botón Entrar */
#loginForm > button[type="submit"] {
    width: 100%;
    height: 29px;
    padding: 0;

    border: none;
    border-radius: 11px;

    background: linear-gradient(
        90deg,
        #633297 0%,
        #ff6239 100%
    );

    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;

    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

#loginForm > button[type="submit"]:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);

    box-shadow:
        0 6px 14px rgba(89, 45, 135, 0.24);
}

/* Enlace de recuperación */
.recovery-link {
    margin-top: 14px;
    text-align: center;
}

.recovery-link__btn {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.recovery-link__btn:hover {
    text-decoration: underline;
}

/* Error junto al campo (usuario, contraseña o datos de acceso) */
.login-error-campo {
    margin: 6px 0 0;
    padding: 7px 10px;
    border-left: 4px solid #b42318;
    border-radius: 6px;
    background: #fdecea;
    color: #8a1c13;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
}

/* Mensajes */
#message {
    margin-top: 12px;
    color: #ffffff;
    font-size: 13px;
    text-align: center;
}

/* Pie de página */
footer {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
    font-size: 12px;
}

footer p {
    margin: 4px 0;
}

/* Ventana de recuperación */
.recovery-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
}

.recovery-modal.is-open {
    display: flex;
}

.recovery-modal__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(41, 24, 58, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.recovery-modal__panel {
    position: relative;
    z-index: 1;

    width: min(100%, 390px);
    max-height: 90vh;
    overflow-y: auto;

    padding: 26px;

    background: rgba(229, 216, 231, 0.97);
    color: var(--morado);

    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 18px;

    box-shadow:
        0 24px 65px rgba(34, 20, 47, 0.4);
}

.recovery-modal__panel h2 {
    margin: 0 35px 10px 0;

    color: var(--morado);
    font-size: 20px;
}

.recovery-modal__panel > p {
    margin: 0 0 18px;

    color: #665d6b;
    font-size: 13px;
    line-height: 1.5;
}

/* Botón cerrar */
.recovery-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;

    width: 32px;
    height: 32px;
    padding: 0;

    border: none;
    border-radius: 50%;

    background: rgba(74, 46, 131, 0.12);
    color: var(--morado);

    font-size: 21px;
    line-height: 30px;
    cursor: pointer;
}

.recovery-modal__close:hover {
    background: rgba(74, 46, 131, 0.22);
}

/* Formulario de recuperación */
.recovery-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recovery-form label {
    margin-top: 5px;

    color: var(--morado);
    font-size: 13px;
    font-weight: 600;
}

.recovery-form input,
.recovery-form select {
    width: 100%;
    height: 38px;
    padding: 8px 12px;

    border: 1px solid #cbbdd0;
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.72);
    color: #302a34;

    outline: none;
}

.recovery-form input:focus,
.recovery-form select:focus {
    border-color: var(--morado);

    box-shadow:
        0 0 0 3px rgba(74, 46, 131, 0.15);
}

.recovery-form button {
    width: 100%;
    height: 36px;
    margin-top: 8px;

    border: none;
    border-radius: 10px;

    background: linear-gradient(
        90deg,
        #633297,
        #ff6239
    );

    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.recovery-form button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.recovery-help {
    margin: 6px 0;
    padding: 10px;

    background: rgba(74, 46, 131, 0.08);
    border-radius: 9px;

    color: #5c4a69;
    font-size: 12px;
    line-height: 1.4;
}

.recovery-message {
    min-height: 18px;
    margin: 5px 0 0;

    color: #39764e;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* Adaptación para celulares */
@media (max-width: 480px) {
    body {
        justify-content: flex-start;
        padding-top: 25px;
    }

    .login-wrapper {
        width: min(100%, 340px);
    }

    #loginForm {
        padding: 18px;
        border-radius: 16px;
    }

    .avatar-circle {
        width: 74px;
        height: 74px;
    }

    .recovery-modal__panel {
        padding: 22px 18px;
    }
}
/* Página completa de recuperación de contraseña */
.recovery-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}

.recovery-page .login-wrapper {
    width: min(100%, 325px);
    margin: 0 auto;
}

.recovery-page-form {
    width: 100%;
    padding: 20px 22px 22px;

    background: rgba(221, 207, 224, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;

    box-shadow:
        0 18px 40px rgba(63, 35, 82, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.recovery-page-form h1 {
    margin: 0 0 10px;
    text-align: center;
    color: #4a2e83;
    font-size: 17px;
    font-weight: 700;
}

.recovery-page-form hr {
    width: 100%;
    margin: 0 auto 16px;
    border: 0;
    height: 2px;

    background: linear-gradient(
        90deg,
        #6f1fa1,
        #ff5f3b
    );
}

.recovery-page-form .avatar-circle {
    width: 82px;
    height: 82px;
    margin: 0 auto 14px;
}

.recovery-page-form label {
    display: block;
    margin-bottom: 8px;
    color: #4a2e83;
    font-size: 13px;
    font-weight: 600;
}

.recovery-page-form input,
.recovery-page-form select {
    width: 100%;
    height: 34px;
    margin-bottom: 18px;
    padding: 7px 12px;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;

    background: rgba(236, 225, 232, 0.6);
    color: #302a34;

    outline: none;
    box-sizing: border-box;
    font-size: 12px;
}

.recovery-page-form input:focus,
.recovery-page-form select:focus {
    background: rgba(255, 255, 255, 0.77);
    border-color: #4a2e83;
    box-shadow: 0 0 0 3px rgba(74, 46, 131, 0.18);
}

.recovery-page-form button {
    width: 100%;
    height: 29px;
    padding: 0;

    border: none;
    border-radius: 11px;

    background: linear-gradient(
        90deg,
        #633297 0%,
        #ff6239 100%
    );

    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.recovery-page-form .back-login {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: #4a2e83;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.recovery-page-form .back-login:hover {
    text-decoration: underline;
}

/* =====================================================
   PÁGINA INDEPENDIENTE DE RECUPERACIÓN
   No modifica los estilos del index.html
===================================================== */

body.recovery-page {
    min-height: 100vh;
    margin: 0;
    padding: 30px 16px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #6c4f91 0%,
            #9d87a8 48%,
            #e2d5ce 100%
        );

    font-family: Arial, Helvetica, sans-serif;
    color: var(--morado);
}

/* Contenedor general */
.recovery-page header {
    width: 100%;
    display: flex;
    justify-content: center;
}

.recovery-page .login-wrapper {
    width: min(100%, 325px);
    margin: 0 auto;
}

/* Tarjeta principal */
.recovery-page .recovery-page-form {
    width: 100%;
    padding: 20px 22px 22px;

    background: rgba(221, 207, 224, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 18px;

    box-shadow:
        0 18px 40px rgba(63, 35, 82, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Título */
.recovery-page .login-title {
    width: 100%;
    margin-bottom: 16px;
    text-align: center;
}

.recovery-page .login-title h1 {
    margin: 0 0 10px;

    color: var(--morado);
    font-size: 17px;
    font-weight: 700;
}

.recovery-page .login-title hr {
    width: 100% !important;
    height: 2px;
    margin: 0 auto !important;

    border: none !important;

    background: linear-gradient(
        90deg,
        #6f1fa1,
        #ff5f3b
    );
}

/* Logo */
.recovery-page .avatar-circle {
    width: 82px;
    height: 82px;
    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    border-radius: 50%;

    box-shadow: 0 5px 10px rgba(51, 31, 75, 0.28);

    overflow: hidden;
}

.recovery-page .avatar-circle img {
    width: 82%;
    height: 82%;

    object-fit: contain;
    border-radius: 50%;
}

/* Etiquetas */
.recovery-page .recovery-page-form label {
    display: block;
    margin-bottom: 7px;

    color: var(--morado);
    font-size: 13px;
    font-weight: 600;
}

/* Oculta el espacio adicional de los <br><br> */
.recovery-page .recovery-page-form br + br {
    display: none;
}

/* Campos */
.recovery-page .recovery-page-form input,
.recovery-page .recovery-page-form select {
    width: 100%;
    height: 34px;
    margin-bottom: 18px;
    padding: 7px 12px;

    box-sizing: border-box;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;

    background: rgba(236, 225, 232, 0.6);
    color: #302a34;

    font-family: inherit;
    font-size: 12px;

    outline: none;

    box-shadow:
        inset 0 1px 3px rgba(72, 45, 82, 0.08);

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.recovery-page .recovery-page-form input:focus,
.recovery-page .recovery-page-form select:focus {
    background: rgba(255, 255, 255, 0.77);
    border-color: var(--morado);

    box-shadow:
        0 0 0 3px rgba(74, 46, 131, 0.18);
}

.recovery-page .recovery-page-form select option {
    color: var(--morado);
    background: #ffffff;
}

/* Botón enviar */
.recovery-page .recovery-page-form button[type="submit"] {
    width: 100%;
    height: 29px;
    padding: 0;

    border: none;
    border-radius: 11px;

    background: linear-gradient(
        90deg,
        #633297 0%,
        #ff6239 100%
    );

    color: #ffffff;
    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

.recovery-page .recovery-page-form button[type="submit"]:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);

    box-shadow:
        0 6px 14px rgba(89, 45, 135, 0.24);
}

/* Regresar al login */
.recovery-page .recovery-back-container {
    margin: 14px 0 0;
    text-align: center;
}

.recovery-page .back-login {
    color: var(--morado);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.recovery-page .back-login:hover {
    text-decoration: underline;
}

/* Pie de página exclusivo */
.recovery-page footer {
    width: min(100%, 325px);
    margin-top: 18px;

    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 11px;
}

.recovery-page footer p {
    margin: 3px 0;
}

/* Responsive */
@media (max-width: 480px) {
    body.recovery-page {
        justify-content: flex-start;
        padding-top: 25px;
    }

    .recovery-page .login-wrapper {
        width: min(100%, 340px);
    }

    .recovery-page .recovery-page-form {
        padding: 18px;
        border-radius: 16px;
    }

    .recovery-page .avatar-circle {
        width: 74px;
        height: 74px;
    }

}

/* =========================================================
   MENSAJE LATERAL DE SESIÓN
   ========================================================= */

.mensaje-sesion-lateral {
    position: absolute;

    /*
    | Se coloca a la derecha del login sin moverlo.
    */
    left: calc(100% + 24px);

    /*
    | Centrado verticalmente respecto al formulario.
    */
    top: 50%;

    width: 290px;

    padding: 16px 18px;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    background: rgba(255, 255, 255, 0.94);

    border: 1px solid rgba(220, 53, 69, 0.35);
    border-left: 5px solid #dc3545;

    border-radius: 14px;

    box-shadow:
        0 12px 30px rgba(63, 35, 82, 0.20);

    color: #6f2630;

    z-index: 1000;

    /*
    | Estado inicial de la animación.
    */
    opacity: 0;

    transform:
        translateY(-50%)
        translateX(15px);

    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}


/* =========================================================
   MENSAJE VISIBLE
   ========================================================= */

.mensaje-sesion-lateral.mostrar {
    opacity: 1;

    transform:
        translateY(-50%)
        translateX(0);
}


/* =========================================================
   ICONO
   ========================================================= */

.mensaje-sesion-icono {
    flex-shrink: 0;

    font-size: 24px;
    line-height: 1;

    color: #dc3545;
}


/* =========================================================
   CONTENIDO
   ========================================================= */

.mensaje-sesion-contenido {
    flex: 1;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   TÍTULO
   ========================================================= */

.mensaje-sesion-titulo {
    margin-bottom: 5px;

    font-size: 15px;
    font-weight: 700;

    color: #842029;
}

@media (max-width: 760px) {

    .mensaje-sesion-lateral {
        position: fixed;

        left: 50%;
        right: auto;

        top: auto;
        bottom: 20px;

        width: calc(100% - 32px);
        max-width: 340px;

        transform:
            translate(-50%, 15px);
    }


    .mensaje-sesion-lateral.mostrar {
        transform:
            translate(-50%, 0);
    }

}