:root {
    --ov-azul: #003149;
    --ov-azul-mid: #0665a5;
    --ov-rojo: #aa0d2e;
    --ov-bg: #f2f5fb;
    --ov-card: #ffffff;
    --ov-texto: #263746;
    --ov-suave: #687686;
    --ov-borde: #dce4eb;
    --ov-sombra: 0 10px 35px rgba(0, 49, 73, 0.08);
    --ov-sombra-hover: 0 18px 45px rgba(0, 49, 73, 0.13);
}

/* ============================================================
   PÁGINA
   ============================================================ */

.login-page {
    background: var(--ov-bg);
    min-height: 100%;
    padding-bottom: 1px;
}

/* ============================================================
   CONTENIDO LOGIN
   ============================================================ */

.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 90px;

    max-width: 1050px;
    margin: 0 auto;
    padding: 55px 24px 70px;
}

/* ============================================================
   FORMULARIO
   ============================================================ */

.login-box {
    flex: 0 1 410px;
    width: 100%;
    max-width: 410px;
}

.login-card {
    overflow: hidden;

    background: var(--ov-card);
    border: 1px solid rgba(0, 49, 73, 0.08);
    border-radius: 16px;
    box-shadow: var(--ov-sombra);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ov-sombra-hover);
}

/* ============================================================
   CABECERA
   ============================================================ */

.login-card-head {
    padding: 23px 28px;

    background: linear-gradient(110deg,
            var(--ov-azul),
            var(--ov-azul-mid));

    border-left: 5px solid var(--ov-rojo);
}

.login-card-head h1 {
    margin: 0 0 5px;

    color: #ffffff;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.login-card-head p {
    margin: 0;

    color: rgba(255, 255, 255, 0.78);
    font-family: "Roboto", sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================================
   CUERPO DEL FORMULARIO
   ============================================================ */

.login-card-body {
    padding: 28px;
}

/* ============================================================
   MENSAJES
   ============================================================ */

.msj-error {
    min-height: 0;
    margin-bottom: 16px;
}

.msj-error:empty {
    display: none;
}

.msj-error .alert {
    margin: 0;
    border-radius: 8px;
    font-size: 13px;
}

/* ============================================================
   CAMPOS
   ============================================================ */

.field-group-login {
    margin-bottom: 20px;
}

.field-group-login label {
    display: block;
    margin-bottom: 7px;

    color: var(--ov-azul);
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.field-group-login input {
    width: 100%;
    height: 46px;
    padding: 0 15px;

    background: #f8fafc;
    border: 1px solid var(--ov-borde);
    border-radius: 8px;

    color: var(--ov-texto);
    font-family: "Roboto", sans-serif;
    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.field-group-login input::placeholder {
    color: #9aa6b2;
}

.field-group-login input:hover {
    border-color: #c4d0da;
}

.field-group-login input:focus {
    background: #ffffff;
    border-color: var(--ov-azul-mid);
    box-shadow: 0 0 0 3px rgba(6, 101, 165, 0.1);
}

/* ============================================================
   BOTÓN LOGIN
   ============================================================ */

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    height: 46px;

    padding: 0 20px;

    border: none;
    border-radius: 23px;

    background: linear-gradient(90deg,
            var(--ov-azul),
            var(--ov-azul-mid));

    color: #ffffff;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(90deg,
            #004461,
            #0877bd);

    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 49, 73, 0.2);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Loader del botón */

.btn-login-loader {
    display: none;

    width: 16px;
    height: 16px;

    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
}

.btn-login.loading .btn-login-loader {
    display: inline-block;
    animation: loginButtonSpin 0.7s linear infinite;
}

.btn-login.loading .btn-login-arrow {
    display: none;
}

@keyframes loginButtonSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   RECUPERAR NÚMERO DE VENTA
   ============================================================ */

.ov-recover-login {
    margin: 16px 0 0;

    color: #707d89;
    font-family: "Roboto", sans-serif;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.ov-recover-login a {
    color: var(--ov-azul-mid);
    font-weight: 600;
    text-decoration: none;

    transition: color 0.2s ease;
}

.ov-recover-login a:hover {
    color: var(--ov-rojo);
    text-decoration: underline;
}

/* ============================================================
   AYUDA / TUTORIAL
   ============================================================ */

.login-tutorial-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 17px;

    color: #7b8794;
    font-family: "Roboto", sans-serif;
    font-size: 12px;
}

.login-tutorial-icon {
    display: inline-flex;
    flex: 0 0 19px;
    align-items: center;
    justify-content: center;

    width: 19px;
    height: 19px;

    background: #e8f3fa;
    border-radius: 50%;

    color: var(--ov-azul-mid);
    font-size: 11px;
    font-weight: 700;
}

.login-tutorial-help button {
    padding: 0;

    background: transparent;
    border: none;

    color: var(--ov-azul-mid);
    font-family: "Roboto", sans-serif;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.login-tutorial-help button:hover {
    color: var(--ov-rojo);
    text-decoration: underline;
}

/* ============================================================
   INFORMACIÓN DERECHA
   ============================================================ */

.login-image {
    flex: 0 1 390px;

    width: 100%;
    max-width: 390px;

    text-align: left;
}

.login-image .login-card-body {
    padding: 0 0 0 20px;
    border-left: 3px solid var(--ov-rojo);
}

.login-image h2 {
    margin: 0 0 12px;

    color: var(--ov-azul);
    font-family: "Poppins", sans-serif;
    font-size: 21px;
    font-weight: 600;
}

.login-image .quote {
    margin: 0;

    color: var(--ov-suave);
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    line-height: 1.75;
}

.login-image img {
    display: block;

    width: 210px;
    max-width: 100%;

    margin: 30px auto 0;

    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 49, 73, 0.15);

    animation: loginFloat 4s ease-in-out infinite;
}

@keyframes loginFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

/* ============================================================
   OVERLAY DE ÉXITO
   ============================================================ */

.login-success-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(circle at 50% 30%,
            rgba(7, 89, 133, 0.18),
            transparent 45%),
        rgba(4, 15, 26, 0.78);

    backdrop-filter: blur(9px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.login-success-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.login-success-card {
    width: min(380px, 100%);
    padding: 40px 32px 34px;

    background: #ffffff;
    border-radius: 22px;

    text-align: center;

    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.28),
        0 10px 30px rgba(15, 23, 42, 0.12);

    transform: translateY(20px) scale(0.96);

    transition:
        transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.login-success-overlay.active .login-success-card {
    transform: translateY(0) scale(1);
}

.login-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 78px;
    height: 78px;
    margin: 0 auto 22px;

    background: linear-gradient(135deg,
            #075985,
            #0f766e 60%,
            #16a34a);

    border-radius: 50%;

    box-shadow: 0 10px 26px rgba(7, 89, 133, 0.32);
}

.login-success-icon svg {
    width: 38px;
    height: 38px;
}

.login-success-icon svg path {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;

    stroke-dasharray: 40;
    stroke-dashoffset: 40;
}

.login-success-overlay.active .login-success-icon svg path {
    animation: loginCheckDraw 0.5s ease 0.15s forwards;
}

@keyframes loginCheckDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.login-success-card h2 {
    margin: 0 0 8px;

    color: #162638;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.login-success-card p {
    margin: 0 0 22px;

    color: #718096;
    font-family: "Roboto", sans-serif;
    font-size: 13.5px;
    line-height: 1.6;
}

.login-success-loader {
    width: 100%;
    height: 5px;

    overflow: hidden;

    background: #e8eef2;
    border-radius: 4px;
}

.login-success-loader::after {
    display: block;

    width: 0;
    height: 100%;

    content: "";

    background: linear-gradient(90deg,
            #075985,
            #11a69b,
            #16a34a);

    border-radius: 4px;
}

.login-success-overlay.active .login-success-loader::after {
    animation: loginLoaderFill 1.3s ease forwards;
}

@keyframes loginLoaderFill {
    to {
        width: 100%;
    }
}

/* ============================================================
   ANIMACIÓN DE ENTRADA
   ============================================================ */

.fade-up {
    opacity: 0;
    transform: translateY(20px);

    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
    .login-section {
        gap: 50px;
    }

    .login-image {
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .login-section {
        flex-direction: column;
        gap: 45px;

        padding: 40px 16px 55px;
    }

    .login-box,
    .login-image {
        width: 100%;
        max-width: 430px;
    }

    .login-image {
        text-align: center;
    }

    .login-image .login-card-body {
        text-align: left;
    }

    .login-image img {
        width: 190px;
    }
}

@media (max-width: 480px) {
    .login-card-head {
        padding: 20px;
    }

    .login-card-head h1 {
        font-size: 18px;
    }

    .login-card-head p {
        font-size: 12px;
    }

    .login-card-body {
        padding: 24px 20px;
    }

    .login-image h2 {
        font-size: 19px;
    }

    .login-image .quote {
        font-size: 13px;
    }

    .login-tutorial-help {
        align-items: flex-start;
        text-align: left;
    }
}

/* ============================================================
   ACCESIBILIDAD: REDUCCIÓN DE MOVIMIENTO
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .fade-up,
    .login-card,
    .login-success-overlay,
    .login-success-card {
        transition: none !important;
    }

    .login-image img,
    .btn-login.loading .btn-login-loader,
    .login-success-icon svg path,
    .login-success-loader::after {
        animation: none !important;
    }

    .login-success-icon svg path {
        stroke-dashoffset: 0;
    }

    .login-success-loader::after {
        width: 100%;
    }
}