/* =====================================================
    LOGIN / RECUPERAR CONTRASEÑA
    Depende de los tokens de fodi-theme.css.
===================================================== */

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--fodi-superficie);
    color: var(--fodi-texto);
}

.page-background {
    display: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
}

@media (min-width: 992px) {
    .auth-row,
    .info-panel,
    .form-panel {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

/* =====================================================
    PANEL IZQUIERDO (azul institucional de la Udelar)
===================================================== */

.info-panel {
    position: relative;
    padding: 48px 56px;
    /* El azul institucional (--fodi-oscuro, #004A82) domina el centro; el degradé y el
       brillo arriba a la derecha solo le dan profundidad para que no se vea plano. */
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(160deg, #0a5793 0%, var(--fodi-oscuro) 45%, #003a68 100%);
    background-color: var(--fodi-oscuro);
    color: #ffffff;
    overflow: hidden;
}

/* franja de 4 colores al pie del panel */
.info-panel::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 6px;
    background: var(--fodi-franja);
}

/* isotipo como marca de agua: grande, tenue y anclado abajo a la derecha,
   lejos del título para no competir con él */
.info-isotipo {
    position: absolute;
    right: -120px;
    bottom: -90px;
    transform: rotate(-12deg);
    opacity: 0.09;
    pointer-events: none;
}

.info-isotipo .logo-fodi {
    height: 520px;
}

/* Encabezado institucional: [Facultad de Psicología + Udelar] | Programa FODI
   (mismo formato que eva.psico.udelar.edu.uy) */
.brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-institucional {
    display: block;
    width: auto;
    /* 10 mm es el mínimo del manual de Udelar para la altura del isologotipo (~38px) */
    height: 44px;
    flex-shrink: 0;
}

.brand-divisor {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
}

/* isotipo de FODI en blanco, a la misma altura que el bloque institucional */
.brand-fodi {
    height: 44px;
}

.info-main {
    position: relative;
    z-index: 2;
    max-width: 460px;
    padding: 48px 0;
}

/* las cuatro piezas del isotipo, en fila, sobre el título */
.info-acento {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.info-acento span {
    width: 28px;
    height: 6px;
    border-radius: 3px;
}

.info-acento span:nth-child(1) { background: var(--fodi-naranja); }
.info-acento span:nth-child(2) { background: var(--fodi-celeste); }
.info-acento span:nth-child(3) { background: var(--fodi-verde); }
.info-acento span:nth-child(4) { background: var(--fodi-violeta); }

.info-title {
    font-family: var(--fodi-fuente-titulos);
    font-size: clamp(32px, 3.2vw, 46px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: #ffffff;
    text-wrap: balance;
}

/* =====================================================
    PANEL DEL FORMULARIO
===================================================== */

.form-panel {
    padding: 48px;
    background: var(--fodi-superficie);
}

.login-form {
    width: 100%;
    max-width: 380px;
}

/* logo con texto sobre el formulario */
.auth-logo {
    display: block;
    height: 160px;
    margin: 0 auto 32px;
}

.form-title {
    font-family: var(--fodi-fuente-titulos);
    color: var(--fodi-tinta);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.form-subtitle {
    color: var(--fodi-texto-suave);
    font-size: 14px;
    line-height: 1.55;
}

.login-form .form-label {
    margin-bottom: 6px;
    color: var(--fodi-tinta);
    font-size: 13px;
    font-weight: 600;
}

.input-container {
    position: relative;
}

.input-container .form-control.is-invalid {
    background-image: none;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #8f9ca3;
    pointer-events: none;
    z-index: 2;
}

.login-form .form-control {
    height: 48px;
    padding-left: 42px;
    padding-right: 42px;
    border: 1px solid var(--fodi-borde-fuerte);
    border-radius: var(--bs-border-radius);
    background: var(--fodi-superficie);
    color: var(--fodi-tinta);
    font-size: 14px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form .form-control:focus {
    border-color: var(--fodi-celeste);
    box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}

.login-form .form-control.is-invalid {
    border-color: var(--bs-danger);
}

.form-control::-ms-reveal,
.form-control::-ms-clear {
    display: none;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--bs-border-radius-sm);
    background: none;
    border: none;
    padding: 0;
    color: #8f9ca3;
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover {
    color: var(--fodi-celeste-oscuro);
    background: var(--fodi-fondo);
}

/* checkbox y texto alineados por su centro (el float de Bootstrap los desfasaba) */
.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding-left: 0;
    color: var(--fodi-texto-suave);
    font-size: 13px;
    line-height: 1;
}

.remember .form-check-input {
    float: none;
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.remember .form-check-label {
    line-height: 16px;
}

.forgot-link {
    color: var(--fodi-celeste-oscuro);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.forgot-link:hover {
    color: #0f6964;
    text-decoration: underline;
}

.login-button {
    height: 48px;
    border: none;
    border-radius: var(--bs-border-radius);
    background: var(--fodi-celeste-oscuro);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.login-button:hover {
    background: #0f6964;
    box-shadow: 0 6px 18px rgba(19, 128, 122, 0.25);
}

.login-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-form .btn {
    height: 48px;
}

/* =====================================================
    RESPONSIVE
    En < 992px el panel azul se vuelve un encabezado compacto
    y el formulario queda visible sin tener que desplazarse.
===================================================== */

@media (max-width: 991.98px) {
    .info-panel {
        padding: 28px 32px 34px;
    }

    .info-isotipo {
        right: -50px;
        bottom: -70px;
        opacity: 0.12;
    }

    .info-isotipo .logo-fodi {
        height: 220px;
    }

    .auth-logo {
        height: 124px;
        margin-bottom: 28px;
    }

    .info-main {
        max-width: 70%;
        padding: 20px 0 0;
    }

    .info-acento {
        margin-bottom: 14px;
    }

    .info-acento span {
        width: 20px;
        height: 5px;
    }

    .info-title {
        font-size: 26px;
    }

    .form-panel {
        padding: 40px 32px;
    }
}

@media (max-width: 575.98px) {
    .info-panel {
        padding: 22px 20px 26px;
    }

    .info-main {
        max-width: 72%;
    }

    .info-isotipo {
        right: -56px;
        bottom: -60px;
    }

    .info-isotipo .logo-fodi {
        height: 180px;
    }

    .auth-logo {
        height: 104px;
        margin-bottom: 24px;
    }

    .info-title {
        font-size: 22px;
    }

    /* En móvil el logo de FODI ya aparece sobre el formulario: acá queda solo el
       encabezado institucional, sin achicarlo por debajo del mínimo del manual (10 mm ≈ 38px). */
    .brand-institucional {
        height: 38px;
    }

    .brand-divisor,
    .brand-fodi {
        display: none;
    }

    .form-panel {
        padding: 32px 20px;
    }

    .form-title {
        font-size: 24px;
    }

    .form-options {
        flex-wrap: wrap;
        gap: 10px;
    }
}
