/* ==========================================================================
   Login — DAP Antártica
   Diseño dedicado a la vista de autenticación (Views/index.php).
   ========================================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    background: #f4f6f9;
    font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- Panel de marca (izquierda) ---------- */
.login-brand {
    position: relative;
    flex: 1 1 56%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 3rem;
    background: #001d3d;
    color: #fff;
}

/* Slideshow fotográfico */
.login-brand__slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.login-brand__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.6s ease, transform 8s ease;
}

.login-brand__slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.login-brand__scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(160deg, rgba(0, 15, 33, 0.92) 0%, rgba(0, 42, 89, 0.82) 45%, rgba(10, 99, 191, 0.55) 100%);
    pointer-events: none;
}

.login-brand__glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at 75% 85%, rgba(237, 125, 49, 0.28), transparent 55%);
    pointer-events: none;
}

.login-brand__content {
    position: relative;
    z-index: 3;
    max-width: 460px;
    text-align: center;
}

.login-brand__dots {
    position: relative;
    z-index: 3;
    display: flex;
    gap: 0.5rem;
    margin-top: 2.25rem;
}

.login-brand__dots button {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background .2s ease, width .2s ease;
}

.login-brand__dots button.active {
    background: #ff9d4d;
    width: 22px;
}

/* Logo sin fondo: variante clara (ala en blanco) pensada para el panel oscuro */
.login-brand__logo {
    display: block;
    width: 250px;
    max-width: 70%;
    height: auto;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
}

.login-brand__title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}

.login-brand__subtitle {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2.5rem;
}

.login-brand__stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.login-brand__stat {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.55rem 1rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.login-brand__stat i {
    color: #ff9d4d;
}

/* Ruta de vuelo decorativa */
.login-brand__route {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 70px;
    width: 100%;
    height: auto;
    z-index: 2;
    opacity: 0.6;
}

@keyframes fly {
    from { stroke-dashoffset: 340; }
    to   { stroke-dashoffset: 0; }
}

.login-brand__route .flight-line {
    stroke-dasharray: 6 10;
    animation: fly 12s linear infinite;
}

/* ---------- Panel de formulario (derecha) ---------- */
.login-form-panel {
    flex: 1 1 44%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #ffffff;
}

.login-form-wrap {
    width: 100%;
    max-width: 380px;
}

.login-form-wrap__logo {
    width: 120px;
    display: none;
    margin: 0 auto 1.5rem;
}

.login-form-wrap h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1c2b39;
    margin-bottom: 0.35rem;
}

.login-form-wrap p.subtitle {
    color: #7b8a9a;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.login-input-group {
    position: relative;
    margin-bottom: 1.15rem;
}

.login-input-group .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa8b7;
    font-size: 0.95rem;
    transition: color .15s ease;
    z-index: 3;
}

.login-input-group input.form-control {
    height: 52px;
    padding-left: 44px;
    padding-right: 44px;
    border: 1.5px solid #e3e8ef;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.login-input-group input.form-control:focus {
    background: #fff;
    border-color: #0a63bf;
    box-shadow: 0 0 0 4px rgba(10, 99, 191, 0.12);
}

.login-input-group input.form-control:focus ~ .icon {
    color: #0a63bf;
}

.login-input-group input.form-control.is-invalid {
    border-color: #e5484d;
    background-image: none;
}

.login-input-group .toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9aa8b7;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 3;
}
.login-input-group .toggle-pass:hover { color: #0a63bf; }
.login-input-group .toggle-pass .icon-eye-slash { display: none; }
.login-input-group .toggle-pass.is-visible .icon-eye { display: none; }
.login-input-group .toggle-pass.is-visible .icon-eye-slash { display: inline-block; }

.login-submit {
    height: 52px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.98rem;
    background: linear-gradient(135deg, #0a63bf, #004A99);
    border: none;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    box-shadow: 0 8px 20px rgba(10, 99, 191, 0.28);
}
.login-submit:hover  { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(10, 99, 191, 0.35); }
.login-submit:active { transform: translateY(0); }
.login-submit:disabled { opacity: 0.75; transform: none; }

.login-alert {
    border-radius: 10px;
    font-size: 0.88rem;
    border: none;
    background: #fdeceb;
    color: #b02a2a;
    padding: 0.75rem 1rem;
}

.login-form-footer {
    margin-top: 2.25rem;
    text-align: center;
    font-size: 0.78rem;
    color: #a7b2bd;
}

/* ---------- Opciones, enlaces y vistas ---------- */
.login-view { animation: loginFade .3s ease both; }

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

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.login-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #55657a;
    cursor: pointer;
    user-select: none;
}
.login-check input { position: absolute; opacity: 0; pointer-events: none; }
.login-check__box {
    width: 18px;
    height: 18px;
    border: 1.5px solid #c3cdd9;
    border-radius: 5px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.6rem;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.login-check input:checked + .login-check__box { background: #0a63bf; border-color: #0a63bf; color: #fff; }
.login-check input:focus-visible + .login-check__box { box-shadow: 0 0 0 4px rgba(10, 99, 191, 0.18); }

.login-link {
    color: #0a63bf;
    font-weight: 600;
    text-decoration: none;
}
.login-link:hover { color: #004A99; text-decoration: underline; }

.login-back {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.88rem;
}
.login-back__sep { margin: 0 0.5rem; color: #b6c0cc; }

.login-input-group input.login-code {
    letter-spacing: 0.35em;
    font-weight: 700;
    font-size: 1.05rem;
}
.login-input-group input.login-code::placeholder { letter-spacing: normal; font-weight: 400; font-size: 0.95rem; }

.login-alert--ok { background: #e7f6ec; color: #1d7a3e; }

/* ---------- Móvil / tablet: cabecera con foto + tarjeta superpuesta ---------- */
@keyframes loginRise {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
}

@keyframes loginDrift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .9; }
    50%      { transform: translate3d(-6%, -4%, 0) scale(1.15); opacity: 1; }
}

@media (max-width: 991.98px) {
    .login-page { display: block; background: #001d3d; }

    /* Las fotos cubren toda la ventana; la tarjeta flota encima */
    .login-brand {
        position: fixed;
        inset: 0;
        min-height: 0;
        padding: 1.75rem 1.25rem;
        justify-content: flex-start;
        z-index: 0;
    }

    /* Velo más liviano para que se aprecien las fotos */
    .login-brand__scrim {
        background: linear-gradient(180deg, rgba(0, 15, 33, 0.8) 0%, rgba(0, 42, 89, 0.4) 38%, rgba(0, 29, 61, 0.62) 100%);
    }

    .login-brand__glow { animation: loginDrift 9s ease-in-out infinite; }

    .login-brand__content { max-width: 100%; width: 100%; }
    .login-brand__logo,
    .login-brand__subtitle,
    .login-brand__dots { display: none; }

    .login-brand__title {
        font-size: 1.4rem;
        line-height: 1.25;
        margin: 0.5rem 0 1.1rem;
        text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
        animation: loginRise .7s .1s ease both;
    }

    .login-brand__title::before {
        content: "DAP ANT\00C1RTICA";
        display: block;
        font-size: 0.72rem;
        letter-spacing: 0.32em;
        font-weight: 700;
        color: #ff9d4d;
        margin-bottom: 0.5rem;
    }

    /* Chips en una fila deslizable */
    .login-brand__stats {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        overflow-x: auto;
        margin: 0 -1.25rem;
        padding: 0.25rem 1.25rem;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
                mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
        animation: loginRise .7s .25s ease both;
    }
    .login-brand__stats::-webkit-scrollbar { display: none; }
    .login-brand__stat { flex: 0 0 auto; font-size: 0.78rem; padding: 0.45rem 0.85rem; gap: 0.45rem; }

    /* Aeropuertos al pie de la pantalla */
    .login-brand__route { bottom: 1.1rem; opacity: 0.85; }

    .login-form-panel {
        position: relative;
        z-index: 5;
        min-height: 100vh;
        min-height: 100dvh;
        box-sizing: border-box;
        align-items: center;
        padding: 9rem 1rem 4.75rem;
        background: transparent;
        pointer-events: none;
    }
    .login-form-wrap { pointer-events: auto; }

    .login-form-wrap {
        background: #fff;
        padding: 1.5rem 1.5rem 1.75rem;
        border-radius: 22px;
        box-shadow: 0 18px 44px rgba(15, 35, 60, 0.16);
        animation: loginRise .6s .15s ease both;
    }

    .login-form-wrap__logo {
        display: block;
        width: 130px;
        aspect-ratio: 2000 / 760;
        object-fit: cover;
        object-position: center 47%;
        margin: 0 auto 1rem;
    }

    .login-form-wrap h1 { text-align: center; font-size: 1.4rem; }
    .login-form-wrap p.subtitle { text-align: center; margin-bottom: 1.5rem; }
    .login-form-footer { margin-top: 1.5rem; }
}

@media (max-width: 420px) {
    .login-form-wrap { padding: 1.35rem 1.15rem 1.5rem; }
    .login-options { font-size: 0.78rem; gap: 0.5rem 0.75rem; }
}

@media (max-width: 380px) {
    .login-form-panel { padding-top: 8.5rem; }
    .login-brand__title { font-size: 1.25rem; }
    .login-options { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .login-brand__glow, .login-brand__title, .login-brand__stats, .login-form-wrap, .login-view { animation: none; }
}
