/* ================================================================
   login-glass.css — Login en pantalla dividida (AidaSys)
   Izquierda: panel de marca con el degradado cyan → verde, logo en
   blanco y beneficios. Derecha: formulario sobre fondo claro con aura.
   En móvil el panel de marca se reduce a una franja arriba.
   Todo va bajo body.lgn. Sustituye a css/login.css solo en login.php;
   login.css lo siguen usando cambiar_password.php y crear_usuario.php.
   ================================================================ */

:root {
    --brand-cyan: #06b6d4;
    --brand-green: #10b981;
    --brand-dark: #0f172a;
    --brand-gradient: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
}

body.lgn {
    --lgn-text: #1e293b;
    --lgn-text-soft: #334155;
    --lgn-text-light: #64748b;
    --lgn-text-muted: #94a3b8;
    --lgn-line: rgba(15, 23, 42, 0.07);

    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f8fafc;
    color: var(--lgn-text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
}

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

body.lgn h1,
body.lgn h2,
body.lgn button {
    font-family: 'Outfit', sans-serif;
}

/* --- Estructura --- */
body.lgn .login-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ================================================================
   PANEL DE MARCA
   ================================================================ */
body.lgn .login-marca {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2rem, 5vw, 4rem);
    background:
        radial-gradient(600px 400px at 85% 10%, rgba(255, 255, 255, 0.18), transparent 60%),
        linear-gradient(150deg, #0891b2 0%, #06b6d4 35%, #10b981 100%);
    color: #fff;
}

/* Formas decorativas (estáticas) */
body.lgn .login-forma {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

body.lgn .login-forma.f1 {
    width: 520px;
    height: 520px;
    right: -220px;
    bottom: -200px;
    border: 70px solid rgba(255, 255, 255, 0.08);
}

body.lgn .login-forma.f2 {
    width: 260px;
    height: 260px;
    left: -110px;
    top: 38%;
    background: rgba(255, 255, 255, 0.07);
}

body.lgn .login-forma.f3 {
    width: 120px;
    height: 120px;
    right: 12%;
    top: 14%;
    border: 18px solid rgba(255, 255, 255, 0.1);
}

body.lgn .login-marca-contenido {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    max-width: 480px;
    margin: auto 0;
}

/* Logo en blanco: el PNG es transparente */
body.lgn .login-marca-logo {
    display: block;
    width: 210px;
    max-width: 70%;
    height: auto;
    filter: brightness(0) invert(1);
}

body.lgn .login-marca-texto h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.7rem, 2.6vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

body.lgn .login-marca-texto p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

body.lgn .login-beneficios {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.lgn .login-beneficios li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

body.lgn .login-beneficios span {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.9rem;
}

body.lgn .login-marca-pie {
    position: relative;
    z-index: 1;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
}

/* ================================================================
   PANEL DEL FORMULARIO
   ================================================================ */
body.lgn .login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background:
        radial-gradient(700px 480px at 100% 0%, rgba(6, 182, 212, 0.10), transparent 65%),
        radial-gradient(600px 420px at 0% 100%, rgba(16, 185, 129, 0.08), transparent 65%),
        #f8fafc;
}

body.lgn .login-card {
    width: 100%;
    max-width: 400px;
}

/* El logo a color solo se ve en móvil (en escritorio ya está en el panel) */
body.lgn .login-card .logo {
    display: none;
}

body.lgn .login-card h1 {
    margin: 0 0 0.35rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-dark);
}

body.lgn .login-subtitulo {
    margin: 0 0 2rem;
    color: var(--lgn-text-light);
    font-size: 0.95rem;
}

/* --- Error --- */
body.lgn .error-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1.25rem;
    padding: 11px 14px;
    border-radius: 12px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.88rem;
    font-weight: 600;
    animation: lgn-shake 0.4s ease-in-out;
}

body.lgn .error-message i {
    margin-top: 2px;
    color: #ef4444;
}

@keyframes lgn-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

/* --- Formulario --- */
body.lgn .form-group {
    margin-bottom: 1.15rem;
}

body.lgn .form-group label {
    display: block;
    margin: 0 0 0.45rem 2px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--lgn-text-soft);
}

body.lgn .input-wrapper {
    position: relative;
}

body.lgn .input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 14px 0 44px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: var(--brand-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
    /* 16px: menos en iOS hace zoom al enfocar */
    font-size: 1rem;
    outline: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.lgn .input-wrapper input::placeholder {
    color: var(--lgn-text-muted);
}

body.lgn .input-wrapper input:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.14);
}

body.lgn .input-wrapper .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lgn-text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

body.lgn .input-wrapper input:focus + .icon {
    color: var(--brand-cyan);
}

body.lgn .input-wrapper.con-ojo input {
    padding-right: 48px;
}

body.lgn .btn-ojo {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--lgn-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

body.lgn .btn-ojo:hover {
    color: var(--brand-cyan);
    background: rgba(6, 182, 212, 0.08);
}

body.lgn .btn-ojo:focus-visible {
    outline: 2px solid var(--brand-cyan);
    outline-offset: 1px;
}

body.lgn .has-error input {
    border-color: #fca5a5;
    background: #fff5f5;
}

body.lgn .has-error .icon {
    color: #ef4444;
}

/* --- Botón --- */
body.lgn .btn-login {
    width: 100%;
    height: 52px;
    margin-top: 0.75rem;
    border: none;
    border-radius: 12px;
    background: var(--brand-gradient);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 22px -10px rgba(6, 182, 212, 0.7);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}

body.lgn .btn-login i {
    transition: transform 0.2s ease;
}

body.lgn .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -10px rgba(6, 182, 212, 0.75);
}

body.lgn .btn-login:hover i {
    transform: translateX(3px);
}

body.lgn .btn-login:active {
    transform: translateY(0);
}

body.lgn .btn-login:focus-visible {
    outline: 3px solid rgba(6, 182, 212, 0.35);
    outline-offset: 2px;
}

body.lgn .btn-login:disabled {
    opacity: 0.8;
    cursor: wait;
    transform: none;
}

/* --- Pie --- */
body.lgn .login-footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--lgn-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--lgn-text-muted);
}

body.lgn .login-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0e7490;
    font-weight: 600;
    text-decoration: none;
}

body.lgn .login-footer a:hover {
    color: var(--brand-cyan);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tableta: el panel de marca se angosta y pierde la lista */
@media (max-width: 1100px) {
    body.lgn .login-split {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    }

    body.lgn .login-beneficios li {
        font-size: 0.88rem;
    }
}

/* Móvil: franja de marca arriba y el formulario en tarjeta encima */
@media (max-width: 820px) {
    body.lgn .login-split {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    body.lgn .login-marca {
        padding: 28px 20px 64px;
        gap: 0;
    }

    body.lgn .login-marca-contenido {
        gap: 0.9rem;
        margin: 0;
        align-items: center;
        text-align: center;
        max-width: none;
    }

    body.lgn .login-marca-logo {
        width: 150px;
    }

    body.lgn .login-marca-texto h2 {
        font-size: 1.15rem;
        margin: 0;
    }

    body.lgn .login-marca-texto p,
    body.lgn .login-beneficios,
    body.lgn .login-marca-pie,
    body.lgn .login-forma.f2 {
        display: none;
    }

    body.lgn .login-forma.f1 {
        width: 300px;
        height: 300px;
        right: -140px;
        bottom: -170px;
        border-width: 45px;
    }

    body.lgn .login-forma.f3 {
        width: 80px;
        height: 80px;
        right: auto;
        left: -20px;
        top: -20px;
        border-width: 14px;
    }

    body.lgn .login-panel {
        align-items: flex-start;
        padding: 0 16px 24px;
        background: #f8fafc;
    }

    body.lgn .login-card {
        position: relative;
        margin-top: -40px;
        padding: 1.75rem 1.25rem 1.25rem;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        border: 1px solid rgba(226, 232, 240, 0.9);
        border-radius: 22px;
        box-shadow: 0 24px 50px -24px rgba(15, 23, 42, 0.3);
    }

    body.lgn .login-card h1 {
        font-size: 1.5rem;
    }

    body.lgn .login-subtitulo {
        margin-bottom: 1.5rem;
    }

    body.lgn .login-footer {
        justify-content: center;
        text-align: center;
        margin-top: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.lgn .error-message {
        animation: none;
    }
}
