/* ==========================================================================
   auth.css - Pantallas de autenticacion (login / recuperar cuenta / logout)

   Escritorio : foto a sangre + panel blanco de altura completa a la derecha.
   Movil      : foto arriba + hoja blanca redondeada ocupando el resto.
   ========================================================================== */

:root {
    --auth-accent: #0a6ed1;
    --auth-accent-dark: #08579f;
    --auth-accent-soft: rgba(10, 110, 209, .14);
    --auth-ink: #14202c;
    --auth-text: #2a3846;
    --auth-muted: #6d8090;
    --auth-line: #e2e9f0;
    --auth-field: #f4f7fa;
    --auth-danger: #d64550;
    --auth-success: #15904f;
}

/* Base ----------------------------------------------------------------- */

html,
body.auth-body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    padding: 0;
    background: #0d1b28;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

body.auth-body * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Fondo: la foto se ve nitida, sin velo de color ------------------------ */

.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: #0d1b28 url('../../../images/fondoSGI.jpeg') no-repeat center center;
    background-size: cover;
}

/* Solo un ligero oscurecido general para dar profundidad */
.auth-bg:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: -webkit-linear-gradient(top, rgba(8, 20, 32, .18), rgba(8, 20, 32, .42));
    background: linear-gradient(180deg, rgba(8, 20, 32, .18), rgba(8, 20, 32, .42));
}

/* Estructura ------------------------------------------------------------ */

.auth-shell {
    position: relative;
    z-index: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Zona de la foto (izquierda) ------------------------------------------- */

.auth-stage {
    position: relative;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
    padding: 56px 64px;
}

/* Degradado solo en la parte baja, para que se lea el texto */
.auth-stage:before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 68%;
    background: -webkit-linear-gradient(top, rgba(8, 20, 32, 0), rgba(8, 20, 32, .82));
    background: linear-gradient(180deg, rgba(8, 20, 32, 0), rgba(8, 20, 32, .82));
    pointer-events: none;
}

.auth-stage__inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
    color: #fff;
}

.auth-stage__badge {
    display: inline-block;
    margin-bottom: 18px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(10, 110, 209, .85);
    border-radius: 40px;
}

.auth-stage__title {
    margin: 0 0 14px;
    font-size: 38px;
    font-weight: 300;
    line-height: 1.18;
    letter-spacing: -.5px;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}

.auth-stage__title strong {
    display: block;
    font-weight: 700;
}

.auth-stage__text {
    margin: 0;
    max-width: 440px;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .82);
    text-shadow: 0 1px 12px rgba(0, 0, 0, .45);
}

.auth-stage__meta {
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.auth-stage__meta li {
    margin: 0 26px 8px 0;
    font-size: 13px;
    letter-spacing: .2px;
    color: rgba(255, 255, 255, .8);
}

.auth-stage__meta i {
    margin-right: 8px;
    color: #57a8ee;
}

/* Panel blanco (derecha) ------------------------------------------------ */

.auth-panel {
    position: relative;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 470px;
    flex: 0 0 470px;
    max-width: 470px;
    background: #fff;
    padding: 48px 56px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    box-shadow: -18px 0 60px rgba(0, 0, 0, .28);
    -webkit-animation: authSlide .55s cubic-bezier(.22, .68, .35, 1) both;
    animation: authSlide .55s cubic-bezier(.22, .68, .35, 1) both;
}

@-webkit-keyframes authSlide {
    from { opacity: 0; -webkit-transform: translateX(28px); }
    to   { opacity: 1; -webkit-transform: none; }
}

@keyframes authSlide {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: none; }
}

.auth-panel__body {
    width: 100%;
}

.auth-panel__head {
    margin-bottom: 30px;
}

.auth-logo {
    display: block;
    width: auto;
    max-width: 168px;
    max-height: 50px;
    height: auto;
    margin: 0 0 28px;
}

.auth-title {
    margin: 0 0 7px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.3px;
    color: var(--auth-ink);
    line-height: 1.2;
}

.auth-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--auth-muted);
    line-height: 1.5;
}

/* Formulario ------------------------------------------------------------ */

.auth-form {
    margin: 0;
}

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

.auth-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-input {
    position: relative;
}

.auth-input__icon {
    position: absolute;
    top: 50%;
    left: 16px;
    margin-top: -8px;
    width: 16px;
    font-size: 15px;
    line-height: 16px;
    text-align: center;
    color: #9dabb8;
    pointer-events: none;
    -webkit-transition: color .2s ease;
    transition: color .2s ease;
}

.auth-input:focus-within .auth-input__icon {
    color: var(--auth-accent);
}

.auth-input__control {
    display: block;
    width: 100%;
    height: 52px;
    padding: 10px 16px 10px 46px;
    font-size: 16px; /* evita el zoom automatico en iOS */
    color: var(--auth-text);
    background: var(--auth-field);
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-input__control--toggle {
    padding-right: 52px;
}

.auth-input__control::-webkit-input-placeholder { color: #a8b4c0; }
.auth-input__control::-moz-placeholder          { color: #a8b4c0; opacity: 1; }
.auth-input__control:-ms-input-placeholder      { color: #a8b4c0; }

.auth-input__control:focus {
    background: #fff;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-accent-soft);
}

.auth-input__toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 52px;
    padding: 0;
    background: none;
    border: 0;
    color: #9dabb8;
    font-size: 15px;
    cursor: pointer;
    outline: none;
}

.auth-input__toggle:hover,
.auth-input__toggle:focus {
    color: var(--auth-accent);
}

/* Fila auxiliar (enlace de ayuda sobre el boton) ------------------------- */

.auth-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -6px 0 22px;
}

.auth-row a {
    font-size: 13.5px;
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-row a:hover,
.auth-row a:focus {
    color: var(--auth-accent-dark);
    text-decoration: underline;
}

/* Boton ----------------------------------------------------------------- */

.auth-btn {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #fff;
    background: var(--auth-accent);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 10px 24px rgba(10, 110, 209, .28);
    -webkit-transition: background-color .18s ease, -webkit-transform .15s ease, box-shadow .2s ease;
    transition: background-color .18s ease, transform .15s ease, box-shadow .2s ease;
}

.auth-btn:hover,
.auth-btn:focus {
    color: #fff;
    background: var(--auth-accent-dark);
}

.auth-btn:active {
    -webkit-transform: translateY(1px);
    transform: translateY(1px);
    box-shadow: 0 5px 14px rgba(10, 110, 209, .26);
}

/* Enlaces --------------------------------------------------------------- */

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    display: inline-block;
    padding: 6px 4px;
    font-size: 13.5px;
    color: var(--auth-accent);
    text-decoration: none;
}

.auth-links a:hover,
.auth-links a:focus {
    color: var(--auth-accent-dark);
    text-decoration: underline;
}

/* Mensajes -------------------------------------------------------------- */

.auth-alert {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    margin-bottom: 22px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 10px;
    border-left: 3px solid transparent;
}

.auth-alert i {
    margin-right: 10px;
    margin-top: 2px;
    font-size: 15px;
}

.auth-alert--error {
    color: #8e2a32;
    background: #fdeced;
    border-left-color: var(--auth-danger);
}

.auth-alert--success {
    color: #0f5c35;
    background: #e7f6ee;
    border-left-color: var(--auth-success);
}

/* Pie ------------------------------------------------------------------- */

.auth-foot {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-line);
    text-align: center;
    font-size: 11.5px;
    letter-spacing: .2px;
    color: #97a5b3;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Escritorio mediano */
@media (max-width: 1279px) {
    .auth-stage {
        padding: 48px 48px;
    }

    .auth-stage__title {
        font-size: 33px;
    }

    .auth-panel {
        -ms-flex: 0 0 430px;
        flex: 0 0 430px;
        max-width: 430px;
        padding: 44px 44px;
    }
}

/* Tablet */
@media (max-width: 1023px) {
    .auth-stage {
        padding: 40px 36px;
    }

    .auth-stage__title {
        font-size: 28px;
    }

    .auth-stage__text {
        font-size: 14px;
    }

    .auth-panel {
        -ms-flex: 0 0 380px;
        flex: 0 0 380px;
        max-width: 380px;
        padding: 36px 34px;
    }

    /* el fondo fijo se comporta mal en iOS */
    .auth-bg {
        background-attachment: scroll;
    }
}

/* Movil: foto arriba + hoja blanca redondeada abajo ---------------------- */
@media (max-width: 767px) {
    .auth-shell {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .auth-stage {
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        min-height: 34vh;
        padding: 24px 22px 34px;
        padding-top: calc(24px + env(safe-area-inset-top));
    }

    .auth-stage:before {
        height: 100%;
        background: -webkit-linear-gradient(top, rgba(8, 20, 32, .25), rgba(8, 20, 32, .78));
        background: linear-gradient(180deg, rgba(8, 20, 32, .25), rgba(8, 20, 32, .78));
    }

    .auth-stage__inner {
        max-width: 100%;
    }

    .auth-stage__badge {
        margin-bottom: 12px;
    }

    .auth-stage__title {
        font-size: 25px;
    }

    .auth-stage__text,
    .auth-stage__meta {
        display: none;
    }

    .auth-panel {
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        margin-top: -24px;
        padding: 30px 24px 26px;
        padding-bottom: calc(26px + env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, .34);
        -webkit-box-pack: start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        -webkit-animation: authRise .5s cubic-bezier(.22, .68, .35, 1) both;
        animation: authRise .5s cubic-bezier(.22, .68, .35, 1) both;
    }

    /* el contenido arriba y el pie anclado al fondo de la hoja,
       para que el blanco sobrante no quede suelto en medio */
    .auth-panel__body {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
    }

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

    .auth-logo {
        max-width: 150px;
        max-height: 44px;
        margin-bottom: 20px;
    }

    .auth-title {
        font-size: 22px;
    }

    .auth-foot {
        margin-top: auto;
        padding-top: 18px;
    }
}

@-webkit-keyframes authRise {
    from { opacity: 0; -webkit-transform: translateY(26px); }
    to   { opacity: 1; -webkit-transform: none; }
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
}

/* Movil pequeno (320px - 359px) */
@media (max-width: 359px) {
    .auth-stage {
        min-height: 28vh;
        padding: 20px 18px 30px;
    }

    .auth-stage__title {
        font-size: 21px;
    }

    .auth-panel {
        padding: 26px 18px 22px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .auth-input__control {
        padding-left: 42px;
    }

    .auth-input__icon {
        left: 13px;
    }
}

/* Movil en horizontal: se oculta la foto, todo el ancho para el formulario */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 991px) {
    .auth-shell {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
    }

    .auth-stage {
        display: none;
    }

    .auth-panel {
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        max-width: 100%;
        margin-top: 0;
        border-radius: 0;
        padding: 24px 28px 20px;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }

    .auth-panel__body {
        max-width: 420px;
        margin: 0 auto;
    }

    .auth-logo {
        max-height: 38px;
        margin-bottom: 14px;
    }

    .auth-panel__head {
        margin-bottom: 18px;
    }

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

    .auth-foot {
        margin-top: 18px;
        padding-top: 12px;
    }
}

/* Pantallas grandes */
@media (min-width: 1600px) {
    .auth-stage {
        padding: 72px 88px;
    }

    .auth-stage__title {
        font-size: 44px;
    }

    .auth-panel {
        -ms-flex: 0 0 540px;
        flex: 0 0 540px;
        max-width: 540px;
        padding: 56px 68px;
    }
}

/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .auth-panel {
        -webkit-animation: none;
        animation: none;
    }
}

/* ==========================================================================
   Pantalla de cierre de sesion (logout.php)
   ========================================================================== */

.auth-body--dim .auth-bg:after {
    background: -webkit-linear-gradient(top, rgba(8, 20, 32, .74), rgba(8, 20, 32, .86));
    background: linear-gradient(180deg, rgba(8, 20, 32, .74), rgba(8, 20, 32, .86));
}

.auth-center {
    position: relative;
    z-index: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 20px;
}

.auth-exit {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 44px 34px 36px;
    text-align: center;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 18px;
    color: #fff;
    -webkit-animation: authRise .5s cubic-bezier(.22, .68, .35, 1) both;
    animation: authRise .5s cubic-bezier(.22, .68, .35, 1) both;
}

.auth-exit__spinner {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
}

.auth-exit__spinner i {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -11px 0 0 -11px;
    width: 22px;
    height: 22px;
    font-size: 22px;
    line-height: 22px;
    color: #8fcbf7;
}

.auth-exit__ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 72px;
    height: 72px;
    border: 3px solid rgba(255, 255, 255, .16);
    border-top-color: var(--auth-accent);
    border-radius: 50%;
    -webkit-animation: authSpin 1s linear infinite;
    animation: authSpin 1s linear infinite;
}

@-webkit-keyframes authSpin {
    to { -webkit-transform: rotate(360deg); }
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-exit__logo {
    display: block;
    max-width: 150px;
    max-height: 42px;
    height: auto;
    margin: 0 auto 26px;
}

.auth-exit__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
}

.auth-exit__text {
    margin: 0 0 26px;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .74);
}

.auth-exit__bar {
    height: 4px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, .14);
    border-radius: 4px;
    overflow: hidden;
}

.auth-exit__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: -webkit-linear-gradient(left, var(--auth-accent), #6fb7f2);
    background: linear-gradient(90deg, var(--auth-accent), #6fb7f2);
    border-radius: 4px;
    -webkit-animation: authProgress 2s ease-in-out forwards;
    animation: authProgress 2s ease-in-out forwards;
}

@-webkit-keyframes authProgress {
    to { width: 100%; }
}

@keyframes authProgress {
    to { width: 100%; }
}

.auth-exit__link {
    font-size: 13px;
    color: rgba(255, 255, 255, .74);
    text-decoration: underline;
}

.auth-exit__link:hover,
.auth-exit__link:focus {
    color: #fff;
}

@media (max-width: 575px) {
    .auth-exit {
        padding: 34px 22px 28px;
        border-radius: 16px;
    }

    .auth-exit__title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-exit,
    .auth-exit__ring,
    .auth-exit__bar span {
        -webkit-animation: none;
        animation: none;
    }

    .auth-exit__bar span {
        width: 100%;
    }
}
