:root {
    --login-navy: #090e37;
    --login-navy-soft: #151d55;
    --login-ink: #10152f;
    --login-muted: #667085;
    --login-line: #d9deea;
    --login-surface: #ffffff;
    --login-accent: #8fa2ff;
    --login-focus: rgba(50, 76, 181, 0.18);
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

.login-shell,
.login-shell *,
.login-shell *::before,
.login-shell *::after {
    box-sizing: border-box;
}

body.bg-light {
    margin: 0;
    overflow-x: hidden;
    background: var(--login-surface) !important;
    color: var(--login-ink);
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

.app-header {
    display: none !important;
}

.panel-main {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0 !important;
}

.panel-main > .container-fluid {
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.panel-main > .container-fluid > .mb-4 {
    position: fixed;
    z-index: 100;
    top: 1.25rem;
    right: 1.25rem;
    width: min(430px, calc(100vw - 2.5rem));
    margin: 0 !important;
}

.panel-main > .container-fluid > .mb-4 .alert {
    margin: 0 0 0.75rem;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 16px 42px rgba(9, 14, 55, 0.16);
}

.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(430px, 0.84fr);
    overflow: hidden;
    background: var(--login-surface);
}

.login-showcase {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    color: #ffffff;
    background-color: var(--login-navy);
    background-image:
        linear-gradient(118deg, rgba(5, 9, 39, 0.96) 0%, rgba(9, 14, 55, 0.80) 53%, rgba(9, 14, 55, 0.58) 100%),
        var(--login-project-image),
        linear-gradient(145deg, #090e37 0%, #151f5f 55%, #273778 100%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.login-showcase::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.06) 50%, transparent 50.2%),
        linear-gradient(transparent 49.8%, rgba(255, 255, 255, 0.05) 50%, transparent 50.2%);
    background-size: 150px 150px;
    opacity: 0.18;
    mask-image: linear-gradient(to bottom, black 0%, transparent 68%);
}

.login-showcase::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -13vw;
    bottom: -31vh;
    width: 52vw;
    height: 52vw;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    box-shadow:
        0 0 0 6vw rgba(255, 255, 255, 0.025),
        0 0 0 14vw rgba(255, 255, 255, 0.018);
}

.login-showcase__grid {
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: 42%;
    height: 100%;
    background: linear-gradient(145deg, transparent 0 48%, rgba(143, 162, 255, 0.17) 48.2% 48.8%, transparent 49% 100%);
    opacity: 0.72;
}

.login-showcase__content {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(2.25rem, 4vw, 4.5rem) clamp(2.5rem, 5.2vw, 6.5rem) clamp(2rem, 3.4vw, 3.5rem);
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
    width: fit-content;
}

.login-brand__logo-wrap {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
}

.login-brand__logo {
    width: 43px;
    height: 43px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.login-brand__copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.login-brand__copy strong {
    color: #ffffff;
    font-size: 1.06rem;
    font-weight: 750;
    letter-spacing: 0.105em;
}

.login-brand__copy small {
    margin-top: 0.42rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.login-showcase__message {
    width: min(750px, 100%);
    margin: auto 0;
    padding: 4rem 0 3.25rem;
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #4456a5;
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.155em;
    text-transform: uppercase;
}

.login-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
}

.login-eyebrow--light {
    color: #aebaff;
}

.login-showcase h1 {
    max-width: 720px;
    margin: 1.25rem 0 1rem;
    color: #ffffff;
    font-size: clamp(2.45rem, 4.15vw, 4.8rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1.03;
}

.login-showcase__intro {
    max-width: 610px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.65;
}

.login-capabilities {
    display: grid;
    gap: 1.25rem;
    margin: 2.8rem 0 0;
    padding: 0;
    list-style: none;
}

.login-capabilities li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
}

.login-capabilities__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(8px);
}

.login-capabilities__icon svg {
    width: 23px;
    height: 23px;
    stroke: #ffffff;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-capabilities li > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.login-capabilities strong {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 650;
}

.login-capabilities small {
    color: rgba(255, 255, 255, 0.61);
    font-size: 0.86rem;
    line-height: 1.45;
}

.login-showcase__footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.135em;
    text-transform: uppercase;
}

.login-showcase__footer span:last-child {
    width: 72px;
    height: 1px;
    background: rgba(255, 255, 255, 0.34);
}

.login-access {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(2.5rem, 6vw, 6.5rem);
    background:
        radial-gradient(circle at 92% 8%, rgba(143, 162, 255, 0.13), transparent 28%),
        #ffffff;
    box-shadow: -14px 0 36px rgba(6, 10, 38, 0.16);
}

.login-access__topline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--login-navy) 0%, #3449a1 55%, #8fa2ff 100%);
}

.login-access__content {
    width: min(460px, 100%);
}

.login-mobile-brand {
    display: none;
}

.login-access__heading {
    margin-bottom: 2.4rem;
}

.login-access__heading h2 {
    position: relative;
    margin: 0.9rem 0 0.65rem;
    padding-bottom: 1rem;
    color: var(--login-navy);
    font-size: clamp(2.15rem, 3.2vw, 3rem);
    font-weight: 670;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.login-access__heading h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 62px;
    height: 3px;
    border-radius: 99px;
    background: var(--login-navy);
}

.login-access__heading p {
    margin: 0;
    color: var(--login-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.login-form {
    display: grid;
    gap: 1.35rem;
}

.login-field {
    display: grid;
    gap: 0.55rem;
}

.login-field label {
    margin: 0;
    color: var(--login-ink);
    font-size: 0.86rem;
    font-weight: 650;
}

.login-control {
    position: relative;
    display: flex;
    align-items: center;
}

.login-control__icon {
    position: absolute;
    z-index: 1;
    left: 1rem;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    color: #7b849c;
    pointer-events: none;
}

.login-control__icon svg,
.login-password-toggle svg,
.login-submit svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-control input {
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 0.75rem 3.15rem 0.75rem 3.05rem;
    border: 1px solid var(--login-line);
    border-radius: 11px;
    outline: none;
    background: #f9faff;
    color: var(--login-ink);
    font-family: inherit;
    font-size: 0.98rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.login-control input::placeholder {
    color: #99a1b3;
}

.login-control input:hover {
    border-color: #b9c1d2;
}

.login-control input:focus {
    border-color: #5c6fc2;
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--login-focus);
}

.login-control:focus-within .login-control__icon {
    color: var(--login-navy);
}

.login-password-toggle {
    position: absolute;
    z-index: 2;
    right: 0.7rem;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7b849c;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
    outline: none;
    background: #eef1fa;
    color: var(--login-navy);
}

.login-password-toggle__hide {
    display: none;
}

.login-password-toggle.is-visible .login-password-toggle__show {
    display: none;
}

.login-password-toggle.is-visible .login-password-toggle__hide {
    display: block;
}

.login-submit {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.55rem;
    padding: 0.85rem 1.35rem;
    border: 1px solid var(--login-navy);
    border-radius: 11px;
    background: var(--login-navy);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 680;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 26px rgba(9, 14, 55, 0.18);
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.login-submit svg {
    width: 20px;
    height: 20px;
    transition: transform 160ms ease;
}

.login-submit:hover {
    background: var(--login-navy-soft);
    box-shadow: 0 16px 34px rgba(9, 14, 55, 0.24);
    transform: translateY(-1px);
}

.login-submit:hover svg {
    transform: translateX(3px);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(73, 96, 196, 0.3);
    outline-offset: 3px;
}

.login-submit:active {
    transform: translateY(0);
}

.login-access__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 2.25rem;
    color: #7d8495;
    font-size: 0.76rem;
    letter-spacing: 0.035em;
}

.login-security-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2fac82;
    box-shadow: 0 0 0 4px rgba(47, 172, 130, 0.13);
}

/*
 * En escritorio el login ocupa exactamente el alto disponible. Esto evita
 * que 100vh mas el padding interno generen una barra de desplazamiento.
 */
@media (min-width: 901px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    body.bg-light,
    .panel-main,
    .panel-main > .container-fluid {
        height: 100%;
        min-height: 0;
    }

    .login-shell {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }

    .login-showcase,
    .login-showcase__content,
    .login-access {
        height: 100%;
        min-height: 0;
    }
}

/* Escala equilibrada para pantallas Full HD vistas al 100 %. */
@media (max-height: 980px) and (min-width: 901px) {
    .login-showcase__content {
        padding-top: clamp(1.65rem, 3vh, 2.5rem);
        padding-bottom: clamp(1.4rem, 2.6vh, 2.15rem);
    }

    .login-brand__logo-wrap {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }

    .login-brand__logo {
        width: 37px;
        height: 37px;
    }

    .login-showcase__message {
        padding-top: 1.5rem;
        padding-bottom: 1.15rem;
    }

    .login-showcase h1 {
        margin-top: 0.9rem;
        margin-bottom: 0.75rem;
        font-size: clamp(2.35rem, min(3.35vw, 6vh), 3.65rem);
        line-height: 1.02;
    }

    .login-showcase__intro {
        font-size: 0.98rem;
        line-height: 1.5;
    }

    .login-capabilities {
        gap: 0.75rem;
        margin-top: 1.4rem;
    }

    .login-capabilities li {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 0.85rem;
    }

    .login-capabilities__icon {
        width: 42px;
        height: 42px;
        border-radius: 11px;
    }

    .login-capabilities__icon svg {
        width: 20px;
        height: 20px;
    }

    .login-capabilities strong {
        font-size: 0.92rem;
    }

    .login-capabilities small {
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .login-showcase__footer {
        font-size: 0.68rem;
    }

    .login-access {
        padding: clamp(2rem, 4vw, 4rem);
    }

    .login-access__heading {
        margin-bottom: 1.55rem;
    }

    .login-access__heading h2 {
        margin-top: 0.75rem;
        padding-bottom: 0.8rem;
        font-size: 2.35rem;
    }

    .login-access__heading p {
        font-size: 0.93rem;
    }

    .login-form {
        gap: 1rem;
    }

    .login-field {
        gap: 0.45rem;
    }

    .login-control input,
    .login-submit {
        min-height: 50px;
    }

    .login-submit {
        margin-top: 0.35rem;
    }

    .login-access__footer {
        margin-top: 1.4rem;
    }
}

@media (max-width: 1180px) {
    .login-shell {
        grid-template-columns: minmax(0, 1fr) minmax(410px, 0.82fr);
    }

    .login-showcase__content {
        padding-right: 3rem;
        padding-left: 3rem;
    }

    .login-showcase h1 {
        font-size: clamp(2.35rem, 4.25vw, 3.8rem);
    }
}

@media (max-width: 900px) {
    .login-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(230px, 31vh) minmax(0, auto);
        overflow: visible;
    }

    .login-showcase,
    .login-showcase__content {
        min-height: 0;
    }

    .login-showcase {
        background-position: center 42%;
    }

    .login-showcase::after {
        right: -15vw;
        bottom: -40vw;
        width: 75vw;
        height: 75vw;
    }

    .login-showcase__content {
        height: 100%;
        justify-content: space-between;
        padding: 1.7rem clamp(1.5rem, 6vw, 4rem) 1.8rem;
    }

    .login-brand__logo-wrap {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .login-brand__logo {
        width: 36px;
        height: 36px;
    }

    .login-showcase__message {
        width: min(630px, 100%);
        margin: 0;
        padding: 1.5rem 0 0;
    }

    .login-eyebrow--light,
    .login-showcase__intro,
    .login-capabilities,
    .login-showcase__footer {
        display: none;
    }

    .login-showcase h1 {
        max-width: 600px;
        margin: 0;
        font-size: clamp(1.8rem, 5.8vw, 2.65rem);
        line-height: 1.08;
    }

    .login-access {
        min-height: calc(100vh - 230px);
        align-items: start;
        padding: clamp(2.35rem, 7vw, 4rem) clamp(1.5rem, 8vw, 5rem) 2.5rem;
        box-shadow: 0 -10px 34px rgba(6, 10, 38, 0.12);
    }

    .login-access__content {
        width: min(520px, 100%);
        margin: 0 auto;
    }
}

@media (max-width: 575px) {
    .panel-main > .container-fluid > .mb-4 {
        top: 0.85rem;
        right: 0.85rem;
        width: calc(100vw - 1.7rem);
    }

    .login-shell {
        grid-template-rows: 178px minmax(0, auto);
    }

    .login-showcase__content {
        padding: 1.2rem 1.25rem 1.35rem;
    }

    .login-brand__logo-wrap {
        width: 42px;
        height: 42px;
    }

    .login-brand__logo {
        width: 31px;
        height: 31px;
    }

    .login-brand__copy strong {
        font-size: 0.88rem;
    }

    .login-brand__copy small {
        margin-top: 0.28rem;
        font-size: 0.59rem;
    }

    .login-showcase__message {
        padding-top: 0.8rem;
    }

    .login-showcase h1 {
        font-size: clamp(1.45rem, 7vw, 1.9rem);
    }

    .login-access {
        min-height: calc(100vh - 178px);
        padding: 2.15rem 1.25rem 1.75rem;
    }

    .login-access__heading {
        margin-bottom: 1.75rem;
    }

    .login-access__heading h2 {
        margin-top: 0.72rem;
        font-size: 2rem;
    }

    .login-access__heading p {
        font-size: 0.9rem;
    }

    .login-form {
        gap: 1.1rem;
    }

    .login-control input,
    .login-submit {
        min-height: 52px;
    }

    .login-access__footer {
        margin-top: 1.75rem;
        text-align: center;
    }
}

@media (max-height: 720px) and (min-width: 901px) {
    .login-showcase__content {
        padding-top: 2rem;
        padding-bottom: 1.75rem;
    }

    .login-showcase__message {
        padding-top: 2rem;
        padding-bottom: 1.5rem;
    }

    .login-showcase h1 {
        font-size: clamp(2.25rem, 3.5vw, 3.5rem);
    }

    .login-capabilities {
        gap: 0.85rem;
        margin-top: 1.6rem;
    }

    .login-capabilities__icon {
        width: 42px;
        height: 42px;
    }

    .login-capabilities li {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .login-access__heading {
        margin-bottom: 1.6rem;
    }

    .login-access__heading h2 {
        font-size: 2.25rem;
    }

    .login-form {
        gap: 1rem;
    }

    .login-control input,
    .login-submit {
        min-height: 50px;
    }

    .login-access__footer {
        margin-top: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-control input,
    .login-password-toggle,
    .login-submit,
    .login-submit svg {
        transition: none;
    }
}