/* Estilos compartidos de las pantallas de autenticación (login y restablecimiento). */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 36px 20px;
    background: linear-gradient(180deg, #123e7a 0%, #0a2148 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Logo superior FITESA --- */
.login-brand {
    display: flex;
    justify-content: center;
    color: #dce6f5;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-brand__logo {
    width: 62vw;
    max-width: 240px;
    height: auto;
    /* Los logos PNG (en color) se fuerzan a blanco para el fondo oscuro. */
    filter: brightness(0) invert(1);
}

/* --- Tarjeta --- */
.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 26px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

.login-card__title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #0c2f63;
}

.login-card__subtitle {
    margin: 6px 0 22px;
    font-size: 0.95rem;
    color: #6b7a90;
}

/* --- Mensaje de error --- */
.login-alert {
    margin-bottom: 16px;
    padding: 10px 13px;
    border-radius: 10px;
    background: #fdecec;
    border: 1px solid #f3bcbc;
    color: #b3261e;
    font-size: 0.9rem;
}

/* --- Mensaje informativo --- */
.login-info {
    margin-bottom: 16px;
    padding: 10px 13px;
    border-radius: 10px;
    background: #e8f1fb;
    border: 1px solid #bcd8f3;
    color: #14508f;
    font-size: 0.9rem;
}

/* --- Campos --- */
.login-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 6px;
    background: #eef1f6;
    border: 1.5px solid transparent;
    border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field:focus-within {
    border-color: #1f64ad;
    box-shadow: 0 0 0 3px rgba(31, 100, 173, 0.16);
}

.login-field__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #0c2f63;
    color: #ffffff;
}

.login-field__icon svg { width: 18px; height: 18px; }

.login-field__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 11px 4px;
    font-size: 1rem;
    color: #1b2a41;
    outline: none;
}

.login-field__input::placeholder { color: #97a3b6; }

.login-field__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #6b7a90;
    cursor: pointer;
}

.login-field__toggle svg { width: 20px; height: 20px; }
.login-field__toggle .icon-eye-slash { display: none; }
.login-field__toggle.is-visible .icon-eye { display: none; }
.login-field__toggle.is-visible .icon-eye-slash { display: block; }

/* --- Botones --- */
.login-button {
    width: 100%;
    margin-top: 6px;
    padding: 13px;
    border: 0;
    border-radius: 12px;
    background: #1f64ad;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.login-button:hover { background: #1a568f; }
.login-button:active { background: #144372; }

.login-button--secondary {
    margin-top: 10px;
    background: #eef1f6;
    color: #1b2a41;
}

.login-button--secondary:hover { background: #e2e7ef; }
.login-button--secondary:active { background: #d6dce6; }

.login-button--link {
    display: block;
    margin-top: 18px;
    text-align: center;
    text-decoration: none;
}

/* --- Enlace olvido de contraseña --- */
.login-forgot {
    display: block;
    margin-top: 18px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1f64ad;
    text-decoration: none;
    background: none;
    border: 0;
    width: 100%;
    cursor: pointer;
}

.login-forgot:hover { text-decoration: underline; }

/* --- Logo inferior Las Marismas --- */
.login-footer {
    display: flex;
    justify-content: center;
    color: #aebfd8;
}

.login-footer__logo {
    width: 48vw;
    max-width: 190px;
    height: auto;
    filter: brightness(0) invert(1);
}

/* --- Modal de recuperación de contraseña --- */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 23, 56, 0.72);
}

.auth-modal.is-open { display: flex; }

.auth-modal__dialog {
    width: 100%;
    max-width: 384px;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

/* --- Accesibilidad --- */
.login-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible { outline: 2px solid #1f64ad; outline-offset: 2px; }
