﻿/* ========================================================
   Login.css — MRO · Contabilidad
   Motion elegante + overlay de recuperación
   ======================================================== */

/* ===== Tokens ===== */
:root {
    --navy: #0b2545;
    --azul: #00a7e1;
    --azul-400: #2fb7ef;
    --borde: rgba(11,46,91,.12);
    --e-out: cubic-bezier(.22,.61,.36,1);
    --e-soft: cubic-bezier(.16,.84,.44,1);
    --dur-fast: .28s;
    --dur-med: .50s;
    --dur-slow: .80s;
    --stagger: 80ms;
}

/* ===== Reset base (sólo lo necesario para el login) ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Layout ===== */
.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.row.login-container {
    margin-left: 0;
    margin-right: 0;
}

.login-container {
    min-height: 100svh;
    width: 100%;
    display: flex;
    align-items: stretch;
    overflow-x: hidden;
}

/* ===== Imagen lateral con reveal ===== */
.login-image {
    position: relative;
    flex: 0 0 50%;
    min-height: 100svh;
    background: url('https://zeus.mxamro.com/images/plane.jpg') center center/cover no-repeat;
    opacity: 0;
    transform: translateX(-14px) scale(1.04);
    animation: imgIn .9s var(--e-soft) .06s forwards;
}

    .login-image::after {
        content: "";
        position: absolute;
        inset: 0;
        left: -40%;
        width: 140%;
        background: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 65%);
        transform: translateX(-40%);
        opacity: 0;
        animation: imgSweep .9s var(--e-soft) .12s forwards;
    }

/* ===== Columna formulario ===== */
.login-form-col {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ===== Card ===== */
.login-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 20px;
    box-shadow: 0 18px 34px rgba(11,46,91,.14);
    padding: 28px 24px;
    min-height: 420px;
    opacity: 0;
    transform: translateY(14px) scale(.985);
    animation: loginIn var(--dur-med) var(--e-out) .14s forwards;
}

    .login-card:hover {
        box-shadow: 0 22px 40px rgba(11,46,91,.18);
    }

.login-logo {
    width: 160px;
    max-width: 45%;
    display: block;
    margin: 0 auto 10px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.08));
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp var(--dur-fast) var(--e-out) .22s forwards;
}

.login-card h2 {
    color: var(--navy);
    font-weight: 800;
    text-align: center;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp var(--dur-fast) var(--e-out) .28s forwards;
}

/* ===== Campos (sin stagger, visibles por defecto) ===== */
.login-card .form-group {
    margin-bottom: 14px;
}

.login-card label {
    color: var(--navy);
    font-weight: 600;
    margin-bottom: .35rem;
    display: block;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

/* Inputs */
.form-control {
    height: 36px;
    line-height: 1.1;
    border-radius: 8px;
    border: 1px solid rgba(11,46,91,.18);
    background: #f6f9ff;
    padding: .5rem .75rem;
    width: 100%;
    transition: border-color .2s var(--e-out), box-shadow .2s var(--e-out), transform .1s var(--e-out), background-color .2s var(--e-out);
}

    .form-control:hover {
        background: #f2f7ff;
    }

    .form-control:focus {
        border-color: var(--azul);
        box-shadow: 0 0 0 .22rem rgba(0,166,233,.16);
        outline: 0;
        transform: translateY(-1px);
    }

    .form-control.has-eye {
        padding-right: 40px;
    }

/* Botón “ojo” */
.btn-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    transition: transform .12s var(--e-out), opacity .12s linear;
    opacity: .9;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230b2e5b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8Z'/><circle cx='12' cy='12' r='3'/></svg>");
}

    .btn-eye:hover {
        transform: translateY(-50%) scale(1.05);
        opacity: 1;
    }

    .btn-eye.on {
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230b2e5b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.94 10.94 0 0 1 12 20C5 20 1 12 1 12a21.8 21.8 0 0 1 5.06-6.94M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.82 21.82 0 0 1-3.87 5.15M9 9l6 6M3 3l18 18'/></svg>");
    }

/* Botón principal */
.button {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: .85rem 1rem;
    font-weight: 800;
    letter-spacing: .3px;
    color: #fff;
    background: linear-gradient(135deg, var(--azul), var(--azul-400));
    box-shadow: 0 16px 28px rgba(0,166,233,.28);
    text-decoration: none;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp var(--dur-fast) var(--e-out) calc(.34s + 2*var(--stagger)) forwards;
    transition: box-shadow .2s var(--e-out), filter .2s var(--e-out), transform .08s var(--e-out);
}

    .button:hover {
        filter: saturate(1.06) brightness(1.02);
        box-shadow: 0 20px 34px rgba(0,166,233,.34);
        transform: translateY(-1px);
    }

    .button:active {
        transform: translateY(1px);
    }

/* Ayudas / links */
.helper {
    text-align: center;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(6px);
    animation: fadeUp var(--dur-fast) var(--e-out) calc(.34s + 3*var(--stagger)) forwards;
}

.forgot-link {
    background: none;
    border: 0;
    cursor: pointer;
    color: #0b2545;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity .2s var(--e-out);
}

    .forgot-link:hover {
        opacity: .85;
    }

/* Mensajes */
.msg-err {
    color: #c62828;
    font-weight: 600;
}

.msg-ok {
    color: #2e7d32;
    font-weight: 600;
}

/* ===== Overlay “olvidé mi contraseña” ===== */
.forgot-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1050;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s var(--e-out);
}

    .forgot-overlay::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(11,37,69,.35);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

body.is-forgot-open .forgot-overlay {
    pointer-events: auto;
    opacity: 1;
}

.forgot-card {
    position: relative;
    width: 100%;
    max-width: 760px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(11,37,69,.22);
    padding: 22px;
    z-index: 1;
    animation: fadeUp .35s var(--e-out) .05s both;
}

.forgot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.forgot-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--navy);
    margin: 0;
}

.forgot-close {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

    .forgot-close:hover {
        background: #f1f4f9;
    }

.form-stack {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width:768px) {
    .form-stack {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

.form-stack .full {
    grid-column: 1/-1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.label {
    font-weight: 600;
    color: var(--navy);
    font-size: .95rem;
}

.help {
    font-size: .86rem;
    color: #5b6b80;
}

.btn-primario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1rem;
    border: 0;
    border-radius: .75rem;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: .2px;
    background: linear-gradient(135deg,var(--azul), var(--azul-400));
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,167,225,.25);
    transition: transform .15s var(--e-out), box-shadow .15s var(--e-out), filter .15s var(--e-out);
}

    .btn-primario:hover {
        transform: translateY(-1px);
        filter: saturate(1.05);
        box-shadow: 0 10px 24px rgba(0,167,225,.35);
    }

/* ===== Accesibilidad / reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none;
        transition: none;
    }

    .login-image, .login-card, .login-logo, .login-card h2,
    .button, .helper, .forgot-card {
        opacity: 1;
        transform: none;
    }
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .login-image {
        display: none;
    }

    .login-form-col {
        flex: 1 1 auto;
        padding: 20px;
    }

    .login-card {
        min-height: auto;
    }
}

/* ===== Keyframes ===== */
@keyframes imgIn {
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes imgSweep {
    to {
        transform: translateX(120%);
        opacity: 1;
    }
}

@keyframes loginIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
