:root {
    --auth-ink: #202938;
    --auth-muted: #737e8e;
    --auth-brand: #00a0ca;
    --auth-blue: var(--lg-apple-blue, #007aff);
    --auth-border: rgba(255, 255, 255, 0.6);
}

html {
    min-width: 320px;
    min-height: 100%;
}

body#kt_body.auth-glass-page {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--auth-ink);
    font-family: Poppins, sans-serif;
}

.auth-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
    gap: clamp(14px, 2.2vw, 30px);
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(14px, 2.2vw, 30px);
    box-sizing: border-box;
    isolation: isolate;
}

.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    min-height: calc(100svh - clamp(28px, 4.4vw, 60px));
    padding: clamp(30px, 4vw, 58px);
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    background:
        radial-gradient(ellipse at 88% 15%, rgba(0, 160, 202, 0.24), transparent 38%),
        radial-gradient(ellipse at 10% 100%, rgba(0, 122, 255, 0.18), transparent 45%),
        linear-gradient(145deg, #111722 0%, #142235 54%, #0b3044 100%);
    box-shadow: 0 24px 60px rgba(16, 30, 48, 0.17), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    z-index: -1;
    display: block;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.auth-brand-panel::before {
    top: -155px;
    right: -120px;
    width: 410px;
    height: 410px;
    box-shadow: 0 0 0 36px rgba(255, 255, 255, 0.018), 0 0 0 76px rgba(255, 255, 255, 0.015);
}

.auth-brand-panel::after {
    right: 15%;
    bottom: 9%;
    width: 220px;
    height: 220px;
    border-color: rgba(0, 160, 202, 0.13);
    box-shadow: 0 0 0 30px rgba(0, 160, 202, 0.035), 0 0 0 62px rgba(0, 160, 202, 0.025);
}

.auth-brand-content,
.auth-brand-footer {
    position: relative;
    z-index: 2;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: clamp(34px, 6vh, 76px);
    text-decoration: none;
}

.auth-logo img {
    display: block;
    width: auto;
    max-width: min(220px, 100%);
    max-height: 86px;
    height: auto;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 5px 18px rgba(0, 0, 0, 0.16));
}

.auth-brand-tag {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.73rem;
    font-weight: 500;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.auth-brand-tag-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #31c5e9;
    box-shadow: 0 0 12px rgba(49, 197, 233, 0.85);
}

.auth-brand-title {
    max-width: 590px;
    margin: 0 0 22px;
    color: #fff;
    font-size: clamp(2.25rem, 3.55vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.055em;
    line-height: 1.08;
    text-wrap: balance;
}

.auth-brand-title span {
    display: block;
    color: #33c7e9;
}

.auth-brand-description {
    max-width: 440px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(0.96rem, 1.1vw, 1.08rem);
    font-weight: 300;
    line-height: 1.85;
}

.auth-brand-visual {
    position: absolute;
    z-index: 0;
    right: -1%;
    bottom: 11%;
    width: min(86%, 550px);
    height: 36%;
    min-height: 190px;
    background-image: url(../media/illustrations/global.png);
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    opacity: 0.56;
    pointer-events: none;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.16));
}

.auth-brand-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 42px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.76rem;
    line-height: 1.5;
}

.auth-brand-footer svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    color: #55cce9;
}

.auth-main {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: calc(100svh - clamp(28px, 4.4vw, 60px));
    padding: clamp(10px, 3vw, 46px);
    box-sizing: border-box;
}

.auth-main-inner {
    width: 100%;
    max-width: 510px;
    margin-inline: auto;
}

.auth-form-card.card {
    position: relative;
    width: 100%;
    padding: clamp(26px, 3.5vw, 48px);
    overflow: hidden;
    border-radius: 24px !important;
}

.auth-form-card::before {
    position: absolute;
    top: 0;
    left: 12%;
    width: 76%;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
    pointer-events: none;
}

.auth-form-heading {
    margin-bottom: 32px;
}

.auth-form-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 23px;
    color: var(--auth-blue);
    background: rgba(0, 122, 255, 0.09);
    border: 1px solid rgba(0, 122, 255, 0.12);
    border-radius: 15px;
}

.auth-form-mark svg {
    display: block;
    width: 23px;
    height: 23px;
}

.auth-form-eyebrow {
    margin: 0 0 8px;
    color: var(--auth-blue);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.auth-form-title {
    margin: 0 0 10px;
    color: var(--auth-ink);
    font-size: clamp(1.8rem, 2.4vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1.2;
}

.auth-form-title span {
    color: var(--auth-brand);
}

.auth-form-subtitle {
    max-width: 400px;
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.92rem;
    line-height: 1.75;
}

.auth-field {
    margin-bottom: 23px;
}

.auth-field .form-label {
    display: block;
    margin-bottom: 9px;
    color: #343e4e;
    font-size: 0.83rem;
    font-weight: 600;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    width: 19px;
    height: 19px;
    color: #7f8b9a;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-input-wrap .form-control {
    min-height: 54px;
    padding-right: 14px !important;
    padding-left: 47px !important;
    color: var(--auth-ink);
    font-family: inherit;
    font-size: 0.91rem;
}

.auth-input-wrap .form-control::placeholder {
    color: #929baa;
    opacity: 1;
}

.auth-input-wrap .form-control:focus {
    outline: none;
}

.auth-password-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 9px;
}

.auth-password-row .form-label {
    margin-bottom: 0;
}

.auth-forgot-link {
    color: var(--auth-blue);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: right;
    text-decoration: none;
    text-underline-offset: 3px;
}

.auth-forgot-link:hover {
    color: var(--auth-blue);
    text-decoration: underline;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 54px;
    margin-top: 7px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 600;
}

.auth-submit svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.auth-submit:hover svg {
    transform: translateX(3px);
}

.auth-form-footnote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 0.75rem;
    text-align: center;
}

.auth-form-footnote svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: #6c9a83;
}

.auth-page-footer {
    margin-top: 20px;
    color: #818b9a;
    font-size: 0.72rem;
    line-height: 1.6;
    text-align: center;
}

.auth-glass-page a:focus-visible,
.auth-glass-page button:focus-visible,
.auth-glass-page input:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.38);
    outline-offset: 3px;
}

/* Portátiles pequeños y tabletas en vertical. */
@media (max-width: 1199.98px) and (min-width: 992px) {
    .auth-brand-panel {
        padding: 32px;
    }

    .auth-logo {
        margin-bottom: 44px;
    }

    .auth-brand-title {
        font-size: clamp(2.25rem, 3.2vw, 3.1rem);
    }

    .auth-main {
        padding: 18px;
    }

    .auth-form-card.card {
        padding: 34px;
    }
}

/* En tablet, el panel de marca pasa arriba para dar al formulario espacio real. */
@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 16px;
    }

    .auth-brand-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(140px, 30%);
        align-items: center;
        min-height: 245px;
        padding: clamp(24px, 4vw, 38px);
        border-radius: 26px;
    }

    .auth-logo {
        margin-bottom: 24px;
    }

    .auth-logo img {
        max-width: 180px;
        max-height: 66px;
    }

    .auth-brand-tag {
        margin-bottom: 15px;
    }

    .auth-brand-title {
        max-width: 560px;
        margin-bottom: 12px;
        font-size: clamp(2rem, 4.4vw, 3rem);
    }

    .auth-brand-description {
        max-width: 460px;
        font-size: 0.91rem;
        line-height: 1.65;
    }

    .auth-brand-visual {
        right: -2%;
        bottom: 0;
        width: 42%;
        height: 100%;
        min-height: 0;
        opacity: 0.36;
        background-position: center bottom;
    }

    .auth-brand-footer {
        display: none;
    }

    .auth-main {
        min-height: auto;
        padding: 8px 0 20px;
    }

    .auth-main-inner {
        max-width: 550px;
    }

    .auth-form-card.card {
        padding: clamp(28px, 4vw, 42px);
    }

    .auth-form-heading {
        margin-bottom: 27px;
    }
}

/* Móviles: menos decoración y márgenes para evitar scroll horizontal. */
@media (max-width: 575.98px) {
    .auth-shell {
        gap: 12px;
        padding: 10px;
    }

    .auth-brand-panel {
        display: block;
        min-height: 0;
        padding: 22px 20px 24px;
        border-radius: 22px;
    }

    .auth-logo {
        margin-bottom: 24px;
    }

    .auth-logo img {
        max-width: 152px;
        max-height: 50px;
    }

    .auth-brand-tag {
        gap: 7px;
        margin-bottom: 13px;
        padding: 6px 9px;
        font-size: 0.63rem;
        letter-spacing: 0.055em;
    }

    .auth-brand-title {
        max-width: 370px;
        margin-bottom: 10px;
        font-size: clamp(1.72rem, 7vw, 2.25rem);
        line-height: 1.12;
    }

    .auth-brand-description {
        max-width: 360px;
        font-size: 0.83rem;
        line-height: 1.6;
    }

    .auth-brand-visual {
        right: -18%;
        width: 72%;
        height: 100%;
        opacity: 0.16;
        background-position: right bottom;
    }

    .auth-main {
        padding: 4px 0 10px;
    }

    .auth-form-card.card {
        padding: 25px 20px 23px;
        border-radius: 21px !important;
    }

    .auth-form-mark {
        width: 43px;
        height: 43px;
        margin-bottom: 19px;
        border-radius: 13px;
    }

    .auth-form-heading {
        margin-bottom: 25px;
    }

    .auth-form-title {
        font-size: 1.78rem;
    }

    .auth-form-subtitle {
        font-size: 0.85rem;
    }

    .auth-field {
        margin-bottom: 20px;
    }

    .auth-password-row {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .auth-forgot-link {
        font-size: 0.75rem;
    }

    .auth-input-wrap .form-control,
    .auth-submit {
        min-height: 51px;
    }

    .auth-form-footnote {
        margin-top: 20px;
        font-size: 0.7rem;
    }

    .auth-page-footer {
        margin-top: 13px;
    }
}

@media (max-width: 359.98px) {
    .auth-brand-panel {
        padding: 19px 16px 21px;
    }

    .auth-form-card.card {
        padding: 22px 16px 20px;
    }

    .auth-password-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Reduce movimiento para usuarios con esta preferencia de accesibilidad. */
@media (prefers-reduced-motion: reduce) {
    .auth-glass-page *,
    .auth-glass-page *::before,
    .auth-glass-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}