/* =====================================================================
   PANTALLAS DE INICIO DE SESION (empleados: /login.php, admin: /admin/login.php)
   Estilo "glassmorphism": tarjeta translucida y desenfocada sobre la foto
   de portada, esquinas muy redondeadas y adaptada a movil.
   ===================================================================== */

.lg-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #fff;
    background-color: #0b3d2e;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Capa de color sobre la foto: da contraste para leer y el toque verde/azul
   de jardines y piscinas */
.lg-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 10% 10%, rgba(34, 197, 94, 0.35), transparent 60%),
        radial-gradient(900px 600px at 90% 90%, rgba(14, 165, 233, 0.40), transparent 60%),
        linear-gradient(135deg, rgba(4, 30, 22, 0.70), rgba(3, 25, 45, 0.70));
    z-index: 0;
}

/* Burbujas decorativas desenfocadas */
.lg-body::after {
    content: "";
    position: fixed;
    width: 420px;
    height: 420px;
    right: -120px;
    top: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
    filter: blur(10px);
    z-index: 0;
    pointer-events: none;
}

.lg-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* ---------------------------------------------------------------------
   TARJETA DE CRISTAL
   --------------------------------------------------------------------- */
.lg-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 30px;
    box-sizing: border-box;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    animation: lg-entrada 0.5s ease-out both;
}

/* Navegadores sin desenfoque: fondo mas opaco para que se lea igual */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .lg-card { background: rgba(10, 40, 35, 0.85); }
}

@keyframes lg-entrada {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .lg-card { animation: none; }
}

/* Logo y titulos */
.lg-logo {
    width: 84px;
    height: 84px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lg-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.lg-titulo {
    margin: 0;
    text-align: center;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    line-height: 1.2;
}
.lg-subtitulo {
    margin: 6px 0 26px;
    text-align: center;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.78);
}
.lg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto 14px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.lg-chip-wrap { text-align: center; }

/* ---------------------------------------------------------------------
   CAMPOS
   --------------------------------------------------------------------- */
.lg-campo {
    position: relative;
    margin-bottom: 16px;
}
.lg-campo label {
    display: block;
    margin: 0 0 7px 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}
.lg-campo .lg-icono {
    position: absolute;
    left: 16px;
    bottom: 0;
    height: 50px;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    pointer-events: none;
}
.lg-campo input.lg-input {
    display: block;
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    padding: 0 16px 0 44px;
    font-size: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 14px;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.lg-campo input.lg-input::placeholder { color: rgba(255, 255, 255, 0.55); }
.lg-campo input.lg-input:focus {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}
/* Autocompletado de Chrome/Edge: que no ponga el fondo amarillo */
.lg-campo input.lg-input:-webkit-autofill,
.lg-campo input.lg-input:-webkit-autofill:hover,
.lg-campo input.lg-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px rgba(20, 60, 55, 0.95) inset;
    caret-color: #fff;
    transition: background-color 9999s ease-out 0s;
}
/* Campo marcado como erroneo por script.js */
.lg-campo input.lg-input.is-invalid {
    border-color: rgba(255, 120, 120, 0.9);
    box-shadow: 0 0 0 4px rgba(255, 90, 90, 0.18);
    background-image: none;
}

/* Contraseña: hueco a la derecha para el ojo */
.lg-campo input.lg-input.lg-con-ojo { padding-right: 52px; }

/* Boton del ojo para ver lo que se va escribiendo */
.lg-ojo {
    position: absolute;
    right: 6px;
    bottom: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.lg-ojo:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.lg-ojo:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 1px; }

/* ---------------------------------------------------------------------
   BOTON Y MENSAJES
   --------------------------------------------------------------------- */
.lg-boton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 52px;
    margin-top: 8px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #22c55e 0%, #0ea5e9 100%);
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.35);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.lg-boton:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(14, 165, 233, 0.45); }
.lg-boton:active { transform: translateY(1px); }
.lg-boton:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }

/* Mensajes de error que inserta script.js (.err_msg) y el del admin */
.lg-card .err_msg,
.lg-card #login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 140, 140, 0.55);
    background: rgba(220, 38, 38, 0.28) !important;
    color: #fff !important;
    font-size: 0.9rem;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.lg-pie {
    margin-top: 22px;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
}
.lg-pie a { color: rgba(255, 255, 255, 0.85); text-decoration: underline; }

/* ---------------------------------------------------------------------
   MOVIL
   --------------------------------------------------------------------- */
@media (max-width: 480px) {
    .lg-wrap { padding: 16px 12px; align-items: flex-start; padding-top: 8vh; }
    .lg-card { padding: 28px 20px 24px; border-radius: 24px; }
    .lg-logo { width: 72px; height: 72px; }
    .lg-titulo { font-size: 1.35rem; }
    .lg-subtitulo { margin-bottom: 20px; }
    /* 16px: el iPhone no amplia la pantalla al tocar el campo */
    .lg-campo input.lg-input { font-size: 16px; }
}

/* En moviles la foto fija da tirones: se desplaza con la pagina */
@media (max-width: 991.98px) {
    .lg-body { background-attachment: scroll; }
}
