/* =============================================================
   Login — full-screen topography + overlay
   ============================================================= */

:root {
    --login-brand: #4e73df;
    --login-brand-dark: #2d5bd7;
    --login-ink: #152d5e;
    --login-muted: #64748b;
    --login-border: #e2e8f0;
    --login-radius: 1.25rem;
}

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

html,
body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--login-ink);
    -webkit-font-smoothing: antialiased;
}

/* Shell full-screen */
.login-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #f8fbff;
}

.login-shell__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url("../assets/img/login/hero-topography.png");
    background-size: cover;
    background-position: top right;
    background-repeat: no-repeat;
    pointer-events: none;
}

.login-shell__layout {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem 0;
    min-height: 0;
}

@media (min-width: 992px) {
    .login-shell__layout {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px);
        align-items: center;
        gap: 2rem 3rem;
        padding: 2.5rem clamp(2rem, 5vw, 4.5rem) 1.5rem;
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        box-sizing: border-box;
    }
}

/* Branding — zona blanca del fondo (izquierda) */
.login-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
}

.login-brand__inner {
    width: 100%;
    max-width: 34rem;
}

.login-hero__logo-wrap {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 1.35rem;
}

.login-hero__logo-wrap > .app-brand-logo-wrap .login-hero__logo {
    display: block;
    width: clamp(130px, 14vw, 180px);
    height: auto;
}

.login-hero__logo-wrap > .app-brand-logo-wrap--indio-only .login-hero__logo {
    width: clamp(128px, 14vw, 172px);
}

.login-hero__logo-wrap .app-brand-dual {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.login-hero__logo-wrap .app-brand-dual__sep {
    height: 1.65rem;
    margin: 0 0.4rem;
    background: rgba(47, 50, 69, 0.14);
}

.login-hero__logo-wrap .app-brand-dual__client,
.login-hero__logo-wrap .app-brand-dual__indio {
    display: block;
    flex: 0 0 auto;
    height: 1.85rem;
    width: auto !important;
    max-width: 5rem;
    object-fit: contain;
}

.login-hero__logo-wrap .app-brand-dual--large .app-brand-dual__client,
.login-hero__logo-wrap .app-brand-dual--large .app-brand-dual__indio {
    width: clamp(108px, 11.5vw, 148px) !important;
    max-width: clamp(108px, 11.5vw, 148px);
    height: auto;
}

.login-hero__logo-wrap .app-brand-dual--large .app-brand-dual__sep {
    height: clamp(2rem, 6vw, 2.65rem);
    margin: 0 0.4rem;
}

.login-hero__title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.55rem, 2.8vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--login-ink);
}

.login-hero__subtitle {
    margin: 0 0 1.35rem;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    line-height: 1.55;
    color: #475569;
    max-width: 28rem;
}

.login-hero__features {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: start;
    align-items: start;
}

.login-hero__feature:nth-child(3) {
    grid-column: 1;
}

.login-hero__feature {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e40af;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(78, 115, 223, 0.18);
}

.login-hero__feature svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Formulario — flota sobre zona azul (derecha) */
.login-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

@media (min-width: 992px) {
    .login-main {
        justify-self: stretch;
        align-items: stretch;
        align-self: center;
        width: 100%;
        max-width: 440px;
    }
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.75rem 1.75rem;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--login-radius);
    box-shadow:
        0 8px 32px rgba(21, 45, 94, 0.12),
        0 2px 8px rgba(21, 45, 94, 0.06);
    backdrop-filter: blur(10px);
}

.login-card--busy::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    pointer-events: none;
    animation: login-busy-fade 0.25s ease;
}

@keyframes login-busy-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.login-card__header {
    margin-bottom: 1.5rem;
}

.login-card__eyebrow {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--login-brand);
}

.login-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--login-ink);
}

.login-card__desc {
    margin: 0;
    font-size: 0.92rem;
    color: var(--login-muted);
    line-height: 1.45;
}

.login-alert {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.88rem;
}

.login-alert__head {
    font-weight: 600;
}

.login-alert ul {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    line-height: 1.35;
}

.login-field {
    margin-bottom: 1.1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--login-ink);
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap__icon {
    position: absolute;
    left: 0.9rem;
    width: 18px;
    height: 18px;
    color: var(--login-muted);
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.72rem 0.95rem 0.72rem 2.65rem;
    font-size: 0.9375rem;
    border: 1px solid var(--login-border);
    border-radius: 0.65rem;
    background: #fff;
    color: var(--login-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.15);
}

.login-input-wrap--password input {
    padding-right: 2.75rem;
}

.login-toggle-password {
    position: absolute;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--login-muted);
    cursor: pointer;
}

.login-toggle-password:hover {
    color: var(--login-brand);
    background: rgba(78, 115, 223, 0.08);
}

.login-toggle-password svg {
    width: 18px;
    height: 18px;
}

.login-submit {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.78rem 1rem;
    border: none;
    border-radius: 0.65rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--login-brand) 0%, var(--login-brand-dark) 100%);
    box-shadow: 0 8px 20px -6px rgba(78, 115, 223, 0.55);
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease, opacity 0.2s ease;
}

.login-submit:hover {
    filter: brightness(1.05);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-submit__spinner {
    display: none;
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-submit-spin 0.7s linear infinite;
}

.login-submit--loading {
    cursor: wait;
    pointer-events: none;
    filter: brightness(0.98);
}

.login-submit--loading .login-submit__spinner {
    display: block;
}

.login-submit:disabled {
    opacity: 0.95;
}

@keyframes login-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.login-shell__footer {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 1.15rem max(0.75rem, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.login-shell__footer-spacer {
    display: none;
}

.login-shell__footer-text {
    margin: 0;
    font-size: 0.78rem;
    color: #475569;
    text-align: center;
}

@media (min-width: 992px) {
    .login-shell__footer {
        grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px);
        gap: 0 3rem;
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 clamp(2rem, 5vw, 4.5rem) max(1rem, env(safe-area-inset-bottom));
    }

    .login-shell__footer-spacer {
        display: block;
    }

    .login-shell__footer-text {
        grid-column: 2;
        text-align: center;
        color: rgba(255, 255, 255, 0.88);
        text-shadow: 0 1px 2px rgba(21, 45, 94, 0.25);
    }
}

/* Mobile — SVG vertical: claro arriba (marca), olas abajo (formulario) */
@media (max-width: 991.98px) {
    .login-shell {
        background-color: #f8fbff;
        min-height: 100dvh;
        overflow-y: auto;
    }

    .login-shell__bg {
        inset: 0;
        height: auto;
        background-image: url("../assets/img/login/hero-topography.svg");
        background-position: center top;
        background-size: cover;
    }

    .login-shell::after {
        content: none;
    }

    .login-shell__layout {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.85rem;
        padding: max(1rem, env(safe-area-inset-top)) 1.15rem 0;
        /* min-height: 100dvh; */
        box-sizing: border-box;
    }

    .login-brand {
        flex: 0 0 auto;
        justify-content: center;
    }

    .login-brand__inner {
        text-align: center;
        max-width: none;
    }

    .login-hero__logo-wrap {
        display: inline-flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .login-hero__logo-wrap > .app-brand-logo-wrap .login-hero__logo {
        width: 100px;
    }

    .login-hero__logo-wrap > .app-brand-logo-wrap--indio-only .login-hero__logo {
        width: 104px;
    }

    .login-hero__logo-wrap .app-brand-dual__client,
    .login-hero__logo-wrap .app-brand-dual__indio {
        height: 1.5rem;
        max-width: 4.25rem;
    }

    .login-hero__logo-wrap .app-brand-dual--large .app-brand-dual__client,
    .login-hero__logo-wrap .app-brand-dual--large .app-brand-dual__indio {
        width: 92px !important;
        max-width: 92px;
        height: auto;
    }

    .login-hero__subtitle,
    .login-hero__features {
        display: none;
    }

    .login-hero__title {
        font-size: 1.05rem;
        line-height: 1.3;
        margin: 0 auto;
        max-width: 16rem;
        color: var(--login-ink);
    }

    .login-main {
        flex: 1 1 auto;
        align-items: stretch;
        width: 100%;
        margin-top: 0.35rem;
        min-height: 0;
    }

    .login-card {
        max-width: none;
        padding: 1.5rem 1.25rem 1.35rem;
        border-radius: 1rem;
        background: #fff;
        border: 1px solid rgba(226, 232, 240, 0.9);
        box-shadow: 0 12px 40px rgba(21, 45, 94, 0.18);
    }

    .login-card__header {
        margin-bottom: 1.15rem;
    }

    .login-card__title {
        font-size: 1.35rem;
    }

}

.d-none {
    display: none !important;
}
