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

   Escritorio : foto a pantalla completa, mensaje a la izquierda y
                tarjeta flotante a la derecha.
   Movil      : cabecera compacta + tarjeta a todo el ancho.
   Sin animaciones de entrada: la pantalla se pinta ya en su lugar.
   ========================================================================== */

:root {
    --af-navy: #1f3c88;
    --af-navy-dark: #172e6b;
    --af-sky: #4fa9d6;
    --af-sky-soft: rgba(79, 169, 214, .18);
    --af-ink: #13213a;
    --af-text: #33415a;
    --af-muted: #6f7f96;
    --af-line: #e3e9f2;
    --af-field: #f5f8fc;
    --af-danger: #d64550;
    --af-success: #15904f;
}

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

html {
    height: 100%;
}

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

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

/* Fondo --------------------------------------------------------------- */

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

.auth-bg:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(100deg, rgba(10, 26, 54, .88) 0%, rgba(10, 26, 54, .55) 50%, rgba(10, 26, 54, .30) 100%);
}

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

.auth-shell {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 40px 7vw;
}

/* Mensaje (izquierda) ------------------------------------------------- */

.auth-stage {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 560px;
    padding-right: 48px;
    color: #fff;
}

.auth-stage__badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 22px;
    padding: 7px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 40px;
}

.auth-stage__badge:before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 9px;
    border-radius: 50%;
    background: var(--af-sky);
}

.auth-stage__title {
    margin: 0 0 16px;
    font-size: 44px;
    font-weight: 300;
    line-height: 1.12;
    letter-spacing: -.6px;
    color: #fff;
}

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

.auth-stage__text {
    margin: 0;
    max-width: 460px;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .82);
}

.auth-stage__meta {
    display: flex;
    flex-wrap: wrap;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}

.auth-stage__meta li {
    display: inline-flex;
    align-items: center;
    margin: 0 10px 10px 0;
    padding: 8px 14px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
}

.auth-stage__meta i {
    margin-right: 8px;
    color: var(--af-sky);
}

/* Tarjeta (derecha) --------------------------------------------------- */

.auth-card {
    position: relative;
    flex: 0 0 420px;
    width: 420px;
    padding: 40px 38px 28px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(3, 12, 30, .45);
    overflow: hidden;
}

.auth-card:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--af-navy), var(--af-sky));
}

.auth-card__head {
    margin-bottom: 26px;
    text-align: center;
}

.auth-logo {
    display: block;
    width: auto;
    height: 86px;
    max-width: 100%;
    margin: 0 auto 22px;
}

.auth-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.3px;
    line-height: 1.25;
    color: var(--af-ink);
}

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

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

.auth-form {
    margin: 0;
}

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

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

.auth-input {
    position: relative;
}

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

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

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

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

.auth-input__control::placeholder {
    color: #a9b5c4;
}

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

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

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

.auth-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 22px;
}

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

.auth-row a:hover,
.auth-links a:hover {
    text-decoration: underline;
}

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

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

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: .2px;
    color: #fff;
    background: linear-gradient(90deg, var(--af-navy), #2a63b8);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 10px 22px rgba(31, 60, 136, .28);
    transition: filter .15s ease, box-shadow .15s ease;
}

.auth-btn i {
    margin-right: 8px;
}

.auth-btn:hover,
.auth-btn:focus {
    filter: brightness(1.08);
}

.auth-btn:active {
    box-shadow: 0 4px 12px rgba(31, 60, 136, .28);
}

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

.auth-alert {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    border-radius: 12px;
}

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

.auth-alert--error {
    color: #8e2a32;
    background: #fdeced;
    border: 1px solid #f6cdd1;
}

.auth-alert--success {
    color: #0f5c35;
    background: #e7f6ee;
    border: 1px solid #c4e8d4;
}

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

.auth-foot {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid var(--af-line);
    text-align: center;
    font-size: 11.5px;
    color: #98a6b8;
}

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

@media (max-width: 1199px) {
    .auth-shell {
        padding: 36px 5vw;
    }

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

/* Tablet y movil: tarjeta centrada, mensaje compacto arriba */
@media (max-width: 899px) {
    .auth-shell {
        flex-direction: column;
        justify-content: center;
        padding: 28px 20px;
    }

    .auth-stage {
        flex: 0 0 auto;
        max-width: 420px;
        width: 100%;
        padding: 0 0 22px;
        text-align: center;
    }

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

    .auth-stage__title {
        font-size: 26px;
        margin-bottom: 0;
    }

    .auth-stage__title strong {
        display: inline;
    }

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

    .auth-card {
        flex: 0 0 auto;
        width: 100%;
        max-width: 420px;
    }
}

@media (max-width: 479px) {
    .auth-shell {
        padding: 20px 16px;
    }

    .auth-card {
        padding: 32px 22px 22px;
        border-radius: 18px;
    }

    .auth-logo {
        height: 70px;
        margin-bottom: 18px;
    }

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

/* Movil horizontal: solo la tarjeta */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 991px) {
    .auth-stage {
        display: none;
    }

    .auth-logo {
        height: 54px;
        margin-bottom: 12px;
    }

    .auth-card__head {
        margin-bottom: 16px;
    }
}

/* ==========================================================================
   Cierre de sesion (logout.php)
   ========================================================================== */

.auth-center {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.auth-exit {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 40px 34px 30px;
    text-align: center;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(3, 12, 30, .45);
    overflow: hidden;
}

.auth-exit:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--af-navy), var(--af-sky));
}

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

.auth-exit__spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 18px;
    border: 3px solid var(--af-line);
    border-top-color: var(--af-navy);
    border-radius: 50%;
    animation: afSpin .9s linear infinite;
}

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

.auth-exit__title {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 600;
    color: var(--af-ink);
}

.auth-exit__text {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--af-muted);
}

.auth-exit__link {
    font-size: 13px;
    color: var(--af-navy);
}

@media (prefers-reduced-motion: reduce) {
    .auth-exit__spinner {
        animation-duration: 2.5s;
    }
}
