/* Inicio de sesión: tarjeta de cristal sobre la foto de la fachada, con un desenfoque ligero */
.login-page {
    --brand: #0b6b53;
    --brand-dark: #084c3c;
    --ink: #0f1f2a;
    --muted: #64748b;
    --line: #dfe6ea;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    /* La tarjeta baja hacia las cortinas para que el letrero y el logo de arriba queden a la vista */
    padding: clamp(1.5rem, 18vh, 11rem) 1rem 1.5rem;
    overflow: hidden;
    isolation: isolate;
}

/* Foto de fondo. Se agranda un poco para que el desenfoque no deje bordes claros. */
.login-bg {
    position: fixed;
    inset: -2rem;
    z-index: -1;
    background:
        /* viñeta: oscurece arriba y abajo y deja respirar el letrero */
        linear-gradient(180deg, rgba(8, 20, 28, .40) 0%, rgba(8, 20, 28, .08) 32%, rgba(8, 40, 33, .20) 62%, rgba(8, 20, 28, .62) 100%),
        /* foto: se sube para que el letrero quede arriba de la tarjeta */
        url("../img/login-bg.jpg") center 82% / cover no-repeat #1b2b36;
    filter: blur(3px);
    transform: scale(1.03);
}

.login-card {
    width: 100%;
    max-width: 28rem;
    padding: 2.4rem 2.4rem 1.8rem;
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 1.5rem;
    box-shadow: 0 30px 70px rgba(6, 16, 22, .5), 0 2px 8px rgba(6, 16, 22, .22), inset 0 1px 0 rgba(255, 255, 255, .8);
    animation: login-in .5s cubic-bezier(.2, .8, .2, 1) both;
}

.login-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.8rem; }
.login-logo {
    display: grid; place-items: center; flex: none;
    width: 3.5rem; height: 3.5rem; border-radius: 1rem;
    background: linear-gradient(135deg, #0b6b53, #12a37f);
    box-shadow: 0 8px 18px rgba(11, 107, 83, .38);
    font-size: 1.6rem;
}
.login-brand h1 { margin: 0; color: var(--ink); font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.login-brand p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }

.login-field { margin-bottom: 1.15rem; }
.login-field label { display: block; margin-bottom: .4rem; color: var(--ink); font-size: .9rem; font-weight: 600; }
.login-field input {
    width: 100%;
    padding: .85rem 1rem;
    background: rgba(255, 255, 255, .75);
    border: 1px solid var(--line);
    border-radius: .85rem;
    color: var(--ink);
    font-size: 1.05rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field input::placeholder { color: #94a3b8; }
.login-field input:focus { outline: 0; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 107, 83, .18); }

.login-error {
    margin-bottom: 1.15rem;
    padding: .7rem .95rem;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: .8rem;
    color: #991b1b;
    font-size: .92rem;
}

.login-submit {
    width: 100%;
    padding: .9rem 1rem;
    background: linear-gradient(180deg, #0f7d62, var(--brand));
    border: 0;
    border-radius: .85rem;
    box-shadow: 0 8px 18px rgba(11, 107, 83, .38);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: filter .15s, transform .15s, box-shadow .15s;
}
.login-submit:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(11, 107, 83, .45); }
.login-submit:active { transform: translateY(0); }
.login-submit:focus-visible { outline: 3px solid rgba(11, 107, 83, .45); outline-offset: 3px; }

.login-foot { margin: 1.4rem 0 0; color: var(--muted); font-size: .82rem; text-align: center; }

@keyframes login-in { from { opacity: 0; transform: translateY(18px); } }

/* Pantallas bajas (laptops chicas): menos aire arriba */
@media (max-height: 700px) and (min-width: 481px) {
    .login-page { padding-top: clamp(1rem, 12vh, 6rem); }
    .login-card { padding: 1.8rem 2rem 1.4rem; }
    .login-brand { margin-bottom: 1.3rem; }
}

@media (max-width: 480px) {
    .login-page { padding: 1.5rem 1rem; }
    .login-card { padding: 1.6rem 1.35rem 1.3rem; border-radius: 1.2rem; }
    .login-brand h1 { font-size: 1.5rem; }
    /* En pantallas altas la foto se recorta: se encuadra el letrero y el logo en lugar del centro */
    .login-bg { background-position: center, 30% 30%; }
}
@media (prefers-reduced-motion: reduce) { .login-card { animation: none; } }
/* Sin soporte de backdrop-filter la tarjeta queda casi opaca para que se lea bien */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .login-card { background: rgba(255, 255, 255, .97); } }
