/* =========================================================
   1. VARIABLES GENERALES DEL DISEÑO
   Aquí se guardan los colores, sombras y bordes que se usan
   varias veces en la página.
========================================================= */

:root {
    /* Colores principales de Kimsa */
    --kimsa-red: #d71920;
    --kimsa-red-dark: #970b11;
    --kimsa-red-light: #ff3b41;

    /* Colores neutros */
    --black: #151515;
    --dark-gray: #292929;
    --gray: #6f6f6f;
    --light-gray: #e7e7e7;
    --background: #f4f5f7;
    --white: #ffffff;

    /* Bordes redondeados */
    --border-radius-large: 26px;
    --border-radius-medium: 16px;
    --border-radius-small: 16px;

    /* Sombra principal del contenedor */
    --shadow: 0 24px 70px rgba(24, 24, 24, 0.16);
}


/* =========================================================
   2. REINICIO BÁSICO DE ESTILOS
   Elimina márgenes automáticos y facilita el control
   del tamaño de los elementos.
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}


/* =========================================================
   3. ESTILOS GENERALES DE LA PÁGINA
========================================================= */

body {
    min-height: 100vh;

    font-family: "Inter", sans-serif;
    color: var(--black);

    /* Fondo claro con círculos decorativos suaves */
    background:
        radial-gradient(
            circle at 8% 15%,
            rgba(215, 25, 32, 0.12),
            transparent 26%
        ),
        radial-gradient(
            circle at 92% 83%,
            rgba(215, 25, 32, 0.1),
            transparent 25%
        ),
        radial-gradient(
            circle at 80% 10%,
            rgba(0, 0, 0, 0.025),
            transparent 20%
        ),
        var(--background);
}

/* Hace que botones e inputs usen la misma tipografía */
button,
input {
    font: inherit;
}

/* Elimina el sombreado azul al tocar enlaces o botones en celular */
button,
a {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   4. CONTENEDOR GENERAL DE LA PÁGINA
   Centra el login horizontal y verticalmente.
========================================================= */

.login-page {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 32px;
}


/* =========================================================
   5. CONTENEDOR PRINCIPAL DEL LOGIN
   Divide la pantalla en dos columnas:
   izquierda = formulario
   derecha = panel visual
========================================================= */

.login-container {
    width: min(1160px, 100%);
    min-height: 690px;

    display: grid;
    grid-template-columns: 48% 52%;

    overflow: hidden;

    background: var(--white);

    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--border-radius-large);

    box-shadow: var(--shadow);

    /* Animación al cargar la página */
    animation: showLogin 0.75s ease both;
}


/* =========================================================
   6. PANEL IZQUIERDO
   Contiene logo, formulario y pie de página.
========================================================= */

.login-panel {
    display: flex;
    flex-direction: column;

    padding: 38px 54px 28px;

    background: var(--white);
}


/* =========================================================
   7. LOGO Y NOMBRE DE LA EMPRESA
========================================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 16px;
}

/* Logo  */
.brand__logo {
    width: 100px;
    height: 70px;

    object-fit: contain;

    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

/* Efecto suave al pasar el mouse sobre el logo */
.brand__logo:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 5px 8px rgba(215, 25, 32, 0.18));
}

.brand__company {
    font-size: 1rem;
    font-weight: 800;

    letter-spacing: 0.04em;
}

.brand__subtitle {
    margin-top: 3px;

    color: var(--gray);

    font-size: 0.83rem;
}


/* =========================================================
   8. CONTENIDO DEL FORMULARIO
========================================================= */

.login-content {
    width: 100%;
    max-width: 430px;

    margin: auto;
    padding: 34px 0;
}


/* =========================================================
   9. ENCABEZADO DEL LOGIN
========================================================= */

.login-header__tag {
    display: inline-flex;
    align-items: center;

    padding: 7px 12px;
    margin-bottom: 18px;

    color: var(--kimsa-red);
    background: rgba(215, 25, 32, 0.09);

    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 700;

    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-header h1 {
    font-size: clamp(2.15rem, 4vw, 3rem);
    line-height: 1.1;

    letter-spacing: -0.045em;
}

.login-header p {
    max-width: 390px;

    margin-top: 14px;

    color: var(--gray);

    font-size: 0.96rem;
    line-height: 1.7;
}


/* =========================================================
   10. FORMULARIO
========================================================= */

.login-form {
    margin-top: 34px;
}

.form-group {
    margin-bottom: 21px;
}

.form-group label {
    display: block;

    margin-bottom: 9px;

    color: var(--dark-gray);

    font-size: 0.88rem;
    font-weight: 600;
}


/* =========================================================
   11. CONTENEDOR DE CADA INPUT
   Permite colocar iconos dentro de los campos.
========================================================= */

.input-container {
    position: relative;
}

.input-container input {
    width: 100%;
    height: 56px;

    padding: 0 48px;

    color: var(--black);
    background: #fafafa;

    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-small);

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

/* Texto de ejemplo dentro del input */
.input-container input::placeholder {
    color: #a0a0a0;
}

/* Efecto al pasar el mouse */
.input-container input:hover {
    border-color: #c9c9c9;
}

/* Efecto cuando el usuario está escribiendo */
.input-container input:focus {
    background: var(--white);

    border-color: var(--kimsa-red);

    box-shadow: 0 0 0 4px rgba(215, 25, 32, 0.1);

    transform: translateY(-1px);
}


/* =========================================================
   12. ICONOS DE USUARIO Y CONTRASEÑA
========================================================= */

.input-icon {
    position: absolute;

    top: 50%;
    left: 16px;

    width: 20px;
    height: 20px;

    fill: #888888;

    transform: translateY(-50%);

    pointer-events: none;
}


/* =========================================================
   13. BOTÓN PARA MOSTRAR U OCULTAR LA CONTRASEÑA
========================================================= */

.password-button {
    position: absolute;

    top: 50%;
    right: 8px;

    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    background: transparent;

    border: 0;
    border-radius: 10px;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.password-button:hover {
    background: rgba(0, 0, 0, 0.05);

    transform:
        translateY(-50%)
        scale(1.05);
}

.password-button svg {
    width: 20px;
    height: 20px;

    fill: #777777;
}


/* =========================================================
   14. OPCIONES DEL FORMULARIO
   Incluye "Recordarme" y "Olvidó su contraseña".
========================================================= */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 18px;

    margin: 4px 0 26px;

    font-size: 0.83rem;
}

.remember-option {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    color: var(--gray);

    cursor: pointer;
}

.remember-option input {
    width: 16px;
    height: 16px;

    accent-color: var(--kimsa-red);
}

.forgot-password {
    color: var(--kimsa-red);

    font-weight: 600;
    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.forgot-password:hover {
    color: var(--kimsa-red-dark);
    text-decoration: underline;
}


/* =========================================================
   15. BOTÓN PRINCIPAL DE INGRESO
========================================================= */

.login-button {
    width: 100%;
    min-height: 56px;

    display: flex;
    justify-content: center;
    align-items: center;

    gap: 10px;

    padding: 13px 22px;

    color: var(--white);

    background:
        linear-gradient(
            135deg,
            var(--kimsa-red-light),
            var(--kimsa-red-dark)
        );

    border: 0;
    border-radius: var(--border-radius-medium);

    box-shadow:
        0 12px 24px rgba(215, 25, 32, 0.22);

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        filter 0.22s ease;
}

/* Efecto premium al pasar el mouse */
.login-button:hover {
    transform:
        translateY(-3px)
        scale(1.01);

    box-shadow:
        0 18px 34px rgba(215, 25, 32, 0.33);

    filter: brightness(1.03);
}

/* Efecto al presionar */
.login-button:active {
    transform:
        translateY(0)
        scale(0.99);

    box-shadow:
        0 8px 18px rgba(215, 25, 32, 0.22);
}


/* =========================================================
   16. MENSAJE DE DEMOSTRACIÓN
   Inicialmente está oculto.
========================================================= */

.login-message {
    display: none;

    margin-top: 16px;
    padding: 12px 14px;

    color: #7a5410;
    background: #fff7df;

    border: 1px solid #f3dda2;
    border-radius: 12px;

    font-size: 0.8rem;
    line-height: 1.5;
}

/* JavaScript agrega esta clase cuando se presiona Ingresar */
.login-message.is-visible {
    display: block;

    animation: showMessage 0.3s ease;
}


/* =========================================================
   17. PIE DE PÁGINA DEL LOGIN
========================================================= */

.login-footer {
    color: #949494;

    font-size: 0.73rem;
}


/* =========================================================
   18. PANEL DERECHO
   Contiene fondo rojo, logo y texto corporativo.
========================================================= */

.visual-panel {
    position: relative;

    min-height: 690px;

    display: flex;
    align-items: flex-end;

    overflow: hidden;

    background:
        linear-gradient(
            145deg,
            rgba(0, 0, 0, 0.08),
            rgba(0, 0, 0, 0.44)
        ),
        url("../img/logo-kimsa.png")
            center 21% / 60% auto
            no-repeat,
        linear-gradient(
            145deg,
            #ed2029 0%,
            #a50910 58%,
            #170505 100%
        );
}


/* =========================================================
   19. CÍRCULOS DECORATIVOS DEL PANEL DERECHO
========================================================= */

.visual-panel::before {
    position: absolute;

    top: -130px;
    right: -100px;

    width: 360px;
    height: 360px;

    content: "";

    border:
        1px solid
        rgba(255, 255, 255, 0.16);

    border-radius: 50%;

    animation:
        floatCircle 8s ease-in-out infinite;
}

.visual-panel::after {
    position: absolute;

    top: -70px;
    right: -35px;

    width: 220px;
    height: 220px;

    content: "";

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 50%;

    animation:
        floatCircle 6s ease-in-out infinite reverse;
}


/* =========================================================
   20. CAPA OSCURA SOBRE EL PANEL DERECHO
   Ayuda a que el texto blanco se lea mejor.
========================================================= */

.visual-panel__overlay {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.79),
            rgba(0, 0, 0, 0.16) 58%,
            transparent 78%
        );
}


/* =========================================================
   21. TEXTO DEL PANEL DERECHO
========================================================= */

.visual-panel__content {
    position: relative;
    z-index: 1;

    width: 100%;

    padding: 58px;

    color: var(--white);
}

.visual-panel__badge {
    display: inline-block;

    padding: 8px 13px;
    margin-bottom: 18px;

    background: rgba(255, 255, 255, 0.14);

    border:
        1px solid
        rgba(255, 255, 255, 0.22);

    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 600;

    backdrop-filter: blur(8px);
}

.visual-panel h2 {
    max-width: 500px;

    font-size: clamp(2rem, 3.2vw, 3.1rem);
    line-height: 1.12;

    letter-spacing: -0.04em;
}

.visual-panel__content > p {
    max-width: 480px;

    margin-top: 18px;

    color: rgba(255, 255, 255, 0.78);

    line-height: 1.7;
}


/* =========================================================
   22. TARJETAS DEL PANEL DERECHO
========================================================= */

.visual-features {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 12px;

    margin-top: 28px;
}

.feature-card {
    padding: 16px;

    background: rgba(255, 255, 255, 0.11);

    border:
        1px solid
        rgba(255, 255, 255, 0.17);

    border-radius: var(--border-radius-medium);

    backdrop-filter: blur(10px);

    transition:
        transform 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease;
}

/* Movimiento suave de las tarjetas */
.feature-card:hover {
    transform: translateY(-4px);

    background: rgba(255, 255, 255, 0.16);

    border-color: rgba(255, 255, 255, 0.28);
}

.feature-card strong,
.feature-card span {
    display: block;
}

.feature-card strong {
    margin-bottom: 5px;

    font-size: 0.88rem;
}

.feature-card span {
    color: rgba(255, 255, 255, 0.7);

    font-size: 0.73rem;
    line-height: 1.45;
}


/* =========================================================
   23. ANIMACIONES
========================================================= */

/* Animación principal al cargar la página */
@keyframes showLogin {
    from {
        opacity: 0;

        transform:
            translateY(22px)
            scale(0.985);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

/* Animación del mensaje de demostración */
@keyframes showMessage {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Movimiento casi imperceptible de los círculos decorativos */
@keyframes floatCircle {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(12px);
    }
}


/* =========================================================
   24. DISEÑO PARA TABLET
   Cuando la pantalla mide menos de 900 píxeles,
   las columnas pasan a estar una debajo de la otra.
========================================================= */

@media (max-width: 900px) {
    .login-page {
        padding: 22px;
    }

    .login-container {
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: 670px;
    }

    .visual-panel {
        min-height: 540px;
    }
}


/* =========================================================
   25. DISEÑO PARA CELULAR
   Oculta el panel derecho para que el formulario tenga
   más espacio.
========================================================= */

@media (max-width: 560px) {
    .login-page {
        display: block;

        padding: 0;

        background: var(--white);
    }

    .login-container {
        min-height: 100vh;

        border: 0;
        border-radius: 0;

        box-shadow: none;
    }

    .login-panel {
        min-height: 100vh;

        padding: 26px 23px 20px;
    }

    .brand {
        gap: 10px;
    }

    .brand__logo {
        width: 75px;
        height: 58px;
    }

    .login-content {
        padding: 48px 0 30px;
    }

    .login-header h1 {
        font-size: 2.25rem;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;

        gap: 12px;
    }

    .visual-panel {
        display: none;
    }

    .login-footer {
        text-align: center;
    }
}


/* =========================================================
   26. ACCESIBILIDAD
   Desactiva algunas animaciones para personas que tengan
   configurado reducir movimiento en su dispositivo.
========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   BOTÓN VOLVER AL INICIO
========================================== */

.back-button{
    display: inline-flex;
    align-items: center;
    gap: 8px;

    width: fit-content;

    margin-bottom: 20px;

    color: #c8102e;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;

    transition: all .3s ease;
}

.back-button:hover{
    color: #990000;
    transform: translateX(-4px);
}