/* Fondo degradado sutil */
body {
    background: linear-gradient(135deg, #ffffff 0%, #fdfdff 100%);
    overflow: hidden;
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Contenedor de esferas */
#spheres-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Estilos de esferas individuales */
.sphere {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 0.81), transparent);
    box-shadow: 
        inset 0 -5px 20px rgba(255, 255, 255, 0.74),
        inset 0 5px 20px rgba(0, 0, 0, 0.68),
        0 5px 15px rgba(0, 0, 0, 0.47);
    transition: opacity 0.5s ease;
}

/* Colores de las esferas */
.sphere.cobalt {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.73), rgb(1, 47, 110));
    box-shadow: 
        inset 0 -5px 20px rgba(255, 255, 255, 0.8),
        inset 0 5px 20px rgba(0, 71, 171, 0.9),
        0 5px 15px rgba(0, 71, 171, 0.85);
}

.sphere.light-gray {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(117, 114, 114, 0.84));
    box-shadow: 
        inset 0 -5px 20px rgba(165, 165, 165, 0.8),
        inset 0 5px 20px rgba(137, 153, 177, 0.3),
        0 5px 15px rgba(105, 128, 161, 0.2);
}

/* Efecto de brillo */
.sphere::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 20%;
    height: 20%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    filter: blur(2px);
}

/* Animación de flotación */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(180deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(250px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(250px) rotate(-360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
}

/* Media query para dispositivos móviles */
@media (max-width: 768px) {
    .sphere {
        opacity: 0.15;
    }
    
    .sphere:not(.center-sphere) {
        opacity: 0.1;
    }
    
    @keyframes orbit {
        from {
            transform: rotate(0deg) translateX(150px) rotate(0deg);
        }
        to {
            transform: rotate(360deg) translateX(150px) rotate(-360deg);
        }
    }
}

/* Para móviles muy pequeños */
@media (max-width: 480px) {
    .sphere {
        opacity: 0.15;
    }
    
    .sphere:not(.center-sphere) {
        display: none;
    }
}

/* Estilos adicionales para seguridad visual */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.input-error {
    border-color: #f87171 !important;
    background-color: #fef2f2 !important;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #f87171;
    background-color: #fef2f2;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 18px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 5px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Estilos mejorados para mensajes de alerta */
.alert-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInDown 0.5s ease-out;
    border-left: 4px solid;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-error {
    background-color: #fee;
    border-left-color: #f59e0b;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
    color: #79340a;
}

.alert-success {
    background-color: #d4edda;
    border-left-color: #10b981;
    color: #065f46;
}

.alert-info {
    background-color: #e0f2fe;
    border-left-color: #3b82f6;
    color: #075985;
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
}

.alert-message-text {
    margin: 0;
    font-size: 0.95rem;
}

.alert-progress-bar {
    margin-top: 8px;
    height: 3px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.alert-progress {
    height: 100%;
    width: 100%;
    background-color: currentColor;
    animation: progressShrink 5s linear forwards;
}

@keyframes progressShrink {
    from { width: 100%; }
    to { width: 0%; }
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}

/* Contador de intentos */
.attempts-counter {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.8rem;
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 6px;
}

.form-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}
