/* Estilos generales del login */
body {
    background-color: #181c27;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow-x: hidden;
}

:root {
    --primary-gradient: linear-gradient(135deg, #1652f0 0%, #0a2540 100%);
    --accent-gradient: linear-gradient(45deg, #00c6fb 0%, #005bea 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* NUEVOS AJUSTES: Se adaptan márgenes, padding y tamaños para optimizar la experiencia en dispositivos modernos */
.login-page {
    min-height: 100vh;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Fondo animado */
.login-container {
    min-height: 100vh;
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 0 30px rgba(0, 128, 255, 0.2);
}

/* Ribbon animado */
.moebius-ribbon {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background: linear-gradient(
        45deg,
        #00ff8830,
        #00a85530,
        #007c4030
    );
    animation: moveRibbon 15s linear infinite;
}

@keyframes moveRibbon {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.5);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}
/* Tarjeta de login */
.login-card {
    background: #FBF8FF !important;
    border: 2px solid #A259FF !important;
    color: #1A1A1A !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Logo y header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    max-width: 200px;
    margin-bottom: 1.5rem;
}

.login-header h4 {
    color: #1A1A1A !important;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #1A1A1A !important;
    font-size: 0.9rem;
}

/* Formulario */
.login-form {
    margin-bottom: 2rem;
}

.form-floating {
    margin-bottom: 1rem;
}

.form-floating input {
    border-radius: 8px;
    border: 1px solid #ddd;
}

.form-floating label {
    color: #1A1A1A !important;
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.75rem;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #0080ff;
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.3);
}

.form-floating>.form-control,
.form-floating>.form-select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.form-floating>label {
    color: rgba(255, 255, 255, 0.7);
}

.form-floating>.form-control:focus,
.form-floating>.form-select:focus {
    border-color: #4f76e0;
    box-shadow: 0 0 0 0.25rem rgba(79, 118, 224, 0.25);
}

.form-floating>.form-control:not(:placeholder-shown)~label,
.form-floating>.form-select:not(:placeholder-shown)~label {
    color: rgba(255, 255, 255, 0.7);
}

.btn-primary {
    background-color: #A259FF !important;
    border-color: #A259FF !important;
    width: 100%;
    padding: 12px;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: #7A40CC !important;
    border-color: #7A40CC !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Footer y términos legales */
.login-footer {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.login-footer .legal-links {
    margin: 1rem 0;
}

.login-footer .legal-links a {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0.5rem;
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer .legal-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.login-footer .copyright {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 576px) {
    .login-box {
        padding: 2rem 1.5rem;
    }

    .logo-container img {
        width: 150px;
    }

    .btn-primary {
        height: 50px;
    }
}

/* Mejoras para el oso */
.bear-section {
    margin: 2rem auto;
    width: 120px;
    height: 120px;
    transition: transform 0.3s ease;
}

.bear-section:hover {
    transform: scale(1.1);
}

/* Efectos de neón mejorados */
.neon-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: #0c111b;
}

.neon-circle {
    position: absolute;
    border-radius: 50%;
    background: #4f76e0;
    filter: blur(80px);
    opacity: 0.4;
    transition: all 1.5s ease;
    animation: float 15s infinite alternate;
}

/* Múltiples círculos con diferentes colores y animaciones */
.neon-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -100px;
    background: #4285f4;
    animation-delay: 0s;
}

.neon-circle:nth-child(2) {
    width: 400px;
    height: 400px;
    top: -150px;
    right: -100px;
    background: #7c4dff;
    animation-delay: 2s;
}

.neon-circle:nth-child(3) {
    width: 250px;
    height: 250px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #00c853;
    animation-delay: 4s;
}

.neon-circle:nth-child(4) {
    width: 200px;
    height: 200px;
    bottom: 10%;
    right: 20%;
    background: #ff5722;
    animation-delay: 6s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }
    100% {
        transform: translateY(-20px) scale(1.1);
    }
}

/* Animaciones individuales para cada círculo */
@keyframes floatNeon1 {
    0%, 100% { transform: translate(0, 0) scale(1); filter: blur(80px); }
    25% { transform: translate(100px, -50px) scale(1.2); filter: blur(100px); }
    50% { transform: translate(50px, 100px) scale(0.8); filter: blur(60px); }
    75% { transform: translate(-50px, -80px) scale(1.1); filter: blur(90px); }
}

@keyframes floatNeon2 {
    0%, 100% { transform: translate(0, 0) scale(1); filter: blur(80px); }
    25% { transform: translate(-80px, 60px) scale(1.3); filter: blur(100px); }
    50% { transform: translate(-40px, -80px) scale(0.9); filter: blur(70px); }
    75% { transform: translate(60px, 40px) scale(1.1); filter: blur(90px); }
}

@keyframes floatNeon3 {
    0%, 100% { transform: translate(0, 0) scale(1); filter: blur(80px); }
    33% { transform: translate(70px, -70px) scale(1.2); filter: blur(100px); }
    66% { transform: translate(-60px, 60px) scale(0.8); filter: blur(60px); }
}

@keyframes floatNeon4 {
    0%, 100% { transform: translate(0, 0) scale(1); filter: blur(80px); }
    33% { transform: translate(-50px, -90px) scale(1.3); filter: blur(100px); }
    66% { transform: translate(80px, 40px) scale(0.9); filter: blur(70px); }
}

/* Animaciones de error y éxito mejoradas */
.login-error, .login-success {
    animation: none;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes errorGlow {
    0% { 
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
        border-color: rgba(255, 0, 0, 0.5);
    }
    50% { 
        box-shadow: 0 0 50px rgba(255, 0, 0, 0.5), inset 0 0 30px rgba(255, 0, 0, 0.3);
        border-color: rgba(255, 0, 0, 0.8);
    }
    100% { 
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
        border-color: rgba(255, 0, 0, 0.5);
    }
}

@keyframes successGlow {
    0% { 
        box-shadow: 0 0 30px rgba(0, 255, 128, 0.3);
        border-color: rgba(0, 255, 128, 0.5);
    }
    50% { 
        box-shadow: 0 0 50px rgba(0, 255, 128, 0.5), inset 0 0 30px rgba(0, 255, 128, 0.3);
        border-color: rgba(0, 255, 128, 0.8);
    }
    100% { 
        box-shadow: 0 0 30px rgba(0, 255, 128, 0.3);
        border-color: rgba(0, 255, 128, 0.5);
    }
}

/* Campos de formulario */
.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #0080ff;
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.3);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-floating input:focus {
    outline: 2px solid #4f76e0;
}

/* Botón de login */
.btn-login {
    background: linear-gradient(45deg, #0066ff, #00ff99);
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 128, 255, 0.4);
}

.btn-login:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    animation: buttonGlow 2s linear infinite;
}

@keyframes buttonGlow {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

/* Animaciones de estados */
.login-success {
    animation: success-anim 1s forwards;
}

.login-error {
    animation: error-anim 0.5s;
}

@keyframes success-anim {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(0, 255, 153, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(0, 255, 153, 0.3);
    }
}

@keyframes error-anim {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-10px);
    }
    40%, 80% {
        transform: translateX(10px);
    }
}

/* Estilos para mensajes de error */
.alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}

/* Animación de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #A259FF !important;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
