/* Cuadro de acceso del login (Views/System/Login.cshtml). Todo bajo .login-card para no tocar otras páginas
   (ForgotAdminPassword sigue con .card-dark-custom). backoffice.css impone Avenir y font-weight 400 a todo (*): cada
   texto declara su peso y su interlineado. */

.login-card {
    --lg-bg: var(--ovex-tertiary);
    --lg-field: rgba(255, 255, 255, .04);
    --lg-field-border: rgba(255, 255, 255, .12);
    --lg-text: #FFFFFF;
    --lg-muted: #9AA3B2;
    --lg-soft: #AEB6C4;
    --lg-faint: #7C8696;
    --lg-accent: #A98BD3;

    position: relative;
    max-width: 460px;
    margin: 40px auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 20px;
    background: var(--lg-bg);
    box-shadow: 0 30px 60px rgba(17, 24, 39, .28), 0 8px 18px rgba(17, 24, 39, .14);
    color: var(--lg-text);
}

.login-card-body {
    padding: 40px 40px 26px;
}

/* ---------- logotipo ---------- */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.login-wordmark {
    width: auto;
    height: 42px;
}

.login-subtitle {
    color: var(--lg-soft);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

.login-divider {
    width: 40px;
    height: 2px;
    margin-top: 12px;
    border-radius: 2px;
    background: var(--ovex-primary);
}

/* ---------- título de la página (Recuperar contraseña) ---------- */
.login-intro {
    margin: 0 0 24px;
    text-align: center;
}

.login-intro h1 {
    margin: 0;
    color: var(--lg-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

.login-intro p {
    margin: 8px 0 0;
    color: var(--lg-soft);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.45;
}

/* ---------- campos ---------- */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.login-label {
    margin: 0;
    color: var(--lg-text);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}

.login-forgot {
    color: var(--lg-accent);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: color .15s ease;
}

.login-forgot:hover,
.login-forgot:focus-visible {
    color: #D9C6F2;
    text-decoration: underline;
}

.login-field {
    position: relative;
}

/* El ícono y el ojo se centran con la altura del campo (54 px), no con la del contenedor: así no se mueven cuando
   Parsley agrega el mensaje de error debajo del campo (Recuperar contraseña). */
.login-icon {
    position: absolute;
    top: 27px;
    left: 16px;
    display: flex;
    color: var(--lg-muted);
    pointer-events: none;
    transform: translateY(-50%);
    transition: color .15s ease;
}

.login-icon svg {
    width: 16px;
    height: 16px;
}

.login-input {
    width: 100%;
    height: 54px;
    padding: 0 16px 0 46px;
    border: 1px solid var(--lg-field-border);
    border-radius: 12px;
    background: var(--lg-field);
    color: var(--lg-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.login-input.has-eye {
    padding-right: 48px;
}

/* El usuario se escribe en mayúsculas (clase uppercase), pero el texto de ejemplo no. */
.login-input::placeholder {
    color: var(--lg-faint);
    font-weight: 400;
    text-transform: none;
    opacity: 1;
}

.login-input:focus {
    border-color: var(--lg-accent);
    background: rgba(255, 255, 255, .07);
    box-shadow: 0 0 0 3px rgba(106, 69, 149, .45);
    outline: none;
}

.login-field:focus-within .login-icon {
    color: #C9AEEB;
}

/* Validación de Parsley (site.js: errorClass is-invalid, el mensaje va en un <p> debajo del campo). */
.login-input.is-invalid {
    border-color: rgba(248, 113, 113, .7);
}

.login-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(212, 11, 17, .25);
}

.login-field p {
    margin: 6px 2px 0;
    color: #FCA5A5;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

/* Liga para regresar al login (Recuperar contraseña). */
.login-back {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--lg-soft);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: color .15s ease;
}

.login-back svg {
    width: 12px;
    height: 12px;
    transition: transform .15s ease;
}

.login-back:hover,
.login-back:focus-visible {
    color: var(--lg-text);
    text-decoration: none;
}

.login-back:hover svg {
    transform: translateX(-3px);
}

/* Autocompletado del navegador: oscuro, sin el bloque amarillo o blanco. */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #29313E inset;
    -webkit-text-fill-color: var(--lg-text);
    caret-color: var(--lg-text);
    transition: background-color 9999s ease-out;
}

/* Mostrar u ocultar la contraseña (login.js). */
.login-eye {
    position: absolute;
    top: 27px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--lg-muted);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color .15s ease, color .15s ease;
}

.login-eye:hover,
.login-eye:focus-visible {
    background: rgba(255, 255, 255, .08);
    color: var(--lg-text);
    outline: none;
}

.login-eye svg {
    width: 17px;
    height: 17px;
}

.login-eye .login-eye-hide,
.login-eye[aria-pressed="true"] .login-eye-show {
    display: none;
}

.login-eye-show,
.login-eye[aria-pressed="true"] .login-eye-hide {
    display: flex;
}

/* ---------- botón ---------- */
.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    background: var(--ovex-primary);
    box-shadow: 0 8px 18px rgba(106, 69, 149, .35);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

/* La flecha va por CSS: login.js cambia el texto del botón («Iniciando sesión…»). */
.login-submit::after {
    font-size: 18px;
    line-height: 1;
    content: "→";
    transition: transform .15s ease;
}

.login-submit:hover:not(:disabled) {
    background: var(--ovex-primary-accent);
    box-shadow: 0 10px 22px rgba(106, 69, 149, .45);
    transform: translateY(-1px);
}

.login-submit:hover:not(:disabled)::after {
    transform: translateX(3px);
}

.login-submit:focus-visible {
    outline: 2px solid var(--lg-accent);
    outline-offset: 3px;
}

.login-submit:disabled {
    opacity: .7;
    cursor: default;
}

.login-submit:disabled::after {
    content: none;
}

/* ---------- pie ---------- */
.login-footer {
    margin: 28px 0 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: var(--lg-faint);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

/* ---------- celular ---------- */
@media (max-width: 575.98px) {
    .login-card {
        margin: 24px 4px;
    }

    .login-card-body {
        padding: 32px 22px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit,
    .login-submit::after {
        transition: none;
    }
}
