
/* =========================================================
   MAPAUTT - LOGIN
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --map-blue: var(--color-institucional-verde-oscuro);
    --map-blue-dark: var(--color-institucional-verde-profundo);
    --map-blue-light: var(--color-institucional-verde-claro);

    --admin-green: var(--color-institucional-verde-oscuro);
    --admin-green-dark: var(--color-institucional-verde-profundo);
    --admin-green-light: var(--color-institucional-verde-claro);

    --background: var(--color-fondo-principal);
    --surface: var(--color-superficie);

    --text: var(--color-texto-principal);
    --text-soft: var(--color-texto-secundario);

    --border: var(--color-borde);

    --danger: #c0392b;
    --danger-light: #fdecea;

    --success: #21875a;
    --success-light: #eaf8f1;

    --shadow:
        0 25px 70px rgba(20, 35, 50, 0.14);

    --radius-xl: 30px;
    --radius-lg: 20px;

    --transition: 0.3s ease;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;

    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;

    min-height: 100vh;

    font-family:
        "Plus Jakarta Sans",
        system-ui,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);

    overflow-x: hidden;
}


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

.login-page {
    position: relative;

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

    display: flex;
    flex-direction: column;

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

    /*
     * En escritorio el contenido se ajustará
     * a la altura disponible.
     *
     * En tablet y móvil se habilitará
     * el desplazamiento vertical.
     */
    overflow-x: hidden;
    overflow-y: hidden;

    padding: 15px 0;
}


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

.login-card {
    position: relative;

    width: min(1150px, calc(100% - 40px));

    /*
     * La tarjeta puede reducir su altura
     * dependiendo del tamaño de la pantalla.
     */
    height: min(650px, calc(100vh - 75px));

    min-height: 0;

    margin: 0 auto;

    display: grid;

    grid-template-columns: 0.9fr 1.1fr;

    background: var(--surface);

    border-radius: var(--radius-xl);

    box-shadow: var(--shadow);

    overflow: hidden;

    isolation: isolate;

    flex-shrink: 1;
}


/* =========================================================
   INTRODUCCIÓN
   ========================================================= */

.login-intro {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-height: 0;

    height: 100%;

    padding: 50px;

    overflow: hidden;

    color: white;

    background:
        radial-gradient(
            circle at 80% 20%,
            rgba(255, 255, 255, 0.15),
            transparent 30%
        ),
        linear-gradient(
            145deg,
            var(--map-blue-dark),
            var(--map-blue)
        );
}


/* =========================================================
   DECORACIÓN INTRO
   ========================================================= */

.login-intro::before {
    content: "";

    position: absolute;

    width: 420px;
    height: 420px;

    right: -200px;
    top: -180px;

    border-radius: 50%;

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

    pointer-events: none;
}


/* =========================================================
   CONTENIDO INTRO
   ========================================================= */

.intro-content {
    position: relative;

    z-index: 5;
}


/* =========================================================
   EYEBROW
   ========================================================= */

.login-eyebrow {
    margin: 0 0 15px;

    font-size: 0.75rem;

    font-weight: 700;

    letter-spacing: 0.13em;

    text-transform: uppercase;

    opacity: 0.75;
}


/* =========================================================
   MARCA
   ========================================================= */

.brand-lockup {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 30px;
}

.brand-mark {
    width: 44px;
    height: 44px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 13px;

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

    backdrop-filter: blur(10px);
}

.brand-mark svg {
    width: 24px;
    height: 24px;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.7;

    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-name {
    font-size: 1.35rem;

    font-weight: 800;

    letter-spacing: 0.04em;
}


/* =========================================================
   TEXTO INTRO
   ========================================================= */

.intro-title {
    max-width: 440px;

    margin: 0 0 18px;

    font-size: clamp(2.2rem, 3vw, 3.5rem);

    line-height: 1;

    letter-spacing: -0.04em;
}

.intro-copy {
    max-width: 430px;

    margin: 0;

    color: rgba(255, 255, 255, 0.8);

    font-size: 1rem;

    line-height: 1.7;
}


/* =========================================================
   MASCOTA LOGIN
   ========================================================= */

.login-visual {
    position: relative;

    width: 100%;

    min-height: 0;

    flex: 1;

    margin: 70px 0 0;

    display: flex;

    justify-content: center;

    align-items: flex-end;

    overflow: visible;
}

.visual-halo {
    position: absolute;

    bottom: 5px;

    width: 260px;
    height: 260px;

    border-radius: 50%;

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

    pointer-events: none;
}

.login-mascot {
    position: relative;

    height: 320px;

    width: auto;

    max-width: 100%;

    bottom: -65px;

    object-fit: contain;

    z-index: 2;

    filter:
        drop-shadow(
            0 25px 25px rgba(0, 0, 0, 0.2)
        );

    animation:
        loginMascotFloat 4s ease-in-out infinite;
}


/* =========================================================
   ANIMACIÓN MASCOTA
   ========================================================= */

@keyframes loginMascotFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-9px);
    }
}


/* =========================================================
   PANEL LOGIN
   ========================================================= */

.login-panel {
    position: relative;

    display: flex;

    flex-direction: column;

    justify-content: center;

    min-width: 0;
    min-height: 0;

    height: 100%;

    padding: 55px 65px;

    background: var(--surface);

    overflow: hidden;
}


/* =========================================================
   ENCABEZADO LOGIN
   ========================================================= */

.login-heading {
    margin-bottom: 25px;
}

.login-heading .login-eyebrow {
    color: var(--map-blue);

    opacity: 1;

    margin-bottom: 8px;
}

.login-heading h1 {
    margin: 0 0 10px;

    font-size: 2.8rem;

    line-height: 1;

    letter-spacing: -0.04em;

    color: var(--text);
}

.login-heading p:last-child {
    max-width: 450px;

    margin: 0;

    color: var(--text-soft);

    line-height: 1.6;
}


/* =========================================================
   ALERTAS
   ========================================================= */

.alert {
    display: flex;

    align-items: flex-start;

    gap: 10px;

    margin-bottom: 18px;

    padding: 13px 15px;

    border-radius: 12px;

    font-size: 0.85rem;

    line-height: 1.4;
}

.alert-icon {
    width: 22px;
    height: 22px;

    flex-shrink: 0;

    display: grid;

    place-items: center;

    border-radius: 50%;

    font-size: 0.75rem;

    font-weight: 800;
}

.alert-danger {
    background: var(--danger-light);

    color: var(--danger);
}

.alert-danger .alert-icon {
    background: var(--danger);

    color: white;
}

.alert-success {
    background: var(--success-light);

    color: var(--success);
}

.alert-success .alert-icon {
    background: var(--success);

    color: white;
}


/* =========================================================
   FORMULARIO
   ========================================================= */

.login-form {
    display: flex;

    flex-direction: column;

    gap: 18px;

    width: 100%;
}

.form-group {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;

    font-weight: 700;

    color: var(--text);
}


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

.input-container {
    position: relative;

    width: 100%;
}

.input-icon {
    position: absolute;

    left: 16px;
    top: 50%;

    width: 21px;
    height: 21px;

    transform: translateY(-50%);

    color: #8b98a5;

    pointer-events: none;

    z-index: 2;
}

.input-icon svg {
    width: 100%;
    height: 100%;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.6;

    stroke-linecap: round;
    stroke-linejoin: round;
}

.form-control {
    width: 100%;

    height: 55px;

    padding:
        0 16px 0 48px;

    border: 1px solid var(--border);

    border-radius: 13px;

    background: #fbfcfd;

    color: var(--text);

    font-family: inherit;

    font-size: 0.95rem;

    outline: none;

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.form-control::placeholder {
    color: #9aa6b1;
}

.form-control:focus {
    border-color: var(--primary-action);
    outline: 3px solid var(--color-institucional-naranja-oscuro);
    outline-offset: 2px;

    background: white;

    box-shadow:
        0 0 0 5px rgba(169, 68, 20, 0.16);
}


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

.btn-submit,
#btn-login-submit {
    width: 100%;

    min-height: 55px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding:
        0 18px 0 22px;

    border: none;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--admin-green-dark),
            var(--admin-green)
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 0.95rem;

    font-weight: 700;

    cursor: pointer;

    opacity: 1;

    visibility: visible;

    appearance: none;

    -webkit-appearance: none;

    box-shadow:
        0 12px 25px rgba(37, 138, 98, 0.20);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.btn-submit:hover,
#btn-login-submit:hover {
    background:
        linear-gradient(
            135deg,
            var(--admin-green),
            var(--admin-green-dark)
        );

    color: #ffffff;

    transform: translateY(-2px);

    box-shadow:
        0 17px 30px rgba(37, 138, 98, 0.28);
}

.btn-submit:active,
#btn-login-submit:active {
    transform: translateY(0);
}

.btn-submit:focus-visible,
#btn-login-submit:focus-visible {
    outline: 3px solid var(--color-institucional-naranja-oscuro);

    outline-offset: 3px;
}

.button-arrow {
    flex-shrink: 0;

    color: #ffffff;

    font-size: 1.4rem;

    line-height: 1;

    transition:
        transform var(--transition);
}

.btn-submit:hover .button-arrow,
#btn-login-submit:hover .button-arrow {
    transform: translateX(5px);
}


/* =========================================================
   NOTA DE ACCESO
   ========================================================= */

.access-note {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    margin: 18px 0;

    color: var(--text-soft);

    font-size: 0.75rem;
}

.access-note span {
    color: var(--admin-green);

    font-size: 0.65rem;
}


/* =========================================================
   VOLVER AL INICIO
   ========================================================= */

.back-home {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 8px;

    color: var(--map-blue);

    font-size: 0.85rem;

    font-weight: 600;

    text-decoration: none;

    transition:
        color var(--transition),
        gap var(--transition);
}

.back-home:hover {
    gap: 12px;

    color: var(--map-blue-dark);
}

.back-home:focus-visible {
    outline: 3px solid var(--color-institucional-naranja-oscuro);

    outline-offset: 4px;

    border-radius: 5px;
}


/* =========================================================
   OCULTAR SKIP LINK
   ========================================================= */

.skip-link {
    display: none !important;
}


/* =========================================================
   TRANSICIÓN
   ========================================================= */

.page-transition {
    position: fixed;

    inset: 0;

    z-index: 500;

    pointer-events: none;

    perspective: 1800px;

    opacity: 0;
}

.page-transition-front,
.page-transition-back {
    position: absolute;

    top: 0;
    bottom: 0;

    width: 50%;

    backface-visibility: hidden;
}

.page-transition-front {
    left: 0;

    background:
        linear-gradient(
            145deg,
            var(--map-blue-dark),
            var(--map-blue)
        );

    transform-origin: left center;
}

.page-transition-back {
    right: 0;

    background:
        linear-gradient(
            145deg,
            var(--admin-green-dark),
            var(--admin-green)
        );

    transform-origin: right center;
}


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

.login-footer {
    width: 100%;

    text-align: center;

    padding:
        0 20px 12px;

    color: var(--text-soft);

    font-size: 0.75rem;

    flex-shrink: 0;
}

.login-footer p {
    margin: 0;
}


/* =========================================================
   ESCRITORIO
   ========================================================= */

@media (min-width: 951px) {

    .login-page {
        height: 100vh;
        min-height: 100vh;

        justify-content: center;

        overflow: hidden;

        padding:
            10px 0;
    }

    .login-card {
        height: min(
            650px,
            calc(100vh - 65px)
        );

        min-height: 0;

        margin: 0 auto;

        flex-shrink: 1;
    }

    .login-intro,
    .login-panel {
        min-height: 0;
    }

    .login-footer {
        flex-shrink: 0;

        padding-bottom: 8px;
    }
}


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

@media (max-width: 950px) {

    .login-page {
        height: auto;
        min-height: 100vh;

        justify-content: flex-start;

        padding:
            15px 0;

        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-card {
        width: calc(100% - 24px);

        height: auto;

        min-height: auto;

        margin:
            0 12px 25px;

        grid-template-columns: 1fr;

        border-radius: var(--radius-xl);
    }

    .login-intro {
        height: auto;

        min-height: 480px;

        padding: 45px;
    }

    .login-visual {
        min-height: 210px;

        flex: none;
    }

    .login-mascot {
        height: 300px;
    }

    .login-panel {
        height: auto;

        min-height: auto;

        padding: 50px;
    }

    .login-footer {
        padding-bottom: 15px;
    }
}


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

@media (max-width: 600px) {

    .login-page {
        height: auto;

        min-height: 100vh;

        justify-content: flex-start;

        align-items: stretch;

        padding: 0;

        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-card {
        width: 100%;

        height: auto;

        min-height: auto;

        margin: 0;

        border-radius: 0;

        box-shadow: none;

        display: flex;

        flex-direction: column;
    }


    /* ---------------------------------------------
       INTRO
       --------------------------------------------- */

    .login-intro {
        height: auto;

        min-height: 480px;

        padding:
            35px 25px 20px;

        justify-content: space-between;
    }

    .brand-lockup {
        margin-bottom: 28px;
    }

    .intro-title {
        font-size: 2.35rem;

        line-height: 1.02;
    }

    .intro-copy {
        font-size: 0.92rem;

        line-height: 1.6;
    }

    .login-visual {
        min-height: 190px;

        margin-top: 15px;
    }

    .visual-halo {
        width: 210px;
        height: 210px;

        bottom: 0;
    }

    .login-mascot {
        height: 270px;

        max-width: 90%;
    }


    /* ---------------------------------------------
       PANEL
       --------------------------------------------- */

    .login-panel {
        width: 100%;

        height: auto;

        min-height: auto;

        padding:
            40px 25px 45px;

        justify-content: flex-start;

        overflow: visible;
    }

    .login-heading {
        margin-bottom: 25px;
    }

    .login-heading h1 {
        font-size: 2.35rem;
    }

    .login-heading p:last-child {
        font-size: 0.92rem;
    }

    .login-form {
        gap: 20px;
    }

    .form-control {
        height: 53px;
    }

    .btn-submit,
    #btn-login-submit {
        min-height: 55px;
    }

    .access-note {
        margin:
            20px 0;
    }


    /* ---------------------------------------------
       FOOTER
       --------------------------------------------- */

    .login-footer {
        padding:
            18px 15px 25px;

        background: var(--background);

        font-size: 0.72rem;

        line-height: 1.5;
    }
}


/* =========================================================
   TELÉFONOS PEQUEÑOS
   ========================================================= */

@media (max-width: 400px) {

    .login-intro {
        padding:
            30px 20px 15px;

        min-height: 450px;
    }

    .login-eyebrow {
        font-size: 0.68rem;
    }

    .brand-name {
        font-size: 1.2rem;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .intro-title {
        font-size: 2rem;
    }

    .intro-copy {
        font-size: 0.88rem;
    }

    .login-visual {
        min-height: 175px;
    }

    .login-mascot {
        height: 245px;
    }

    .login-panel {
        padding:
            35px 20px 40px;
    }

    .login-heading h1 {
        font-size: 2.1rem;
    }

    .form-control {
        height: 52px;

        padding-left: 46px;
    }

    .btn-submit,
    #btn-login-submit {
        min-height: 53px;

        padding:
            0 16px 0 18px;
    }
}


/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;

        scroll-behavior: auto !important;
    }
}
