/* =========================================================
   CORE - LOGIN
   Estilo compacto institucional
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;

    font-family:
        Arial,
        "Segoe UI",
        Helvetica,
        sans-serif;

    color: #252525;

    overflow-x: hidden;
}


/* =========================================================
   PÁGINA
   ========================================================= */

.login-page {
    position: relative;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    overflow: hidden;
}


/* =========================================================
   FONDO
   ========================================================= */

.login-background {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background-image:
        linear-gradient(
            rgba(45, 0, 0, 0.08),
            rgba(45, 0, 0, 0.12)
        ),
        url("../../img/auth/bg_core.png");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    z-index: 0;
}


/* =========================================================
   WRAPPER
   ========================================================= */

.login-wrapper {
    position: relative;
    z-index: 2;

    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    padding:
        32px
        clamp(70px, 7vw, 130px)
        32px
        30px;
}


/* =========================================================
   TARJETA
   ========================================================= */

.login-card-animation {
    width: 410px;
    max-width: 410px;

    flex-shrink: 0;
}

.login-card {
    width: 100%;

    padding:
        30px
        34px
        24px;

    border-radius: 30px;

    background:
        rgba(255, 255, 255, 0.96);

    border:
        1px solid
        rgba(255, 255, 255, 0.85);

    box-shadow:
        0 22px 55px
        rgba(0, 0, 0, 0.22);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* =========================================================
   LOGO
   ========================================================= */

.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;

    margin-bottom: 22px;
}

.login-logo img {
    width: 72px;
    height: auto;

    display: block;
}


/* =========================================================
   HEADER
   ========================================================= */

.login-header {
    text-align: left;

    margin-bottom: 26px;
}

.login-header h1 {
    margin: 0 0 7px;

    font-size: 32px;
    line-height: 1.15;

    font-weight: 700;

    color: #1d1d1d;
}

.login-header p {
    margin: 0;

    font-size: 16px;
    line-height: 1.4;

    color: #696969;
}


/* =========================================================
   FORM
   ========================================================= */

.login-card form {
    width: 100%;
}

.form-group {
    width: 100%;

    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 15px;
    font-weight: 700;

    color: #303030;
}


/* =========================================================
   INPUT CONTAINER
   ========================================================= */

.input-container {
    position: relative;

    width: 100%;
}


/* =========================================================
   INPUTS
   ========================================================= */

.input-container input {
    width: 100%;
    height: 54px;

    padding:
        0
        54px
        0
        50px;

    border:
        1px solid
        #d8d8d8;

    border-radius: 14px;

    outline: none;

    background: #ffffff;

    font-family: inherit;
    font-size: 15px;

    color: #292929;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-container input::placeholder {
    color: #b8b8b8;
}

.input-container input:focus {
    border-color: #d62828;

    box-shadow:
        0 0 0 4px
        rgba(214, 40, 40, 0.08);
}


/* =========================================================
   ICONOS
   ========================================================= */

.input-icon {
    position: absolute;

    top: 50%;
    left: 16px;

    transform: translateY(-50%);

    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #8b8b8b;

    pointer-events: none;

    z-index: 3;
}

.input-icon svg {
    width: 21px;
    height: 21px;
}


/* =========================================================
   OJO PASSWORD
   ========================================================= */

.password-toggle {
    position: absolute !important;

    top: 50% !important;
    right: 13px !important;
    left: auto !important;

    transform: translateY(-50%) !important;

    width: 34px !important;
    height: 34px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;
    margin: 0 !important;

    border: none !important;

    background: transparent !important;

    color: #8b8b8b !important;

    cursor: pointer;

    z-index: 5;
}

.password-toggle:hover {
    color: #b00000 !important;
}

.password-toggle svg {
    width: 20px !important;
    height: 20px !important;

    display: block;

    pointer-events: none;
}


/* =========================================================
   OLVIDASTE CONTRASEÑA
   ========================================================= */

.forgot-password {
    width: 100%;

    display: flex;
    justify-content: flex-end;

    margin:
        -2px
        0
        16px;
}

.forgot-password span,
.forgot-password a {
    font-size: 14px;

    color: #111111;

    text-decoration: none;
}

.forgot-password a:hover {
    color: #ba0000;
}


/* =========================================================
   BOTÓN
   ========================================================= */

.login-button {
    width: 100%;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    padding: 0 18px;

    border: none;
    border-radius: 14px;

    background:
        linear-gradient(
            90deg,
            #ad0000,
            #dc0000
        );

    box-shadow:
        0 12px 24px
        rgba(160, 0, 0, 0.20);

    font-family: inherit;
    font-size: 15px;
    font-weight: 700;

    color: #ffffff;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.login-button:hover {
    transform: translateY(-1px);

    filter: brightness(1.03);

    box-shadow:
        0 14px 28px
        rgba(160, 0, 0, 0.26);
}

.login-button-icon {
    width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;
}

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


/* =========================================================
   FOOTER
   ========================================================= */

.login-footer {
    width: 100%;

    margin-top: 16px;

    text-align: center;

    color: #858585;
}

.login-footer-author {
    margin: 2px 0;

    font-size: 10px;
    line-height: 1.35;
}


/* =========================================================
   PANTALLA BAJA
   ========================================================= */

@media (max-height: 820px) and (min-width: 769px) {

    .login-wrapper {
        padding-top: 20px;
        padding-bottom: 20px;
    }

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

    .login-logo {
        margin-bottom: 14px;
    }

    .login-logo img {
        width: 58px;
    }

    .login-header {
        margin-bottom: 18px;
    }

    .login-header h1 {
        font-size: 28px;
    }

    .login-header p {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 13px;
    }

    .form-group label {
        margin-bottom: 6px;

        font-size: 14px;
    }

    .input-container input {
        height: 48px;

        font-size: 14px;
    }

    .forgot-password {
        margin-bottom: 11px;
    }

    .forgot-password span,
    .forgot-password a {
        font-size: 13px;
    }

    .login-button {
        height: 48px;

        font-size: 14px;
    }

    .login-footer {
        margin-top: 11px;
    }

    .login-footer-author {
        font-size: 9px;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .login-wrapper {
        padding:
            24px
            45px;
    }

    .login-card-animation {
        width: 410px;

        max-width:
            calc(100vw - 90px);
    }
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 768px) {

    body {
        overflow-y: auto;
    }

    .login-page {
        overflow: visible;
    }

    .login-background {
        background-position: 35% center;
    }

    .login-wrapper {
        min-height: 100dvh;

        justify-content: center;
        align-items: center;

        padding:
            16px
            12px;
    }

    .login-card-animation {
        width: 100%;

        max-width: 430px;
    }

    .login-card {
        padding:
            26px
            22px
            22px;

        border-radius: 24px;
    }

    .login-header h1 {
        font-size: 29px;
    }

    .login-header p {
        font-size: 15px;
    }

    .input-container input {
        height: 54px;
    }
}


/* =========================================================
   MÓVIL PEQUEÑO
   ========================================================= */

@media (max-width: 480px) {

    .login-wrapper {
        padding:
            10px
            8px;
    }

    .login-card {
        padding:
            22px
            18px
            20px;
    }

    .login-logo img {
        width: 64px;
    }

    .login-header h1 {
        font-size: 27px;
    }

    .login-header p {
        font-size: 14px;
    }

    .input-container input {
        height: 52px;

        font-size: 14px;
    }

    .login-button {
        height: 50px;

        font-size: 14px;
    }
}

/* =========================================================
   CORE NEXUS - IDENTIDAD VISUAL
   ========================================================= */

:root {
    --core-primary: #1678D3;
    --core-dark: #0F1E3A;
    --core-cyan: #25C7E8;
    --core-red: #DC2626;
}

/* Tarjeta principal */
.login-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.90);
    box-shadow: 0 22px 55px rgba(15, 30, 58, 0.18);
}

/* Encabezado */
.login-header h1 {
    color: var(--core-dark);
}

/* Campos */
.input-container input:focus {
    border-color: var(--core-primary);
    box-shadow: 0 0 0 4px rgba(22, 120, 211, 0.12);
}

/* Iconos */
.input-icon {
    color: #8091A7;
}

.password-toggle:hover {
    color: var(--core-primary) !important;
}

/* Recuperación de contraseña */
.forgot-password a:hover {
    color: var(--core-primary);
}

/* Botón principal */
.login-button {
    background: linear-gradient(
        110deg,
        #073B83 0%,
        #0966C2 70%,
        #1678D3 100%
    );

    box-shadow: 0 12px 24px rgba(7, 59, 131, 0.20);
}

.login-button:hover {
    box-shadow: 0 14px 28px rgba(7, 59, 131, 0.28);
}

/* Accesibilidad */
.login-button:focus-visible,
.password-toggle:focus-visible {
    outline: 3px solid var(--core-cyan);
    outline-offset: 3px;
}

/* CORE - LOGOTIPO HORIZONTAL */

.login-logo {
    margin-bottom: 18px;
}

.login-logo img {
    width: 240px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 480px) {
    .login-logo img {
        width: 200px;
    }
}


/* ==========================================
   CORE - LOGIN COMPACTO
   ========================================== */

@media (min-width: 769px) {

    .login-wrapper {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .login-card {
        padding: 18px 30px 16px;
        border-radius: 28px;
    }

    .login-logo {
        margin-bottom: 10px;
    }

    .login-logo img {
        width: 195px;
        max-width: 100%;
        height: auto;
    }

    .login-header {
        margin-bottom: 16px;
    }

    .login-header h1 {
        font-size: 28px;
        margin-bottom: 5px;
    }

    .login-header p {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .input-container input {
        height: 46px;
    }

    .forgot-password {
        margin-bottom: 10px;
    }

    .login-button {
        height: 46px;
    }

    .login-footer {
        margin-top: 10px;
    }
}


/* ==========================================
   CORE - AJUSTE VERTICAL DE ESCRITORIO
   ========================================== */

@media (min-width: 769px) {

    .login-page {
        min-height: 100dvh;
    }

    .login-wrapper {
        min-height: 100dvh;
        padding-top: 8px;
        padding-bottom: 8px;
        align-items: center;
    }

    .login-card-animation {
        width: min(410px, 100%);
        max-width: 100%;
    }

    .login-card {
        padding: 14px 26px 12px;
    }

    .login-logo {
        margin-bottom: 8px;
    }

    .login-logo img {
        width: 175px;
    }

    .login-header {
        margin-bottom: 12px;
    }

    .login-footer {
        margin-top: 8px;
    }
}


/* ==========================================
   CORE - TARJETA COMPACTA DEFINITIVA
   ========================================== */

@media (min-width: 769px) {

    .login-card-animation {
        width: 370px;
        max-width: 370px;
    }

    .login-card {
        padding: 16px 24px 14px;
        border-radius: 24px;
    }

    .login-logo img {
        width: 165px;
        height: auto;
    }

    .login-header h1 {
        font-size: 26px;
    }

    .login-header p {
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .input-container input {
        height: 44px;
    }

    .login-button {
        height: 44px;
    }
}


/* ==========================================
   CORE - CONTROL DE SCROLL EN ESCRITORIO
   ========================================== */

@media (min-width: 769px) {

    html,
    body {
        height: 100%;
        min-height: 0;
        margin: 0;
    }

    .login-page {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .login-wrapper {
        height: 100%;
        min-height: 0;
    }
}
