/* ============================================================
   LOGIN NÓMINA — INSTITUCIONAL
   Content/Style/Nomina/Login_Nomina.css
   ============================================================ */

#kt_content:has(.login-page) {
    background: #f6f0f2;
}

.login-page {
    --ln-vino: #7B1E3A;
    --ln-vino-profundo: #4A1024;
    --ln-vino-medio: #8E2748;
    --ln-oro: #C9A24A;
    --ln-oro-suave: #E8D5A3;
    --ln-tinta: #1F1A1C;
    --ln-texto: #4A4450;
    --ln-mute: #7A7380;
    --ln-linea: #E7DDE1;
    --ln-fondo: #F6F0F2;
    --ln-papel: #FFFBFC;
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 119px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 40px;
    overflow: hidden;
    font-family: Poppins, "Segoe UI", sans-serif;
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(123, 30, 58, 0.16), transparent 58%),
        radial-gradient(700px 380px at 100% 110%, rgba(201, 162, 74, 0.14), transparent 55%),
        linear-gradient(160deg, #f8f3f5 0%, #efe6ea 48%, #f4eef0 100%);
}

.login-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(123, 30, 58, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 30, 58, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse at center, #000 40%, transparent 78%);
}

.login-bg::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -160px;
    top: -180px;
    border: 1px solid rgba(123, 30, 58, 0.08);
    border-radius: 50%;
    box-shadow: 0 0 0 40px rgba(123, 30, 58, 0.03);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
}

.login-card {
    display: flex;
    min-height: 620px;
    background: var(--ln-papel);
    border-radius: 22px;
    overflow: hidden;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 24px 60px rgba(74, 16, 36, 0.16),
        0 2px 8px rgba(31, 26, 28, 0.06);
    border: 1px solid rgba(123, 30, 58, 0.08);
    position: relative;
}

    .login-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--LoginDec);
        z-index: 3;
    }

/* ---------- Formulario ---------- */
.login-left {
    flex: 1.12;
    padding: 52px 58px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--ln-papel);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.login-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--LoginDec) 0%, var(--ln-vino-profundo) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 8px 18px rgba(123, 30, 58, 0.28);
}

.login-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.login-brand-kicker {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ln-tinta);
}

.login-brand-text {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--ln-mute);
    line-height: 1.35;
    text-transform: uppercase;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(123, 30, 58, 0.07);
    color: var(--ln-tinta);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
}

.login-badge i {
    font-size: 0.68rem;
    color: var(--ln-oro);
}

.login-title {
    font-size: 2.15rem;
    font-weight: 700;
    color: var(--ln-tinta);
    margin: 0 0 10px;
    letter-spacing: -0.6px;
    line-height: 1.12;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--ln-texto);
    margin: 0 0 32px;
    line-height: 1.55;
    max-width: 420px;
}

.login-form {
    width: 100%;
}

.login-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ln-tinta) !important;
    margin-bottom: 9px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.login-label span {
    font-weight: 500;
    letter-spacing: 0.2px;
    text-transform: none;
    color: var(--ln-mute);
    font-size: 0.75rem;
}

.login-field {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--ln-linea);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.login-field:focus-within {
    border-color: var(--ln-tinta);
    box-shadow: 0 0 0 4px rgba(123, 30, 58, 0.1);
}

.login-field-icon {
    width: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ln-tinta);
    font-size: 0.95rem;
}

.login-input {
    flex: 1;
    min-width: 0;
    padding: 15px 8px 15px 0;
    border: none;
    outline: none;
    font-size: 1.05rem;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    font-family: inherit;
    font-weight: 600;
    color: var(--ln-tinta);
    background: transparent;
}

.login-input::placeholder {
    color: #b7afb6;
    font-weight: 400;
    letter-spacing: 0.4px;
    text-transform: none;
}

.login-input.campo-error {
    color: var(--ln-tinta);
}

.login-field:has(.campo-error) {
    border-color: var(--ln-tinta);
    background: #FDF2F4;
    animation: loginShake 0.4s;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--ln-mute);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}

.login-hint i {
    color: var(--ln-tinta);
    margin-top: 2px;
}

.login-hint strong {
    color: var(--ln-tinta);
}

.login-btn {
    margin-top: 22px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    border: none;
    border-radius: 14px;
    background: var(--LoginDec);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow: 0 10px 22px rgba(123, 30, 58, 0.28);
}

.login-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(123, 30, 58, 0.34);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    background: #b7afb6;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.login-btn i {
    font-size: 0.82rem;
    transition: transform 0.22s ease;
}

.login-btn:hover i {
    transform: translateX(4px);
}

.login-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.login-trust-item {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(123, 30, 58, 0.04);
    border: 1px solid rgba(123, 30, 58, 0.06);
}

.login-trust-item i {
    color: var(--ln-tinta);
    font-size: 0.8rem;
}

.login-trust-item span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ln-tinta);
    line-height: 1.2;
    white-space: nowrap !important;
}

.login-footer {
    margin-top: 28px;
    font-size: 0.72rem;
    color: var(--ln-mute);
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer i {
    color: var(--ln-oro);
}

/* ---------- Panel institucional ---------- */
.login-right {
    flex: 0.88;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    color: #fff;
    background: var(--LoginDec);
}

.login-right::before,
.login-right::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.login-right::before {
    width: 280px;
    height: 280px;
    border: 1px solid rgba(232, 213, 163, 0.18);
    border-radius: 50%;
    top: -90px;
    right: -70px;
}

.login-right::after {
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: -140px;
    left: -110px;
}

.login-right-frame {
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(232, 213, 163, 0.28);
    border-radius: 14px;
    pointer-events: none;
}

.login-right-frame span {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--ln-oro-suave);
}

.login-right-frame span:nth-child(1) { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.login-right-frame span:nth-child(2) { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.login-right-frame span:nth-child(3) { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.login-right-frame span:nth-child(4) { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.login-right-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 80%, rgba(201, 162, 74, 0.16), transparent 46%);
    pointer-events: none;
}

.login-right-img {
    width: min(58%, 280px);
    height: auto;
    max-height: 260px;
    flex-shrink: 0;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.32));
    margin-bottom: 22px;
    animation: loginFloat 5s ease-in-out infinite;
}

@keyframes loginFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-right-text {
    text-align: center;
    z-index: 2;
}

.login-right-text h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: 0.4px;
}

.login-right-gold {
    width: 48px;
    height: 2px;
    margin: 0 auto 12px;
    background: linear-gradient(90deg, transparent, var(--ln-oro-suave), transparent);
}

.login-right-text p {
    font-size: 0.82rem;
    margin: 0 0 22px;
    opacity: 0.88;
    letter-spacing: 0.3px;
}

.login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 2;
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.login-features i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--ln-oro-suave);
    font-size: 0.72rem;
}

/* ---------- Overlay de carga ---------- */
#overlayCargando {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(31, 26, 28, 0.86);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
}

#overlayCargando.activo {
    display: flex;
}

#overlayCargando .imagen-carga {
    width: 80%;
    height: 80%;
    object-fit: contain;
    margin-bottom: 24px;
    animation: loginPulse 1.4s infinite ease-in-out;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

#overlayCargando .texto-carga {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

#overlayCargando .subtexto-carga {
    font-size: 0.9rem;
    opacity: 0.85;
}

@keyframes loginPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.78; }
}

@media (prefers-reduced-motion: reduce) {
    .login-right-img,
    #overlayCargando .imagen-carga {
        animation: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .login-card {
        flex-direction: column;
        min-height: auto;
    }

    .login-right {
        min-height: 0;
        order: -1;
        padding: 28px 20px 22px;
    }

    .login-right-img {
        width: 168px;
        max-width: 168px;
        max-height: 168px;
        margin-bottom: 10px;
    }

    .login-features {
        display: none;
    }

    .login-left {
        padding: 36px 28px 32px;
    }

    .login-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 560px) {
    .login-page {
        padding: 16px 12px 28px;
    }

    .login-card {
        border-radius: 16px;
    }

    .login-left {
        padding: 28px 18px 24px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-trust {
        flex-direction: column;
    }

    .login-brand-text {
        font-size: 0.64rem;
    }
}
