/* =========================================================
   Login SGD - Centro Vacacional Huampani
   Estilos aislados para no afectar el resto del SGD.
   ========================================================= */

.sgd-login-page,
.sgd-login-page * {
    box-sizing: border-box;
}

.sgd-login-page {
    --huampani-green: #0b6b47;
    --huampani-green-dark: #075238;
    --huampani-green-soft: #e8f2e9;
    --huampani-orange: #f59a23;
    --huampani-ink: #243b35;
    --huampani-muted: #60716c;
    --huampani-line: #d8e2df;

    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 32px 48px 20px;
    color: var(--huampani-ink);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    font-family: Arial, Helvetica, sans-serif;
}

.sgd-login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg,
            rgba(249, 250, 244, .91) 0%,
            rgba(249, 250, 244, .84) 34%,
            rgba(240, 247, 240, .63) 54%,
            rgba(239, 246, 239, .22) 78%,
            rgba(239, 246, 239, .12) 100%);
}

.sgd-login-page::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: -8%;
    right: -8%;
    bottom: -126px;
    height: 198px;
    border-radius: 50% 50% 0 0;
    background:
        linear-gradient(174deg,
            rgba(11, 107, 71, .90) 0 15%,
            rgba(245, 154, 35, .88) 15% 22%,
            rgba(250, 249, 241, .97) 22% 100%);
    transform: rotate(-1deg);
}

.sgd-login-shell {
    position: relative;
    z-index: 1;
    width: min(1220px, 100%);
    min-height: calc(100vh - 110px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 480px;
    align-items: center;
    gap: 64px;
}

/* HERO / IDENTIDAD */
.sgd-login-hero {
    align-self: center;
    max-width: 680px;
    padding: 8px 0 24px;
}

.sgd-login-logo {
    display: block;
    width: min(570px, 96%);
    max-height: 180px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 32px;
    mix-blend-mode: multiply;
}

.sgd-product-line {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 17px;
}

.sgd-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 16px;
    border-radius: 999px;
    color: var(--huampani-green-dark);
    background: rgba(214, 233, 216, .86);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .02em;
}

.sgd-product-line::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(11, 107, 71, .30);
}

.sgd-login-hero h1 {
    margin: 0;
    color: var(--huampani-green-dark);
    font-size: clamp(42px, 4vw, 60px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -.025em;
}

.sgd-login-description {
    width: min(600px, 95%);
    margin: 18px 0 25px;
    color: #415852;
    font-size: 19px;
    line-height: 1.48;
}

.sgd-login-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.sgd-hero-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 210px;
    min-height: 48px;
    padding: 10px 22px;
    border-radius: 10px;
    border: 1px solid var(--huampani-green);
    color: var(--huampani-green-dark) !important;
    background: rgba(255,255,255,.88);
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    transition: .18s ease;
}

.sgd-hero-action.primary {
    color: #fff !important;
    background: linear-gradient(180deg, #118055, #0b6747);
    border-color: #0b6747;
    box-shadow: 0 6px 16px rgba(7, 82, 56, .16);
}

.sgd-hero-action:hover,
.sgd-hero-action:focus {
    color: #fff !important;
    background: var(--huampani-green-dark);
    border-color: var(--huampani-green-dark);
}

/* TARJETA */
.sgd-login-card {
    width: 100%;
    padding: 27px 32px 24px;
    border-radius: 18px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(255,255,255,.75);
    box-shadow: 0 16px 40px rgba(35, 61, 52, .14);
    backdrop-filter: blur(2px);
    transition: box-shadow .18s ease, transform .18s ease;
}

.sgd-login-card-header {
    text-align: center;
    margin-bottom: 19px;
}

.sgd-login-card-header h2 {
    margin: 0 0 5px;
    color: var(--huampani-green-dark);
    font-size: 27px;
    line-height: 1.15;
    font-weight: 700;
}

.sgd-login-card-header p {
    margin: 0;
    color: #5f716c;
    font-size: 14px;
}

.sgd-login-field {
    margin-bottom: 13px;
}

.sgd-login-label {
    display: block;
    margin-bottom: 7px;
    color: #283d37;
    font-size: 14px;
    font-weight: 700;
}

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

.sgd-input-icon {
    position: absolute;
    z-index: 2;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c7c78;
    font-size: 16px;
    pointer-events: none;
}

.sgd-login-page #dlglogin .sgd-control,
.sgd-login-page #dlglogin .input.sgd-control,
.sgd-login-page #dlglogin .input16.sgd-control {
    width: 100%;
    height: 44px;
    padding: 8px 42px 8px 46px;
    border: 1px solid #ccd7d4;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: #273a35;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: normal;
    text-transform: none !important;
    box-shadow: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.sgd-login-page #dlglogin .sgd-control:focus {
    border-color: var(--huampani-green);
    box-shadow: 0 0 0 3px rgba(11, 107, 71, .11);
}

/* Evita que estilos heredados del SGD conviertan los placeholders a mayúsculas. */
.sgd-login-page #dlglogin .sgd-control::placeholder {
    color: #788781;
    text-transform: none !important;
    opacity: 1;
}

.sgd-login-page #dlglogin input.sgd-control {
    text-transform: none !important;
}

.sgd-login-page #dlglogin .sgd-control[readonly] {
    background: #fff;
    cursor: pointer;
}

.sgd-password-toggle,
.sgd-dependency-toggle {
    position: absolute;
    z-index: 3;
    right: 4px;
    top: 4px;
    width: 37px;
    height: 37px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #697a75;
}

.sgd-password-toggle:hover,
.sgd-dependency-toggle:hover {
    color: var(--huampani-green-dark);
    background: #eef5ef;
}

/* CAPTCHA */
.sgd-captcha-panel {
    display: grid;
    grid-template-columns: 1fr 46px;
    gap: 9px;
    align-items: stretch;
    margin-bottom: 8px;
}

.sgd-captcha-image {
    display: block;
    width: 100%;
    height: 58px;
    object-fit: cover;
    border: 1px solid #cbd7d3;
    border-radius: 8px;
    background: #f7f8f7;
}

.sgd-captcha-refresh {
    border: 0;
    border: 1px solid #d4dfdb;
    border-radius: 8px;
    color: var(--huampani-green);
    background: #eaf3eb;
    font-size: 19px;
}

.sgd-captcha-refresh:hover,
.sgd-captcha-refresh:focus {
    color: #fff;
    background: var(--huampani-green);
}

/* DEPENDENCIA */
.sgd-dependency-wrap .sgd-control {
    padding-right: 45px !important;
}

/* BOTON INGRESAR */
.sgd-login-submit {
    width: 100%;
    height: 48px;
    margin-top: 3px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(180deg, #118055, #09613f);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(7, 82, 56, .14);
    transition: .18s ease;
}

.sgd-login-submit:hover,
.sgd-login-submit:focus {
    color: #fff;
    background: #075238;
    transform: translateY(-1px);
}

.sgd-login-page #dlglogin {
    position: relative;
    background: transparent;
}

.sgd-login-page #dlglogin_principal {
    position: static;
    width: auto;
    margin: 0;
    background: transparent;
}

.sgd-login-page .padded-table10,
.sgd-login-page .padded-table10 tbody,
.sgd-login-page .padded-table10 tr,
.sgd-login-page .padded-table10 td {
    display: block;
    width: auto;
    padding: 0;
}

/* MENSAJES */
.sgd-login-page #dlglogin .ui-messages-info,
.sgd-login-page #dlglogin .ui-messages-warn,
.sgd-login-page #dlglogin .ui-messages-error,
.sgd-login-page #dlglogin .ui-messages-fatal {
    margin: 12px 0 0;
    border-radius: 7px;
    font-size: 12px;
}

/* FOOTER: solo Requisitos + Cambiar contraseña */
.sgd-login-footer {
    position: relative;
    z-index: 2;
    width: min(860px, 86%);
    margin: 3px auto 0;
    padding-top: 17px;
    border-top: 1px solid rgba(11, 107, 71, .52);
}

.sgd-login-footer .navbar-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.sgd-login-footer .navbar-login > li {
    display: flex;
    align-items: center;
}

.sgd-login-footer .navbar-login > li + li::before {
    content: "";
    display: block;
    width: 1px;
    height: 24px;
    margin: 0 42px;
    background: rgba(11, 107, 71, .42);
}

.sgd-login-footer .navbar-login > li > a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--huampani-green-dark) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
}

.sgd-login-footer .navbar-login > li > a:hover {
    color: var(--huampani-orange) !important;
}

.sgd-login-footer .navbar-login .glyphicon {
    font-size: 18px;
}

/* Ocultos / compatibilidad */
.sgd-login-page #coUsuariolabel {
    display: none;
}

@media (max-width: 1050px) {
    .sgd-login-page {
        padding: 28px 28px 20px;
    }

    .sgd-login-shell {
        grid-template-columns: 1fr 440px;
        gap: 35px;
    }

    .sgd-login-hero h1 {
        font-size: 44px;
    }

    .sgd-login-description {
        font-size: 17px;
    }
}

@media (max-width: 820px) {
    .sgd-login-page {
        overflow: auto;
        padding: 24px 18px 26px;
    }

    .sgd-login-page::before {
        background: rgba(246, 249, 244, .88);
    }

    .sgd-login-page::after {
        display: none;
    }

    .sgd-login-shell {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .sgd-login-hero {
        max-width: 560px;
        margin: 0 auto;
        text-align: center;
    }

    .sgd-login-logo {
        width: min(400px, 90%);
        margin: 0 auto 18px;
        object-position: center;
    }

    .sgd-product-line {
        justify-content: center;
    }

    .sgd-product-line::after {
        display: none;
    }

    .sgd-login-hero h1 {
        font-size: 38px;
    }

    .sgd-login-description {
        margin-left: auto;
        margin-right: auto;
        font-size: 16px;
    }

    .sgd-login-actions {
        justify-content: center;
    }

    .sgd-login-card {
        width: min(500px, 100%);
        margin: 0 auto;
    }

    .sgd-login-footer {
        width: 100%;
        margin-top: 22px;
    }
}

@media (max-width: 520px) {
    .sgd-login-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .sgd-login-card {
        padding: 24px 18px 22px;
        border-radius: 15px;
    }

    .sgd-login-hero h1 {
        font-size: 32px;
    }

    .sgd-hero-action {
        width: 100%;
    }

    .sgd-login-footer .navbar-login {
        flex-direction: column;
        gap: 6px;
    }

    .sgd-login-footer .navbar-login > li + li::before {
        display: none;
    }
}


@media (prefers-reduced-motion: reduce) {
    .sgd-login-page *,
    .sgd-login-page *::before,
    .sgd-login-page *::after {
        transition: none !important;
    }
}

/* =========================================================
   FIX MODALES LEGACY DEL LOGIN

   Los modales legacy se insertan al final del <body> y usan
   .cuadrow { position:absolute }. Al inicializarse como draggable,
   el contenedor padre puede quedar situado después del contenido
   del login; por eso el navegador termina desplazándose hacia abajo.

   Se fijan al viewport únicamente los modales que pueden abrirse
   desde la pantalla de login. No se altera el comportamiento del
   resto de ventanas del SGD.
   ========================================================= */
#windowChangePwd > .cuadrow,
#windowDependenciaAcceso > .cuadrow,
#windowVerificaRequisitosSO > .cuadrow,
#windowAlertChangePwd > .cuadrow {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    max-width: calc(100vw - 28px) !important;
    max-height: calc(100vh - 28px) !important;
}

#windowChangePwd > .cuadrow > .panel,
#windowDependenciaAcceso > .cuadrow > .panel,
#windowVerificaRequisitosSO > .cuadrow > .panel,
#windowAlertChangePwd > .cuadrow > .panel {
    margin: 0 !important;
    max-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
}

#windowChangePwd > .cuadrow > .panel > .panel-body,
#windowDependenciaAcceso > .cuadrow > .panel > .panel-body,
#windowVerificaRequisitosSO > .cuadrow > .panel > .panel-body,
#windowAlertChangePwd > .cuadrow > .panel > .panel-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

#windowChangePwd > .bloquea,
#windowDependenciaAcceso > .bloquea,
#windowVerificaRequisitosSO > .bloquea,
#windowAlertChangePwd > .bloquea {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

/* Evita que el body conserve el desplazamiento vertical provocado
   por la posición legacy del modal al momento de abrirlo. */
body:has(#windowChangePwd),
body:has(#windowDependenciaAcceso),
body:has(#windowVerificaRequisitosSO),
body:has(#windowAlertChangePwd) {
    overflow: hidden;
}

@media (max-height: 650px) {
    #windowChangePwd > .cuadrow,
    #windowDependenciaAcceso > .cuadrow,
    #windowVerificaRequisitosSO > .cuadrow,
    #windowAlertChangePwd > .cuadrow {
        top: 12px !important;
        transform: translateX(-50%) !important;
    }
}
