/* static/css/custom.css */

/* --- Estilos para el Nuevo Login --- */

/* Contenedor principal que centra la tarjeta en la página */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh; /* Ocupa casi toda la altura de la pantalla */
}

@property --glow-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.login-card-glow {
    position: relative;
    display: inline-block;
    width: 900px;
    height: 550px;
    border-radius: 15px;
    isolation: isolate;
    overflow: visible;
}

.login-card-glow::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 17px;
    z-index: 0;
    pointer-events: none;

    background: conic-gradient(
        from var(--glow-angle),

        rgba(var(--color-primary-rgb), 0.12) 0deg,
        rgba(var(--color-primary-rgb), 0.12) 150deg,
        rgba(var(--color-primary-rgb), 0.15) 180deg,
        rgba(var(--color-primary-rgb), 0.22) 210deg,
        rgba(var(--color-primary-rgb), 0.36) 240deg,
        rgba(var(--color-primary-rgb), 0.58) 275deg,
        rgba(var(--color-primary-rgb), 0.82) 305deg,
        rgba(var(--color-primary-rgb), 1.00) 325deg,
        rgba(var(--color-primary-rgb), 0.72) 340deg,
        rgba(var(--color-primary-rgb), 0.38) 350deg,
        rgba(var(--color-primary-rgb), 0.18) 358deg,
        rgba(var(--color-primary-rgb), 0.12) 360deg
    );

    filter: blur(26px);
    opacity: 1;

    animation: rotateGlow 3s linear infinite;
}

/* La tarjeta tapa la parte interior del halo */
.login-card {
    position: relative;
    z-index: 1;

    display: flex;
    width: 100%;
    height: 100%;

    background-color: var(--color-secondary);
    border-radius: 15px;
    overflow: hidden;
    color: var(--color-tertiary-light);

    border: 1px solid rgba(var(--color-primary-rgb), 0.50);
    box-shadow: none;
}

@keyframes rotateGlow {
    from {
        --glow-angle: 0deg;
    }
    to {
        --glow-angle: 360deg;
    }
}

/* Columna del formulario */
.form-section {
    width: 50%;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
}

/* Columna del gráfico */
.graphic-section {
    width: 50%;
    background-image: url('https://images.unsplash.com/photo-1554147090-e1221a04a025?q=80&w=2070'); /* ¡CAMBIA ESTA URL POR TU IMAGEN! */
    background-size: cover;
    background-position: center;
}

/* Títulos y textos */
.form-section .title {
    font-size: 2rem; /* 32px */
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    text-align: center;
}
.form-section .subtitle {
    font-size: 0.9rem;
    color: var(--color-tertiary-light);
    margin-bottom: 30px;
}
.form-section .register-link {
    color: var(--color-primary);
    text-decoration: none;
}
.form-section .register-link:hover {
    text-decoration: underline;
}

/* Grupo de input + label para el efecto flotante */
.input-group {
    position: relative;
    margin-bottom: 25px;
}

/* Estilo de los campos de texto */
.login-input {
    width: 100%;
    padding: 10px 0;
    font-size: 1rem;
    color: #ffffff;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--color-secondary-light); /* Línea sutil */
    outline: none;
}

/* Estilo de las etiquetas */
.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: var(--color-tertiary-light);
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Efecto flotante: cuando el input está enfocado o tiene texto */
.login-input:focus + label,
.login-input:not(:placeholder-shown) + label {
    top: -15px;
    font-size: 0.8rem;
    color: var(--color-primary);
}

/* Opciones (Remember me) */
.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 30px;
}
.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.remember-me input {
    margin-right: 8px;
}

/* Botón de Login */
.login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 25px;
    color: var(--color-secondary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--color-primary-rgb), 0.4);
}

/* Flecha de volver */
.back-arrow {
    color: var(--color-tertiary-light);
    text-decoration: none;
    font-size: 1.5rem;
    margin-bottom: 20px;
    align-self: flex-start;
}

/* Estilo para los errores del formulario */
.form-errors ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 15px 0;
    color: #ff4d4d;
    background-color: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-radius: 5px;
    padding: 10px;
    font-size: 0.9rem;
}
html,
body {
    /* 1. Establecemos la imagen de fondo */
   /* background-image: url('/static/img/login-bg.jpg');*/


/* ------------ORIGINAL----------- */
    /* Usamos un gradiente lineal como overlay sobre la imagen */
    /* background-image: linear-gradient(rgba(var(--color-secondary-rgb), 0.75), rgba(var(--color-secondary-rgb), 0.75)), url('/static/image/app_base/fondo_login2.png');

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: 'Roboto', sans-serif; */
/* ---------------------- */
    min-height: 100%;
    margin: 0;
    background-color: var(--color-secondary-dark);
    background-image: none;
    font-family: 'Roboto', sans-serif;
}

@media (max-width: 920px) {
    .login-card-glow {
        width: 90vw; /* La tarjeta se hace fluida en lugar de tener un ancho fijo */
        height: auto; /* La altura se ajusta al contenido */
    }

    .form-section {
        padding: 40px 30px; /* Reducimos un poco el padding lateral */
    }
}


/* Para móviles y pantallas pequeñas */
@media (max-width: 768px) {
    /* Hacemos que el contenedor principal ocupe más espacio verticalmente */
    .login-container {
        min-height: 100vh;
        padding: 20px 0;
    }

    .login-card {
        /* 1. Cambiamos la dirección: los elementos se apilarán verticalmente */
         flex-direction: column-reverse;
    }

    .login-card-glow {
        /* 2. Le quitamos el ancho fijo para que se adapte al móvil */
        width: 90vw;
        max-width: 400px; /* Un límite para que no se vea demasiado ancho en tablets verticales */
        height: auto;
    }

    /* 3. Hacemos que ambas secciones (formulario e imagen) ocupen el 100% del ancho de la tarjeta */
    .form-section,
    .graphic-section {
        width: 100%;
    }

    /* 4. Le damos una altura fija a la sección de la imagen para que no desaparezca */
    .graphic-section {
        height: 200px; 
        /* Si prefieres ocultar la imagen en móviles, descomenta la siguiente línea: */
        /* display: none; */
    }

    /* 5. Ajustamos el título para que no esté tan pegado en móviles */
    .form-section .title {
        text-align: center; /* Centramos el título en móvil, se ve mejor */
        margin-top: 10px;
    }
}