/* ==========================================================
   SGI · Autenticación
========================================================== */

.sgi-auth-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(
            circle at top left,
            rgba(79, 70, 229, 0.09),
            transparent 34%
        ),
        #f4f6fb;
}

.sgi-auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.sgi-login-card {
    width: min(var(--sgi-login-width), 100%);
    min-height: 660px;
    display: grid;
    grid-template-columns: 50% 50%;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 32px;
    background: var(--sgi-surface);
    box-shadow: var(--sgi-shadow-lg);
}

/* Panel izquierdo */

.sgi-login-left {
    position: relative;
    min-width: 0;
    min-height: 660px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    overflow: hidden;
    padding: 46px 48px 40px;
    background: #123365;
    color: var(--sgi-brand-text);
}

.sgi-login-left::before,
.sgi-login-left::after {
    position: absolute;
    left: -12%;
    width: 125%;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.sgi-login-left::before {
    bottom: -41%;
    height: 58%;
    transform: rotate(-4deg);
}

.sgi-login-left::after {
    bottom: -33%;
    height: 52%;
    transform: rotate(4deg);
}

.sgi-login-left-content,
.sgi-login-location {
    position: relative;
    z-index: 1;
}

.sgi-login-left-content {
    max-width: 430px;
    margin: auto 0;
    transform: translateY(10px);
}

.sgi-login-main-logo {
    width: 160px;
    height: 160px;
    display: block;
    object-fit: contain;
    filter: invert(1);
}

.sgi-login-left-content h1 {
    margin: 24px 0 0;
    color: #ffffff;
    font-size: 42px;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.sgi-login-left-content p {
    max-width: 360px;
    margin: 22px 0 0;
    color: var(--sgi-brand-muted);
    font-size: 17px;
    line-height: 1.8;
}

.sgi-login-location {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--sgi-brand-muted);
    font-size: 13px;
}

.sgi-login-location i {
    color: #a5b4fc;
    font-size: 15px;
}

/* Panel derecho */

.sgi-login-right {
    min-width: 0;
    min-height: 660px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--sgi-surface);
}

.sgi-login-box {
    width: 100%;
    max-width: 400px;
    transform: translateY(-18px);
}

.sgi-login-heading {
    margin-bottom: 32px;
}

.sgi-login-heading h2 {
    margin: 0;
    color: var(--sgi-heading);
    font-size: 38px;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.sgi-login-heading p {
    margin: 12px 0 0;
    color: var(--sgi-muted);
    font-size: 15px;
    line-height: 1.55;
}

.sgi-login-form .sgi-form-group {
    margin-bottom: 21px;
}

.sgi-login-form .sgi-input-with-icon input {
    height: 56px;
}

.sgi-login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 23px;
    padding: 14px 15px;
    border: 1px solid #fecdd3;
    border-radius: var(--sgi-radius-md);
    background: var(--sgi-danger-soft);
    color: var(--sgi-danger);
    font-size: 13px;
    line-height: 1.5;
}

.sgi-login-button {
    width: 100%;
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 4px;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--sgi-radius-md);
    background:
        linear-gradient(
            135deg,
            var(--sgi-primary),
            #6d3df2
        );
    color: #ffffff;
    cursor: pointer;
    font-weight: 750;
    box-shadow:
        0 18px 35px
        rgba(79, 70, 229, 0.22);
    transition:
        transform var(--sgi-transition),
        box-shadow var(--sgi-transition),
        filter var(--sgi-transition);
}

.sgi-login-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 20px 38px
        rgba(79, 70, 229, 0.26);
    filter: brightness(1.03);
}

.sgi-login-button:focus-visible {
    outline: 4px solid rgba(79, 70, 229, 0.18);
    outline-offset: 3px;
}

.sgi-login-support {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 25px;
    padding-top: 21px;
    border-top: 1px solid var(--sgi-border);
    color: #7b8798;
}

.sgi-login-support i {
    margin-top: 2px;
    color: #7c72eb;
    font-size: 15px;
}

.sgi-login-support p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
}

/* Responsive */

@media (max-width: 900px) {
    .sgi-auth-page {
        align-items: flex-start;
        padding: 18px;
    }

    .sgi-login-card {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .sgi-login-left {
        min-height: 430px;
        padding: 38px 40px;
    }

    .sgi-login-left-content {
        margin: 30px 0;
        transform: none;
    }

    .sgi-login-main-logo {
        width: 120px;
        height: 120px;
    }

    .sgi-login-left-content h1 {
        font-size: 34px;
    }

    .sgi-login-right {
        min-height: auto;
        padding: 52px 40px;
    }

    .sgi-login-box {
        transform: none;
    }
/* ==========================================================
   Acceso con Google
========================================================== */

.sgi-login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 18px;
    color: var(--sgi-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.sgi-login-divider::before,
.sgi-login-divider::after {
    height: 1px;
    flex: 1;
    background: var(--sgi-border);
    content: "";
}

.sgi-login-divider span {
    line-height: 1;
}

.sgi-google-login {
    width: 100%;
    display: flex;
    justify-content: center;
}

.sgi-google-signin-button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.sgi-google-signin-button > div,
.sgi-google-signin-button iframe {
    max-width: 100% !important;
}


.sgi-google-login-note {
    margin: 9px 0 0;
    color: var(--sgi-muted);
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

/* ==========================================================
   PC · Sidebar preview del login + corrección de layout
   Base: SGI 71
========================================================== */

/* Cierra el @media (max-width: 900px) heredado que faltaba cerrar. */
}

.sgi-auth-preview-sidebar { display: none; }

@media (min-width: 1001px) {
    :root { --sgi-auth-sidebar-w: 272px; }

    .sgi-auth-body { padding-left: var(--sgi-auth-sidebar-w); }

    .sgi-auth-preview-sidebar {
        position: fixed;
        z-index: 1000;
        inset: 0 auto 0 0;
        width: var(--sgi-auth-sidebar-w);
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #0d366f;
        color: #eef4ff;
        box-shadow: 8px 0 28px rgba(13, 54, 111, .10);
    }

    .sgi-auth-preview-brand {
        flex: 0 0 auto;
        min-height: 96px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px 24px;
        border-bottom: 1px solid rgba(255,255,255,.12);
    }
    .sgi-auth-preview-brand img {
        display: block;
        width: 126px;
        max-height: 58px;
        object-fit: contain;
        filter: brightness(0) invert(1);
    }

    .sgi-auth-preview-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 20px 18px 18px;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,.25) transparent;
    }
    .sgi-auth-preview-label {
        margin: 12px 10px 8px;
        color: #9fb7da;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .06em;
    }
    .sgi-auth-preview-nav a,
    .sgi-auth-preview-account a {
        display: flex;
        align-items: center;
        gap: 13px;
        min-height: 48px;
        padding: 10px 12px;
        border-radius: 12px;
        color: #eef4ff;
        text-decoration: none;
        font-size: 15px;
        font-weight: 650;
        line-height: 1.25;
    }
    .sgi-auth-preview-nav a:hover,
    .sgi-auth-preview-account a:hover { background: rgba(255,255,255,.09); color: #fff; }
    .sgi-auth-preview-nav i,
    .sgi-auth-preview-account i { width: 24px; flex: 0 0 24px; text-align: center; font-size: 20px; }

    .sgi-auth-preview-account {
        flex: 0 0 auto;
        padding: 14px 18px 18px;
        border-top: 1px solid rgba(255,255,255,.12);
        background: #0d366f;
    }
    .sgi-auth-preview-user { font-size: 13px !important; font-weight: 500 !important; }
    .sgi-auth-preview-avatar {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid rgba(255,255,255,.75);
        border-radius: 50%;
        color: #fff;
        font-size: 13px;
        font-weight: 750;
    }
    .sgi-auth-preview-logout { font-weight: 750 !important; }

    .sgi-auth-page {
        min-height: 100vh;
        padding: 28px 32px;
    }

    .sgi-login-card {
        width: min(1220px, 100%);
        min-height: 0 !important;
        height: min(760px, calc(100vh - 56px));
    }
    .sgi-login-left,
    .sgi-login-right { min-height: 0 !important; }
    .sgi-login-left { background: #123365 !important; }
    .sgi-login-right { padding: 34px 48px !important; }
    .sgi-login-box { transform: none !important; }
}

@media (min-width: 1001px) and (max-height: 820px) {
    .sgi-auth-page { padding-top: 18px; padding-bottom: 18px; }
    .sgi-login-card { height: calc(100vh - 36px); }
    .sgi-login-left { padding-top: 30px; padding-bottom: 28px; }
    .sgi-login-left-content { transform: none !important; }
    .sgi-login-main-logo { width: 130px; height: 130px; }
    .sgi-login-left-content h1 { margin-top: 14px; font-size: 36px; }
    .sgi-login-left-content p { margin-top: 14px; line-height: 1.55; }
    .sgi-login-right { padding-top: 22px !important; padding-bottom: 22px !important; }
    .sgi-login-box { max-width: 420px; padding-top: 0 !important; padding-bottom: 0 !important; }
    .sgi-first-access { margin-bottom: 14px !important; }
    .sgi-login-heading.sgi-registered-heading { margin-bottom: 12px !important; }
    .sgi-login-form .sgi-form-group { margin-bottom: 12px !important; }
    .sgi-login-divider { margin: 9px 0 8px !important; }
    .sgi-login-links { margin-top: 9px !important; }
}

@media (max-width: 1000px) {
    .sgi-auth-body { padding-left: 0; }
    .sgi-auth-preview-sidebar { display: none !important; }
}

/* ==========================================================
   SGI · Password visibility toggle
   Mantiene el ojo dentro del campo en activación/reset.
========================================================== */
.sgi-login-form .sgi-input-with-icon .sgi-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sgi-muted, #778299);
    cursor: pointer;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
}

.sgi-login-form .sgi-input-with-icon .sgi-password-toggle:hover,
.sgi-login-form .sgi-input-with-icon .sgi-password-toggle:focus-visible {
    color: var(--sgi-primary, #4f46e5);
    background: rgba(79, 70, 229, 0.07);
}

.sgi-login-form .sgi-input-with-icon .sgi-password-toggle:focus-visible {
    outline: 2px solid rgba(79, 70, 229, 0.28);
    outline-offset: 1px;
}

.sgi-login-form .sgi-input-with-icon .sgi-password-toggle i {
    margin: 0;
    font-size: 20px;
    line-height: 1;
}

.sgi-login-form .sgi-input-with-icon input[type="password"],
.sgi-login-form .sgi-input-with-icon input[data-password-input],
.sgi-login-form .sgi-input-with-icon input[type="text"] {
    padding-right: 58px;
}
